#includeint main(){ int m,n,ans,tmp,times=0; scanf("%d%d",&m,&n); for(int i=0 ; i<n ; ++i) //【思维】题目找出现次数最多的一个,找到不同的,次数减少1,减少到0就换成输入的数字。找到相同的数字,次...
分类:
其他好文 时间:
2015-03-10 23:03:35
阅读次数:
171
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
You may assume that the intervals were initially sorted according to their start times.
Examp...
分类:
其他好文 时间:
2015-03-10 21:27:41
阅读次数:
134
Problem DescriptionSean owns a company and he is the BOSS.The other Staff has one Superior.every staff has a loyalty and ability.Some times Sean will ...
分类:
其他好文 时间:
2015-03-10 08:57:13
阅读次数:
217
Given an array of size n, find the majority element. The majority element is the element that appears more than ?
n/2 ? times.
You may assume that the array is non-empty and the majority element ...
分类:
其他好文 时间:
2015-03-09 22:34:31
阅读次数:
198
直接看代码:long startTime = System.currentTimeMillis();//这个属性是System类的,获取的时间单位是毫秒 //其他代码long endTime =System.currentTimeMillis();long times = endTime - sta...
分类:
编程语言 时间:
2015-03-09 15:41:56
阅读次数:
149
#include#includeusing namespace std;const int MAX=100010;int DEPest=0,times=0;vector child[MAX]; //child[父亲][孩子] 二维数组表示树形结构void DFS(int root,i...
分类:
其他好文 时间:
2015-03-08 14:08:55
阅读次数:
178
这里列出了一些难做的题或是易错的题,简单的我就没有过多的解释,但是如果大家有任何问题都可以私信我或是评论一下,我会尽量即时的解答问题或是疑问的。
int x=0;
for(int i=4*n; i>=1; i--)
x=x+2*i;
O(n)
The loop runs O(n) times and does O(1) work per iter...
分类:
其他好文 时间:
2015-03-07 15:45:01
阅读次数:
182
Understanding 翻译为了解或理解,对于 .NET 来说,2015 年注定会更加精彩,所以标题就用了“精彩”这个词,翻译这篇文章有两个原因:学英语、以及跟随作者回顾一下去年的 .NET。在去年BUILD大会之后,我写了一篇文章Exciting Times for .NET,并且从那以后,我...
分类:
Web程序 时间:
2015-03-06 19:02:49
阅读次数:
211
Majority Element问题:Given an array of sizen, find the majority element. The majority element is the element that appears more than? n/2 ?times.You may ...
分类:
其他好文 时间:
2015-03-06 16:51:26
阅读次数:
122
在使用sql访问Access日期字段,应在变量前后加#,例子:s:=Format(select xueshID,name,times,qukbz,skdate,banji from dianmjili where skdate =%s,[#+formatdatetime(yyyy/m/d,DateT...
分类:
数据库 时间:
2015-03-06 09:36:29
阅读次数:
177