摘要:
//水题#include using namespace std;int main(){ int c, v0, v1, a, l; while (cin >> c >> v0 >> v1 >> a >> l) { int day = 0; if (v0 >= c)... 阅读全文
posted @ 2017-08-31 15:36
mofushaohua
阅读(152)
评论(0)
推荐(0)
摘要:
//生成元 uva1583//收获:有时候枚举耗时过多,且对某个数字n,要从0枚举到(n - 1),在这种情况下,最好是建表查表,以提高效率 #include #include using namespace std;const int maxn = 100005;i... 阅读全文
posted @ 2017-08-31 15:36
mofushaohua
阅读(133)
评论(0)
推荐(0)
摘要:
//水题#include #include using namespace std;int a[25];int main(){ int t, n; cin >> t; while (t--) { cin >> n; int mark1 = 0, mark2 = 0... 阅读全文
posted @ 2017-08-31 15:35
mofushaohua
阅读(154)
评论(0)
推荐(0)
摘要:
/* 这题其实并不难,可以说,算是比较简单的概率题了...涉及到一点等比级数求和,但这也是高数里面学过公式的,总之,没做出来有些不应该 注意下:浮点数是有误差的,所以p为0时,要单独特判,并且特判时也要注意小数点位数,思考方面不太难,但如果不注重细节,很容易W... 阅读全文
posted @ 2017-08-31 15:34
mofushaohua
阅读(173)
评论(0)
推荐(0)
摘要:
//这题也是水题#include using namespace std;const int N = 505;int planned[N];int total[N];int main(){ int n, k; while (cin >> n >> k) { int ... 阅读全文
posted @ 2017-08-31 15:33
mofushaohua
阅读(145)
评论(0)
推荐(0)
摘要:
//周期串 uva455//借鉴了代码思路: http://blog.csdn.net/mobius_strip/article/details/40584263/*收获:**1.暴力破解,但要注意,不是死列举,而是发现,循环节首先必定是长度的因子,再去暴力破解,不要... 阅读全文
posted @ 2017-08-31 15:32
mofushaohua
阅读(116)
评论(0)
推荐(0)
摘要:
//水题,排序后就能直接按照要求判断了,没什么坑点#include #include #include using namespace std;const int N = 105;int a[N];int main(){ int T, n; scanf("%d", ... 阅读全文
posted @ 2017-08-31 15:31
mofushaohua
阅读(201)
评论(0)
推荐(0)
摘要:
/* 注意!!!题目的理解很重要,我当初就是因为题意理解有误,一直WA We shouldn't count as missed meals on the arrival day before Vasiliy's arrival and meals on th... 阅读全文
posted @ 2017-08-31 15:30
mofushaohua
阅读(171)
评论(0)
推荐(0)
摘要:
/* 算是水题,难度不大 有个值得注意的小细节是,CASE的每个字母都是大写的,而不仅仅是第一个,为此WA一次 值得学习的函数: sort对vector排序时:sort(v.begin(), v.end()) lower_bound: 查找“大于或等... 阅读全文
posted @ 2017-08-31 15:29
mofushaohua
阅读(175)
评论(0)
推荐(0)
摘要:
//环状序列 uva1584//收获://如何判断环状序列的字典序:取余的巧妙应用,但是注意仅比较长度次数,否则循环可能无法退出,故要 n = strlen(s) i从0到(n-1), 比较n次即可 #include #include using namespace ... 阅读全文
posted @ 2017-08-31 15:29
mofushaohua
阅读(105)
评论(0)
推荐(0)