2012年2月26日

TLE csu 1236: 删数游戏

摘要: 直接做,TLE:View Code /* csu 1236 */# include <stdio.h># include <string.h># define MAXN 2001void del(char *s, int len){ int i; i = 1; while (i < len && s[i-1]<=s[i]) ++i; while (i < len) { s[i-1] = s[i]; ++i; } s[i-1] = '\0';}int main(){ int len, i, S; c... 阅读全文

posted @ 2012-02-26 16:43 getgoing 阅读(274) 评论(0) 推荐(0) 编辑

csu 1207: 镇管的难题

摘要: 判断一个正整数是不是勾股数(直角边),初等数论。意外:奇数可以构造(2n+1, 2n^2+2n, 2n^2+2n+1),2^n(n>=2)也是(因为4是)。。/* csu 1207 */# include <stdio.h>int main(){ int x; while (~scanf("%d", &x)) if (x<3) printf("NO\n"); else printf("YES\n"); return 0;} 阅读全文

posted @ 2012-02-26 00:51 getgoing 阅读(190) 评论(0) 推荐(0) 编辑

导航