数学计算(规律)
文章平均质量分 73
lc311309010103
这个作者很懒,什么都没留下…
展开
-
好的 2188 悼念512汶川大地震遇难同胞——选拔志愿者
#include int main() { int n,m,y; while(scanf("%d",&y)!=EOF) { while(y--) { scanf("%d%d",&n,&m); if(n%(m+1)==0) printf("Rabbit\n"); else原创 2014-08-04 11:34:25 · 366 阅读 · 0 评论 -
hd 2045 不容易系列之(3)—— LELE的RPG难题
不容易系列之(3)—— LELE的RPG难题 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 29436 Accepted Submission(s): 11810 Problem Description 人称“原创 2014-07-29 18:12:30 · 281 阅读 · 0 评论 -
hd 2047 阿牛的EOF牛肉串
阿牛的EOF牛肉串 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 20424 Accepted Submission(s): 9583 Problem Description 今年的ACM暑期集训队一共有18人原创 2014-07-29 20:10:22 · 268 阅读 · 0 评论 -
hd 2067 小兔的棋盘,二维数组的递归
#include #include int main() { int n,i,t,j; __int64 a[40][40]; memset(a,0,sizeof(a)); a[1][1]=1; for(i=2;i<=36;i++) for(j=1;j<=i;j++) a[i][j]=a[i-1][j]+a[i][j-1]; t=0; wh原创 2014-08-11 15:21:44 · 404 阅读 · 0 评论 -
hd 2077 汉诺塔IV
#include #include int main() { int n,t; __int64 s; while(scanf("%d",&t)!=EOF) { while(t--) { scanf("%d",&n); s=pow(3,n-1); printf("%I64d\n",s+原创 2014-08-11 16:08:26 · 293 阅读 · 0 评论 -
hd 2501 Tiling_easy version
Tiling_easy version Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5042 Accepted Submission(s): 3979 Problem Description 有一个大小是 2原创 2014-08-04 15:53:37 · 362 阅读 · 0 评论 -
hd 1465 不容易系列之一
#include int main() { int n,i; __int64 a[21]; while(scanf("%d",&n)!=EOF) { a[0]=1; a[1]=2; for(i=2;i<20;i++) a[i]=(i+1)*(a[i-1]+a[i-2]);原创 2014-08-11 11:31:26 · 308 阅读 · 0 评论 -
ny 352 数乌龟
#include int main() { int n,i,a[60]; a[0]=1; a[1]=2; a[2]=3; for(i=3;i<56;i++) a[i]=a[i-1]+a[i-3]; while(scanf("%d",&n)!=EOF&&(n!=0)) printf("%d\n",a[n-1]); return 0;原创 2014-08-11 13:11:57 · 386 阅读 · 0 评论 -
hd 2036 改革春风吹满地
改革春风吹满地 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 18631 Accepted Submission(s): 9544 Problem Description “ 改革春风吹满地, 不会AC没关系原创 2014-08-11 11:00:21 · 429 阅读 · 0 评论 -
hd 2212 DFS
DFS Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5046 Accepted Submission(s): 3112 Problem Description A DFS(digital factorial su原创 2014-08-11 20:41:09 · 426 阅读 · 0 评论 -
hd 2064 汉诺塔III
#include __int64 fun(int n) { int i; if(n==1) return 2; return fun(n-1)*3+2; } int main() { int n; while(scanf("%d",&n)!=EOF) printf("%I64d\n",fun(n)); ret原创 2014-08-11 15:54:54 · 333 阅读 · 0 评论 -
hd 2569 彼岸
#include int main() { int t,i,n; __int64 a[50]; while(scanf("%d",&t)!=EOF) { while(t--) { scanf("%d",&n); a[1]=3; a[2]=9; for(i=3;i<40原创 2014-08-12 10:55:59 · 285 阅读 · 0 评论 -
hd 2044 一只小蜜蜂
一只小蜜蜂... Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 38156 Accepted Submission(s): 14081 Problem Description 有一只经过训练的蜜蜂只能爬向右侧相邻的原创 2014-07-30 23:28:03 · 396 阅读 · 0 评论 -
hd 2092 整数解
#include int main() { int n,m,i,j,p; while(scanf("%d%d",&n,&m)!=EOF&&(m!=0||n!=0)) { j=0; if(m<0) { m=-m; j=1; } for(i=-m;i<=m;i++)原创 2014-08-14 11:35:16 · 426 阅读 · 0 评论 -
hd 2050 折线分割平面
#include int main() { int t,n; __int64 a; while(scanf("%d",&t)!=EOF) { while(t--) { scanf("%d",&n); a=2*n*n-n+1; printf("%I64d\n",a); }原创 2014-07-29 19:40:11 · 329 阅读 · 0 评论 -
hd 2520我是菜鸟,我怕谁
#include int main() { int t,n; while(scanf("%d",&t)!=EOF) { while(t--) { scanf("%d",&n); int c; c=n*n%10000; prin原创 2014-07-30 11:02:41 · 274 阅读 · 0 评论 -
hd 2524 矩形A + B
#include int main() { int n,m,t; while(scanf("%d%",&t)!=EOF) { while(t--) { scanf("%d%d",&n,&m); printf("%d\n",(n+1)*n/2*(m+1)*m/2);原创 2014-07-30 11:18:53 · 293 阅读 · 0 评论 -
hd 2190 悼念512汶川大地震遇难同胞——重建希望小学
#include int main() { int t,n,i,a[40]; while(scanf("%d",&t)!=EOF) { while(t--) { scanf("%d",&n); a[0]=0; a[1]=1; a[2]=3; a[3]=5;原创 2014-08-04 11:52:46 · 467 阅读 · 0 评论 -
HD 1847 Good Luck in CET-4 Everybody!
Good Luck in CET-4 Everybody! Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5128 Accepted Submission(s): 3282 Problem Description原创 2014-08-04 17:42:34 · 348 阅读 · 0 评论 -
hd 2055 An easy problem
An easy problem Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 13687 Accepted Submission(s): 9238 Problem Description we define f原创 2014-08-06 09:24:12 · 366 阅读 · 0 评论 -
hd 1995 汉诺塔V
汉诺塔V Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2431 Accepted Submission(s): 1435 Problem Description 用1,2,...,n表示n个盘子,称为1号盘,原创 2014-08-01 08:33:56 · 389 阅读 · 0 评论 -
hd 1061 Rightmost Digit 规律21 一循环 对20取余
#include int main() { int t,n; int a[21]={0,1,4,7,6,5,6,3,6,9,0,1,6,3,6,5,6,7,4,9,0}; while(scanf("%d",&t)!=EOF) { while(t--) { int p=1; scanf("%d",&n原创 2014-07-31 20:54:12 · 429 阅读 · 0 评论 -
ny 499 不再爱你……
#include #include int main() { int n; double t,h,h1; while(scanf("%d",&n)!=EOF) { while(n--) { scanf("%lf%lf%lf",&h,&t,&h1); printf("%.1f\n",t/log(h原创 2014-07-31 23:52:02 · 310 阅读 · 0 评论 -
hd 2018 母牛的故事
#include int main() { int n,i; int a[60]; while(scanf("%d",&n)!=EOF&&(n!=0)) { for(i=1;i { if(i a[i]=i; else a[i]=a[i-1]+a[i-3];原创 2014-08-01 11:37:30 · 573 阅读 · 0 评论 -
hd 1996 汉诺塔VI
#include #include int main() { int t,n; while(scanf("%d",&t)!=EOF) { while(t--) { scanf("%d",&n); printf("%.0f\n",pow(3,n));//注意%.0f原创 2014-08-01 08:52:37 · 314 阅读 · 0 评论 -
hd 2160 母猪的故事
#include int main() { int t,n,i; int a[30]={0}; while(scanf("%d",&t)!=EOF) { while(t--) { a[1]=1; a[2]=2; for(i=3;i<20;i++) a[i]=a[i-1]+原创 2014-08-08 19:46:38 · 302 阅读 · 0 评论 -
hd 2176 取(m堆)石子游戏
#include int a[200010]; int main() { int n,m,s,i; while(scanf("%d",&n)!=EOF&&(n!=0)) { for(i=0,s=0;i<n;i++) { scanf("%d",&a[i]); s=s^a[i]; } if(s==0)原创 2014-08-09 09:47:18 · 298 阅读 · 0 评论 -
hd 1021 Fibonacci Again 规律对4取余为2 则yes
#include int main() { int n; while(scanf("%d",&n)!=EOF) { if(n%4==2) printf("yes\n"); else printf("no\n"); } return 0; }原创 2014-07-31 20:25:20 · 480 阅读 · 0 评论 -
hd 2178 猜数字
#include int main() { int t,n,i,p; while(scanf("%d",&t)!=EOF) { while(t--) { p=1; scanf("%d",&n); for(i=0;i<n;i++) p*=2; pr原创 2014-08-09 08:40:20 · 345 阅读 · 0 评论 -
hd 2502 月之数
#include #include int main() { int t,n; int a[30]; while(scanf("%d",&t)!=EOF) { while(t--) { scanf("%d",&n); a[n]=pow(2,n-1)*(n+1)/2; printf("%d原创 2014-07-30 10:43:06 · 280 阅读 · 0 评论 -
hd 2046 ny 429 骨牌铺方格
骨牌铺方格 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 28474 Accepted Submission(s): 13807 Problem Description 在2×n的一个长方形方格中,用一个1×原创 2014-07-29 19:13:15 · 368 阅读 · 0 评论