07 2018 档案
摘要:codeforces 424D Biathlon Track 题意 题解 代码 c++ include using namespace std; define fi first define se second define mp make_pair define pb push_back defi
阅读全文
摘要:codeforces 1007B Pave the Parallelepiped 题意 题解 代码 c++ include using namespace std; define fi first define se second define mp make_pair define pb push
阅读全文
摘要:codeforces 348D Turtles 题意 题解 代码 c++ include using namespace std; define fi first define se second define mp make_pair define pb push_back define rep(
阅读全文
摘要:codeforces 547E Mike and Friends 题意 题解 代码
阅读全文
摘要:codeforces 432E Square Tiling 题意 题解 代码 c++ include using namespace std; define fi first define se second define mp make_pair define pb push_back defin
阅读全文
摘要:codeforces 17D Notepad 题意 题解 TBD 更新模板(phi、欧拉降幂) 代码 c++ include using namespace std; define fi first define se second define mp make_pair define pb pus
阅读全文
摘要:codeforces 741D Arpa’s letter marked tree and Mehrdad’s Dokhtar kosh paths 题意 给出一棵树,每条边上有一个字符,字符集大小只有22。 对于每一个子树,询问其中最长的,满足:路径上的字符集可以重组成字符串的路径的长度。 题解
阅读全文
摘要:codeforces 549F Yura and Developers 题意 给定一个数组,问有多少区间满足:去掉最大值之后,和是k的倍数。 题解 分治,对于一个区间,找出最大值之后,分成两个区间。 至于统计答案,可以枚举小的那一端。 也可以结合熟练剖分的思想,由于dfs解决答案的过程是一棵二叉树,
阅读全文
摘要:codeforces 17C Balance 题意 给定一个串,字符集{'a', 'b', 'c'},操作是:选定相邻的两个字符,把其中一个变成另一个。可以做0次或者多次,问最后可以生成多少种,使得任意一种字符和其他字符的个数相差都不超过1. 题解 一个生成串压缩之后必定都是初始串的子序列,那么只要
阅读全文
摘要:Foj 2296 Alice and Bob 题意 两个人博弈,规则如下:轮流取0~9中的数字,最后Alice所得的数字个数为1~n中,数位在Alice所取集合中出现奇数次的。 双方想获得尽量多,问Alice能获得几个。 题解 观察一下,如果n是十的倍数,最后肯定是一人一半,这样一来,状态数应该会减
阅读全文