Given a 2d grid map of'1's (land) and'0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent ...
分类:
其他好文 时间:
2015-08-03 22:19:33
阅读次数:
113
Given a range [m, n] where 0 m 1101 11111111 –>n 可以去掉的就是n的分割部分的1。 所以结果其实就是m和n公共头部*/ int res=0; if(m==0)return 0; ...
分类:
其他好文 时间:
2015-08-03 22:19:51
阅读次数:
197
[self.contentView addSubview:self.scrollView]; self.scrollView.userInteractionEnabled = NO; [self.contentView addGestureRecognizer:self.scro...
分类:
其他好文 时间:
2015-08-03 22:17:50
阅读次数:
112
一开始,没敢写,感觉会超时。。。其实就是暴力搜索。DFS 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #define clc(a,b) memset(a,b,sizeof(a)) 8 #def...
分类:
其他好文 时间:
2015-08-03 22:17:07
阅读次数:
194
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For example, the 32-bit in...
分类:
其他好文 时间:
2015-08-03 22:16:35
阅读次数:
144
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5297题意:给你一个所有正整数的序列,然后去掉满足x^(2~r)的所有数(x为所有正整数,r>=2题目给出),问你现在这个序列的第n个数是什么解:首先想到写一个函数func(y),它可以计算出给定数字y是...
分类:
其他好文 时间:
2015-08-03 22:16:46
阅读次数:
99
140种事件类型:QEvent::None QEvent::AccessibilityDescription QEvent::AccessibilityHelp QEvent::AccessibilityPrepare QEvent::ActionAdded QEvent::ActionChange...
分类:
其他好文 时间:
2015-08-03 22:16:25
阅读次数:
880
Dragon BallsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4384Accepted Submission(s): 1673Proble...
分类:
其他好文 时间:
2015-08-03 22:16:53
阅读次数:
106
题意:两个人玩游戏,给定一个日期,他们轮流选择日期,可以选择当前日期的下一天,如果下一个月也有这一天的话则也可以选择下一个月的这一天。超过某一日期的人输。思路:以天为状态,则一共有300多万个左右的状态,然后用dp预处理每个状态是必胜态还是必败态。一个状态是必胜态当且仅存在它的一个后继是必败态,一个...
分类:
其他好文 时间:
2015-08-03 22:16:11
阅读次数:
157
Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered from top to bottom.For exampl...
分类:
其他好文 时间:
2015-08-03 22:18:49
阅读次数:
105
【codevs1191】数轴染色2014年2月15日4317题目描述Description在一条数轴上有N个点,分别是1~N。一开始所有的点都被染成黑色。接着我们进行M次操作,第i次操作将[Li,Ri]这些点染成白色。请输出每个操作执行后剩余黑色点的个数。输入描述Input Description输...
分类:
其他好文 时间:
2015-08-03 22:16:43
阅读次数:
114
题目地址:http://poj.org/problem?id=1065Sample Input3 5 4 9 5 2 2 1 3 5 1 4 3 2 2 1 1 2 2 3 1 3 2 2 3 1 Sample Output213题目抽象:给你一个序列,序列的每个元素包含两个值(x,y).现在希望找...
分类:
其他好文 时间:
2015-08-03 22:17:39
阅读次数:
129
由于实验上经常用到一些希腊字母的表示方式,而且老是忘记,所以今天就整理如下了,以便经常使用matlab的同行能用到。、、
分类:
其他好文 时间:
2015-08-03 22:16:28
阅读次数:
174
隐藏前:解决办法:1.按住Ctrl+Shifp+p,出现一个框,在框里输入“view:”,出现了如下界面2.选择:“View:Toggle Menu”即可。结果为:大功告成!!!!
分类:
其他好文 时间:
2015-08-03 22:17:39
阅读次数:
155
1009. Product of Polynomials (25)This time, you are supposed to find A*B where A and B are two polynomials.Input Specification:Each input file contain...
分类:
其他好文 时间:
2015-08-03 22:15:28
阅读次数:
160
queuequeue先进先出可用函数empty(); //判断队列是否为空size(); //返回队列大小top(); //返回队首元素back(); //返回队尾元素push(); //入队pop(); //出队priority_queue优先化队列默认为从大到小,对首元素最大,队尾元...
分类:
其他好文 时间:
2015-08-03 22:14:18
阅读次数:
124
题解 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int maxn = 1000 + 10; 7 const int maxm = 30; 8 9 int n, k;10 11 char s[maxn]...
分类:
其他好文 时间:
2015-08-03 22:14:18
阅读次数:
104