自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

I am KunKun

昆昆加油~

  • 博客(36)
  • 收藏
  • 关注

原创 【mysql】Windows下强制修改root密码

Mysql版本:5.1 1、 首先检查mysql服务是否启动,若已启动则先将其停止服务,可在开始菜单的运行,使用命令:net stop mysql  打开第一个cmd窗口,切换到mysql的bin目录,运行命令:mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server

2014-11-11 20:36:02 711

原创 [POJ 2482]Stars in Your Window 扫描线

题目链接:http://poj.org/problem?id=2482题目大意:平面上有n个星星,

2014-09-26 15:44:14 418

原创 [POJ 2104]K-th Number 主席树

K-th NumberTime Limit: 20000MS Memory Limit: 65536KTotal Submissions: 37883 Accepted: 12273Case Time Limit: 2000MSDescriptionYou are working for Macrohard c

2014-09-24 18:00:51 424

原创 [POJ 1823] Hotel 线段树区间合并

HotelTime Limit: 5000MS Memory Limit: 30000KTotal Submissions: 2064 Accepted: 885DescriptionThe "Informatics" hotel is one of the most luxurious hotels from Galac

2014-09-23 00:29:31 424

原创 LightOJ 1097 - Lucky Number [线段树二分前缀和构造数列]

1097 - Lucky NumberPDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 64 MBLucky numbers are defined by a variation of the well-known siev

2014-09-10 21:13:06 1133

原创 LightOJ 1087 - Diablo[线段树二分前缀和]

1087 - DiabloPDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 64 MBAll of you must have played the game 'Diablo'. It's an exclusive game

2014-09-10 00:08:04 528

原创 1266 - Points in Rectangle[二维树状数组 + 容斥原理]

1266 - Points in RectanglePDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBAs the name says, this problem is about finding the numb

2014-09-03 00:07:24 373

原创 1085 - All Possible Increasing Subsequences[树状数组]

1085 - All Possible Increasing SubsequencesPDF (English)StatisticsForumTime Limit: 3 second(s)Memory Limit: 64 MBAn increasing subsequence from a sequen

2014-09-01 22:23:33 447

原创 1080 - Binary Simulation[树状数组]

1080 - Binary SimulationPDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 64 MBGiven a binary number, we are about to do some operations

2014-09-01 22:12:07 413

原创 今天不刷题

如题,今天不刷题。今天感觉到有点累,早上从飞机

2014-08-30 23:30:10 469

原创 1011 - Marriage Ceremonies[状态压缩dp]

1011 - Marriage CeremoniesPDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBYou work in a company which organizes marriages. Marriag

2014-08-29 22:15:39 405

原创 USACO 2002 February

今天刷了刷USACO 2002 February,从年份上看题目已经很老了。。可是我还是刷不动。。。只能说是自己太弱了   还是需要多加练习才是啊。今天只做了三道题。。其中有一道题是刚才补得。。学习了一下树形dp。。实在是惭愧的很。。POJ 1949 - Chores(这是我做的这套题里的第一道题目)题目大意:给你N个任务,这些任务是可以并行开始的,但是部分

2014-08-29 20:32:14 519

原创 1005 - Rooks [组合数学]

1005 - RooksPDF (English)StatisticsForumTime Limit: 1 second(s)Memory Limit: 32 MBA rook is a piece used in the game of chess which is played on a board

2014-08-28 22:39:26 521

原创 [ACM]5/28/2014 HDU-1203[dp]

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1203题目大意:给你

2014-05-28 23:10:18 524

原创 Codeforces Round #197

