Description
There are n lights in a circle numbered from 1 to n. The left of light 1 is light n, and the left of light k (1< k<= n) is the light k-1.At time of 0, some of them turn on, and others t...
分类:
其他好文 时间:
2014-07-30 12:23:23
阅读次数:
199
Turn the pokers
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1279 Accepted Submission(s): 466
Problem Description
During summer v...
分类:
其他好文 时间:
2014-07-29 21:53:22
阅读次数:
400
{turn monitor off}SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 2); //关闭显示器{turn monitor on}SendMessage(Application.Handle, WM_SYSCO...
分类:
其他好文 时间:
2014-07-29 20:51:22
阅读次数:
274
Turn the pokers
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1265 Accepted Submission(s): 465
Problem Description
During summ...
分类:
其他好文 时间:
2014-07-29 14:17:18
阅读次数:
182
Similar with "Longest Consecutive Sequence". Another usage to hashset.Take care of corner cases!class Solution {public: int firstMissingPositive(in...
分类:
其他好文 时间:
2014-07-28 15:16:43
阅读次数:
206
看完题解还wa了老半天才ac = =!囧rz 给大牛门跪了因为本题求的是最后状态的种数,设最终翻到正面为1,反面为0:因为每次翻牌的选择自由,所以一定范围内,翻到正面的牌数相差2的状态都可以取到;(假设当前状态为i 个1,可以用一次翻到1的机会把另一个翻到1的牌翻到0;这样状态就是i-2,相差2了;...
分类:
其他好文 时间:
2014-07-27 22:39:19
阅读次数:
309
Turn the pokersTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1213Accepted Submission(s): 449Prob...
分类:
其他好文 时间:
2014-07-27 21:38:35
阅读次数:
212
题目:Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"Corner Cases:D....
分类:
编程语言 时间:
2014-07-26 14:15:15
阅读次数:
264
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any po...
分类:
其他好文 时间:
2014-07-25 10:54:31
阅读次数:
229
题目链接题意 : m张牌,可以翻n次,每次翻xi张牌,问最后能得到多少种形态。思路 :0定义为反面,1定义为正面,(一开始都是反), 对于每次翻牌操作,我们定义两个边界lb,rb,代表每次中1最少时最少的个数,rb代表1最多时的个数。一张牌翻两次和两张牌翻一次 得到的奇偶性相同,所以结果中lb和最多...
分类:
其他好文 时间:
2014-07-25 02:15:54
阅读次数:
229