摘要: 交了4次才过,以为很简单,结果大意了。。注意两个问题:一个是考虑可能的溢出情况,这个以前就遇到过,所以这里没有忘记 1 int lcm(int a, int b) 2 { 3 return a/gcd(a,b)*b; 4 } 5 6 7 //避免写成这样 8 int lcm(int a, int b) 9 {10 return a*b/gcd(a,b); //可能会溢出11 }第二个是考虑特殊数据1 //如果数据是这个样子的2 23 1 34 1 45 6 这样只有一个数据7 那么直接输入a[0],即为最大公约数了考虑以上就能轻松AC 1 #include 2 3 usi... 阅读全文
posted @ 2013-10-09 14:25 Geekers 阅读(312) 评论(0) 推荐(0) 编辑
摘要: Twilightgod CUST http://blog.csdn.net/twilightgodAekdycoin FZU http://hi.baidu.com/aekdycoinForeverlin HNU http://hi.baidu.com/forverlin1204/blogMatrix67 PKU http://www.matrix67.com/blog/watashi ZJU http://watashi.ws/blog/tag/zoj/Sha崽 HDU http://www.notonlysuccess.comChenyajun... 阅读全文
posted @ 2013-10-09 13:15 Geekers 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 1.Oline JudgeCII题库https://icpcarchive.ecs.baylor.edu/杭电 http://acm.hdu.edu.cn/杭电题目分类:http://acm.hdu.edu.cn/typeclass.phpNOYJ http://acm.nyist.net/JudgeOnline/problemset.phpPOJ http://poj.org/九度 http://ac.jobdu.com/ZOJ http://acm.zju.edu.cn/ZOJ News http://acm.zju.edu.cn/onlinejudge/ZOJ题目分类 http://.. 阅读全文
posted @ 2013-10-09 13:13 Geekers 阅读(369) 评论(0) 推荐(0) 编辑