上一页 1 ··· 5 6 7 8 9

2013年5月6日

SGU 115. Calendar

摘要: 2001年某月某号星期几到那天天数%7+1 然后修正到正确日期再 %7SGU 115. Calendar /************************************************************************* > File Name: sgu115.cpp > Author: Shine > Created Time: 2013-05-06 下午 6:24:01 > QuestionType: 模拟 > Way: > Submit: 1WA(很不应该,没自己检验,就交,公式错误) 1AC ... 阅读全文

posted @ 2013-05-06 18:44 ShineCheng 阅读(124) 评论(0) 推荐(0) 编辑

SGU 123 The sum

摘要: 求Fibonacci前K项和(0<K<41)面向大海春暖花开SGU 123 The sum /************************************************************************* > File Name: sgu123.cpp > Author: Shine > Created Time: 2013-05-06 下午 6:05:51 > QuestionType: Water > Way: > Submit: > Gain: > Experience: ***... 阅读全文

posted @ 2013-05-06 18:12 ShineCheng 阅读(101) 评论(0) 推荐(0) 编辑

SGU 105 Div 3

摘要: 找规律112123123412345123456123456712345678123456789YYYYYY如上表规律。每三个,第一个不是,后两个是。所以 答案=N 包含的完整周期(不包含N) * 2 + N所在周期的位置-1就是(n-1)/3*2+(n%3==0?3:n%3)-1 更简洁的表示方式: n/3*2+(n%3)/2完整代码如下SGU 105 Div 3/************************************************************************* > File Name: sgu105.cpp > Author... 阅读全文

posted @ 2013-05-06 12:20 ShineCheng 阅读(147) 评论(0) 推荐(0) 编辑

2013年5月5日

SGU 102 Coprimes

摘要: 裸的欧拉函数……暴力搜索也可以过……(代码写的很水很水很水,不要看!)欧拉函数版 /************************************************************************* > File Name: sgu102.cpp > Author: Shine > Created Time: 2013-05-04 上午 6:36:05 > QuestionType: 欧拉函数 > Way: > Submit: > Gain: > Experience: *********... 阅读全文

posted @ 2013-05-05 21:54 ShineCheng 阅读(183) 评论(0) 推荐(0) 编辑

2013年5月4日

SGU 100 A+B

摘要: SGU的A+B,同时也是博客园的A+B。View Code #include <cstdio>int main() { int a, b; while (scanf("%d%d", &a, &b) != EOF) { printf("%d\n", a + b); } return 0;}#include <cstdio>int main() { int a, b; while (scanf("%d%d", &a, &b) != EOF) { printf("%d\n&q 阅读全文

posted @ 2013-05-04 13:36 ShineCheng 阅读(104) 评论(0) 推荐(0) 编辑

上一页 1 ··· 5 6 7 8 9

导航