A题  数字排序把输入的字符串里的数字挑出来,从小到大排序,每两个数字中间加一个加号就好import java.util.*;public class Main{ public static void main(String[] args){ String s; Scanner cin = new Scanner(System.in); List ls = new Arr

2013-08-28 13:32:21 422

原创 HDU 1005 Number Sequence 找循环位置

找个循环位置出来  然后取余就好import java.io.*;import java.util.*;public class Main{ public static void main(String[] args) throws IOException{ StreamTokenizer cin = new StreamTokenizer( new Bu

2013-08-25 17:18:50 477

原创 HDU 1004 Let the Balloon Rise Map的应用

对于Map的应用  水题import java.io.*;import java.util.*;public class Main{ public static void main(String[] args) throws IOException{ StreamTokenizer cin = new StreamTokenizer( new Buffer

2013-08-25 17:17:22 465

原创 HDU 1003 Max Sum 动态规划

动态规划也可以不记录结果到数组中import java.io.*;public class Main{ public static void main(String[] args) throws IOException{ StreamTokenizer cin = new StreamTokenizer( new BufferedReader( new InputStr

2013-08-25 17:15:40 486

原创 HDU 1002 A+B Problem II 大数相加

java里的BigInteger。。还是很好用的import java.io.*;import java.util.*;import java.math.*;public class Main{ public static void main(String[] args) throws IOException{ BufferedReader cin =

2013-08-25 17:13:49 565

原创 Codeforces 5C Longest Regular Bracket Sequence dp+stack

原来dp这个东西的前一个下标还可以用栈来记录啊。。我土了- -#include #include #include #include using namespace std;int dp[1001000];string s;stack st;int main(){ cin >> s; int len=s.size(); for(int i=0;i<len;i

2013-08-21 17:05:39 631

原创 Codeforces 5A Chat Servers Outgoing Traffic set的使用

水过~#include #include #include using namespace std;int nc=0;set se;int main(){ string s; int ans=0; while( getline(cin,s) ) { if(s[0]=='+') { if(!se.count(s.substr(1))) {

2013-08-21 14:26:00 624

原创 Codeforces 4D Mysterious Present dp和dfs dp还得多练

dp还得多练。。总是木有思路啊。。#include using namespace std;#define N 50050struct node{ int w,h;};int dp[N],next[N];node p[N];int n;int dfs(int c){ if(dp[c]) return dp[c]; for(int i=0;i<=n;i++)

2013-08-21 13:58:55 808

原创 Codeforces 4C Registration System map的应用

大水题掌握好stl中的map容器就好。#include #include #include using namespace std;map m;int main(){ int n; string name; cin >> n; while( n-- ) { cin >> name; if( !m.count(name) ) { m

2013-08-21 12:17:44 773

原创 Codeforces 4B Before an Exam

贪心#include #include using namespace std;struct node{ int u,l,r,idx; node(int au=0,int al=0,int ar=0,int ai=0):u(au),l(al),idx(ai),r(ar) {}};inline bool cmpbyu(const node& a,const node&

2013-08-20 16:52:06 614

原创 Codeforces 3D Least Cost Bracket Sequence 贪心

这是一个好题要想保证括号的合法性,就得在遇到一个括号的时候就判断之前的左括号是不是少于右括号,如果少于就给他扳过来。#include #include #include using namespace std;class node{public: long long p,idx; node( long long ap=0 ): p(ap),idx(0) {} bool o

2013-08-20 15:55:20 891

原创 Codeforces 3C tic-tac-toe 考虑问题要全面点

不得不说我考虑问题太不够全面了#include #include #include using namespace std;char map[5][5];bool judge(char c){ for(int i=1;i<=3;i++) { if(map[i][1]==c&&map[i][2]==c&&map[i][3]==c) return true;

2013-08-20 15:02:05 670

原创 Codeforces 3B Lorry 贪心

分开处理,把1和2分开存放到不同的容器中,然后分别排序。先处理1,再处理2,再处理跨1和2的。#include #include #include #include #include using namespace std;class node{public: int c; int idx; node(int ac=0,int ai=0): c(ac)

2013-08-20 14:13:07 650

原创 Codeforces 3A Shortest path of the king BFS

A. Shortest path of the kingtime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard outputThe king is left alone on the ch

2013-08-19 17:34:50 1198

原创 Codeforces 2B The least round way 动态规划

选择计算2^k*5^m中k小的和m小的如果有0,则答案是1和0中小的那个#include #include #include #include using namespace std;int map[1100][1100],b[1100][1100],d[1100][1100];int n,p,q;int best=1111111111;string re

2013-08-19 14:19:20 464

原创 Codeforces 2A Winner

模拟水题但是英语太烂  没读懂题目,导致wa了好多次啊Orz#include #include #include #include #include #include using namespace std;#define MAX(a,b) a>b?a:bvector > vect;vector vecn;int found(string name)

2013-08-19 01:24:07 467

原创 Codeforces 1C Ancient Berland Circus 计算几何

#include #include #include using namespace std;#define PI acos(-1.0)#define feq(a,b) (fabs(a-b)<1E-4)double gcd(double a,double b){ if(feq(a,0)) return b; if(feq(b,0)) return a; return gcd(

2013-08-19 00:07:31 727

原创 Codeforces 1B Spreadsheet

进制转换#include #include #include using namespace std;int p(int n){ if(n==0) return 1; if(n==1) return 26; int t=p(n/2); if(n%2==0) return t*t; else return t*t*26;}int main(){ int n

2013-08-18 20:55:17 580

原创 Codeforces 1A Theater Square

题目大意: 某地有一片空地大小为m×n,现在要铺设瓷砖,每块瓷砖是a×a的大小,可以让瓷砖多出去,但是不可以切割瓷砖,问要多少块瓷砖。解法:ans = 上取整(m/a) * 上取整(n/b)代码:#include int main(){ long long ans,n,m,a,i,j; scanf("%I64d%I64d%I64d",&n,&m,&a);

2013-08-18 19:49:18 616

原创 [C++学习笔记]const关键字

使用const关键字,就是声明了一个const变量,const变量的值不可以修改。 在这里主要说说作用域。 const变量的作用域为该文件,而不可以被其他文件使用,也就是说在file1.cpp里定义的const变量,是不可以在file2.cpp里使用的。如果要在file2中使用,则需要在const变量定以前加上extern关键字。 因为const变量的作用域是该文件,其他文

2013-01-09 12:29:52 233

原创 [C++学习笔记]const引用

一、左值与右值左值:能出现在赋值运算符左边或者右边的表达式右值:只能出现在赋值运算符右边的表达式 二、const引用示例一: #include using namespace std;int main(){ const int val=3; int &ri=val; cout << ri << endl; return 0;}以上这段代码是错误的。

2013-01-09 00:47:18 293

原创 浅谈单链表快速排序

这几天笔者在参加学院的企业实训,其中有一个模块需要用到单链表的快速排序,因为之前的快速排序是针对于数组而言的,而对于链表则不支持下标的访问,因此单链表的排序就需要点技巧。        对于数组的快速排序,它的基本思路就是说选择一个数据为基准,将小于基准的元素放在这个元素的左边,大于基准的放在这个元素的右边,然后通过递归来对左右两个子数组分别进行快速排序。        笔者从以下两篇文章

2012-12-30 23:27:00 660

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除