10 2012 档案
摘要:搞定了第二章。。。。先上课件:MathematicsAssignment 2: Mathematics·1799 Yeehaa! (1)简单平面几何证明,答案是r*sin(π/n)/(1+sin(π/n)),我就不需要证明了吧(不会的自己画图就可以证明,不过估计这个连初中生都会)。。。View Code #include <stdio.h>#include <math.h>#define PI 3.1415926int main(){ int test,n,i; double r; scanf("%d",&test); for (i
阅读全文
摘要:最近想要完成Stanford's ACM Training Course,我会将课件和练习题发上来。Coding ExerciseAssignment 1: Coding Exercise·1000 A+B Problem (0)这道题目没有什么好说的。。。View Code #include <stdio.h>int main(){ int a,b; scanf("%d %d",&a, &b); printf("%d\n",a+b); return 0;}·1004 Financial Manag
阅读全文
摘要:这几天把SLPC2011的题目做一下这里是题目连接:SLPC2011A.Another Rock-Paper-Scissors Problem题目大意;给出Sonny在每一局出石头剪刀布的规则(具体规则将不太清楚,自己看题目吧),问你在第N局出什么才能赢过Sonny?题目分析:根据题意,我们可以发现连续的几局可分成若干块(每一块的局数显然与3的幂次有关,是个人都看得出,我就不再解释原因),每一块出什么都是由上一块决定的。这就提醒我们可以使用递归来解决这一题。设f(N)表示第N局Sunny出的东西(我们用0表示R,1表示P,2表示S),则f(N)=(f(N-delta)+1)mod 3,其中de
阅读全文

浙公网安备 33010602011771号