上一页 1 ··· 8 9 10 11 12 13 14 下一页
摘要: 描述 N!阶乘是一个非常大的数,大家都知道计算公式是N!=N*(N-1)······*2*1.现在你的任务是计算出N!的位数有多少(十进制)?输入首行输入n,a56爆大奖在线娱乐有多少组测试数据(n 2 #include 3 int main() 4 { 5 int n, i, x; 6 double sum; 7 scanf("%d", &n); 8 while(n--){ 9 10 sum = 1;11 scanf("%d", &x);12 for(i = 1; i <= x; i++ 阅读全文
posted @ 2013-08-22 22:24 心中的阿哲 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 超时#include #include #define M 1000001int shu[M];int main(){int n, x, i, j, p, e, m;scanf("%d", &n);while(n--){ memset(shu, 0, sizeof(shu));shu[1] = 1;scanf("%d", &x);#if 0for(i = 1, p = 1; i = 10){shu[j+1] = shu[j] / 10;shu[j] %= 10;p++;}}}#endifp = 1;for(i = 1; i <= x 阅读全文
posted @ 2013-08-22 18:06 心中的阿哲 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #define M 100001 4 5 struct time 6 { 7 int a; 8 int b; 9 }flower[M];10 11 int visit[M];12 13 int cmp(const void *x, const void *y)14 {15 struct time *m = (struct time *)x;16 struct time *n = (struct time *)y;17 return m->a - n->a;18 }19 20 int main()21... 阅读全文
posted @ 2013-08-21 19:29 心中的阿哲 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #define M 301 3 int r[M], c[M]; 4 5 int main() 6 { 7 int k, m, n, i, j, sum, flag, t; 8 scanf("%d", &k); 9 while(k--){10 11 sum = 0;12 scanf("%d %d", &m, &n);13 for(i = 1; i c[i])51 {52 for(j = 1; j c[i])60 ... 阅读全文
posted @ 2013-08-21 19:27 心中的阿哲 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 描述学校的小礼堂每天都会有许多活动,有时间这些活动的计划时间会发生冲突,需要选择出一些活动进行举办。小刘的工作就是安排学校小礼堂的活动,a56爆大奖在线娱乐时间最多安排一个活动。现在小刘有一些活动计划的时间表,他想尽可能的安排更多的活动,请问他该如何安排。输入第一行是一个整型数m(m 2 #include 3 #define M 10001 4 5 struct time 6 { 7 int a; 8 int b; 9 }actv[M];10 11 int cmp(const void *a, const void *b)12 {13 struct time *m = (struc... 阅读全文
posted @ 2013-08-20 21:09 心中的阿哲 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 描述给你一个非负数整数n,判断n是不是一些数(这些数不允许重复使用,且为正数)的阶乘之和,如9=1!+2!+3!,如果是,则输出Yes,否则输出No;输入第一行有一个整数0 2 int shu[9] = {1, 2, 6, 24, 120, 720, 5040, 40320, 362880}; 3 int main() 4 { 5 int m, n, i; 6 scanf("%d", &m); 7 while(m--){ 8 9 scanf("%d", &n);10 i = 8;11 while(... 阅读全文
posted @ 2013-08-20 11:36 心中的阿哲 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 描述a56爆大奖在线娱乐们都知道如何计算一个数的阶乘,可是,如果这个数很大呢,a56爆大奖在线娱乐们该如何去计算它并输出它?输入输入一个整数m(0 3 #include 4 #define M 20000 5 int shu[M]; 6 7 int main() 8 { 9 int m, i, n, b, t, e;10 while(scanf("%d", &m) != EOF){11 12 memset(shu, 0, sizeof(shu));13 shu[0] = 1;14 n = 0;/*na56爆大奖在线娱乐存放进位*/15 for(i = 1; i ... 阅读全文
posted @ 2013-08-19 22:34 心中的阿哲 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 描述现在,有一行括号序列,请你检查这行括号是否配对。输入第一行输入一个数N(0#include #define M 10001char s[M], s1[M];//s是目标数组,s1是栈int main(){ int n, len, top, i; scanf("%d", &n); while(n--){ top = 3;//栈顶 scanf("%s", s+1); len = strlen(s+1); for(i = 1; i <= len; i++){ ... 阅读全文
posted @ 2013-08-18 10:05 心中的阿哲 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Yet another end of the worldTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 0Accepted Submission(s): 0Problem DescriptionIn the year 3013, it has been 1000 years since the previous predicted rapture. However, the Maya will not play a joke any more 阅读全文
posted @ 2013-08-17 16:59 心中的阿哲 阅读(188) 评论(0) 推荐(0) 编辑
摘要: #include #include #define M 101int s[M][M];int main(){ int n, i, j, t; while(scanf("%d", &n) != EOF){ memset(s, 0, sizeof(s)); t = 1; s[i=1][j=n] = t++; while(t = 1 && !s[i][j-1]){ s[i][--j] = t++; } while(i-1... 阅读全文
posted @ 2013-08-17 10:52 心中的阿哲 阅读(153) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 下一页