09 2014 档案
摘要:http://acm.fafu.edu.cn/problem.php?id=1266思路很容易理解:#include#includeusing namespace std;int num[1000000];int main(){ int n,m,a; while(~scanf("%d",...
阅读全文
摘要:求两个数a和b的最大公约数,可以想到的是从[1,min(a,b)]枚举每个正整数:#includeusing namespace std;int gcd(int a,int b){ int ans=1; for(int i=2;i>a>>b; cout=b)证明:设gcd(a,b)...
阅读全文
摘要:http://blog.csdn.net/shahdza/article/details/6317011 该帖的改进版本无返回值,非负整数输入template inline void input(T &ret){ char c; ret=0; while(c=getchar(),c'9'...
阅读全文
摘要:http://acm.fafu.edu.cn/problem.php?id=1292这题的原型就是《由感性认识到理性认识——透析一类搏弈游戏的解答过程》这篇论文介绍的取石游戏C游戏C:甲乙两人面对若干排石子,其中每一排石子的数目可以任意确定。例如图2所示的初始局面:共n=3排,其中第一排的石子数a1...
阅读全文

浙公网安备 33010602011771号