随笔分类 -  Codeforces

摘要:1073D. Berland Fair每次先走一圈,计算出可以购买的糖果的总价格 c 和总个数 t,然后 cnt += t*(T/c) T %= c,循环至无糖果可买。时间复杂度计算如下:#includeusing namespace std;const int m... 阅读全文
posted @ 2018-10-31 23:54 ACLJW 阅读(161) 评论(0) 推荐(0)
摘要:1073C. Vasya and Robot注意如果 d 和 n 奇偶性不一致则是不可能到达的,因为机器人每移动一步,其坐标之和的奇偶性就会发生变化。#includeusing namespace std;typedef pairP;const int maxn = ... 阅读全文
posted @ 2018-10-31 22:40 ACLJW 阅读(161) 评论(0) 推荐(0)
摘要:1073B. Vasya and Books#includeusing namespace std;const int maxn = 2*100000 + 5;int n,s[maxn],t[maxn],vis[maxn],res[maxn];int main(){ ... 阅读全文
posted @ 2018-10-29 22:34 ACLJW 阅读(124) 评论(0) 推荐(0)
摘要:1073A. Diverse Substring只要不是一串完全相同的字母就是 YES,因为至少有一个长度为2的子串是 diverse 的。傻傻地测试了所有的子串。。 阅读全文
posted @ 2018-10-29 22:31 ACLJW 阅读(134) 评论(0) 推荐(0)