题意:容易理解。分析:当n%(p+q)==0时,先取者必胜,必胜方案:先取q,然后对方去x个,先取者就取(p+q-x)个,最后对方就必须取玩p个,当n%(p+q)==r(rp&&r#include#includeint
main(){ int n, p, q; while(scanf("...
分类:
其他好文 时间:
2014-05-20 01:31:58
阅读次数:
233
第七章 循环语句1. 循环语句的老祖宗--Goto语句(可用do…while();代替) 1
//①goto语句的使用(一般情况不用,但想在多重循环中一下子跳到外面时可以用)*******************① 2 int i=0; 3
number: i++; 4...
分类:
其他好文 时间:
2014-05-19 22:45:52
阅读次数:
361
遇到的问题:当点击上面的logs时,会出现下面问题:这个解决方案为:By default,
Hadoop stores the logs of each container in the node where that container was
hosted. While this is irre...
分类:
其他好文 时间:
2014-05-19 10:33:13
阅读次数:
369
void quickSort(int *a1 , int *a2){ int i=0 ,
j=a2-a1-1; if (i>=j) return; swap(a1[0] , a1[rand()%j+1]); while( ia1[0])
--j; if(i<j)...
分类:
其他好文 时间:
2014-05-19 07:43:47
阅读次数:
213
hash做法:#include#includeconst int Max =
100010;int home[Max],away[Max],hash[Max];int main(){ int n,sum,total; int i,j;
while(scanf("%d",&n)!=E...
分类:
其他好文 时间:
2014-05-17 21:44:37
阅读次数:
504
intdelayTime=3;QElapsedTimer
timer;timer.start();while(timer.elapsed()<(delayTime*1000)){app.processEvents();}
分类:
其他好文 时间:
2014-05-17 17:45:54
阅读次数:
209
#include using namespace std;int func(int x){ int
cnt = 0; while (x) { cnt++; x = x&(x - 1); } return cnt;}int main(){ ...
分类:
其他好文 时间:
2014-05-17 14:54:19
阅读次数:
194
(1)最终还是没能参加比赛,一次都没有机会。(2)有梦想,不到最后一刻不会放弃。(3)这里应该会搬次家,转到github上。(4)作为一个新手,什么东西都需要从头学起来,就从最基础的数据结构开始好了。待完成的任务:1-2-3-4-
分类:
其他好文 时间:
2014-05-17 14:38:01
阅读次数:
244
style="word-break:break-all;word-wrap:break-word;"
分类:
其他好文 时间:
2014-05-16 03:04:36
阅读次数:
277
'''
程序31】
题目:请输入星期几的第一个字母来判断一下是星期几,如果第一个字母一样,则继续
判断第二个字母。
1.程序分析:用情况语句比较好,如果第一个字母一样,则判断用情况语句或if语句判断第二个字母。
2.程序源代码:
'''
from sys import stdin
letter = stdin.read(1)
stdin.flush()
while letter != 'Y...
分类:
编程语言 时间:
2014-05-16 01:47:37
阅读次数:
272