2012年3月21日

美文一篇。。。

摘要: http://roba.rushcj.com/?p=548 阅读全文

posted @ 2012-03-21 22:51 getgoing 阅读(118) 评论(0) 推荐(0) 编辑

TLE:csu 1016 最小公倍数

摘要: 求删改方案总共多少种,预料之中的超时,因为所有提交的22次中有12次超时。 1 # include <stdio.h> 2 3 # define MAXN 205 4 5 int gcd(int a, int b); 6 7 int m[MAXN]; 8 int f[MAXN][MAXN]; 9 10 int main()11 {12 int i, j, T, n, lcm, tmp, cnt;13 14 scanf("%d", &T);15 while (T--)16 {17 cnt = 0;18 ... 阅读全文

posted @ 2012-03-21 01:25 getgoing 阅读(499) 评论(2) 推荐(1) 编辑

HDOJ 1108 最小公倍数

摘要: 题目来源:POJ。。。# include <stdio.h>int gcd(int x, int y);int main(){ int x, y; while (~scanf("%d%d", &x, &y)) printf("%d\n", x/gcd(x,y)*y); return 0;}int gcd(int x, int y){ while (x != y) if (x > y) x = x - y; else y = y - x;}下面这个是不对的,原因是Runtim... 阅读全文

posted @ 2012-03-21 01:22 getgoing 阅读(273) 评论(0) 推荐(0) 编辑

导航