标签 - Codeforces

TCO的神题真的做不动了 不如换换脑袋吧 E Palindromes in a Tree 题意:给你一棵N" role="presentation" style="position: relative;">NNN个点的树,每一个点有一个字母′a′−′t′" role="presentation" style="position: relative;">′a′−′t′′a′−′t′'a'-'t',对每个点回答有多少经过它的路径是回文的。一条路径回文当且仅当它的
? 解题记录 ? ? Codeforces ? ? 贪心 ? ? 构造 ?    2018-09-18 10:45:43    441    0    0
You are given a tube which is reflective inside represented as two non-coinciding, but parallel to Ox" data-mce-tabindex="0">OxOx lines. Each line has some special integer points — positions of sensors on sides of the tube. You are going to emit a laser ray in the tube. To do so, y
? 解题记录 ? ? Codeforces ? ? 构造 ?    2018-09-18 09:37:50    467    0    0
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1" data-mce-tabindex="0">11 to n" data-mce-tabindex="0">nn. For every edge e" data-mce-tabindex="0">ee of this tree, Mono
? 解题记录 ? ? Codeforces ? ? KMP ? ? 动态规划 ?    2018-09-18 09:18:41    474    0    0
You are given a binary string s" data-mce-tabindex="0">ss. Find the number of distinct cyclical binary strings of length n" data-mce-tabindex="0">nn which contain s" data-mce-tabindex="0">ss as a substring. The cyclical string t" data-mce-tabindex="0"
? 解题记录 ? ? Codeforces ? ? 贪心 ? ? 乱搞 ? ? 打表 ?    2018-09-18 09:03:06    410    0    0
output standard output A tree is an undirected graph with exactly one simple path between each pair of vertices. We call a set of simple paths k" data-mce-tabindex="0">kk-valid if each vertex of the tree belongs to no more than one of these paths (including endpoints) and each path consists
? 解题记录 ? ? Codeforces ? ? 分块 ? ? 模拟 ?    2018-09-18 08:56:50    362    0    0
The Tree 维护一棵n" role="presentation" style="position: relative;">nnn节点,每个节点为黑色或白色的树,给你q" role="presentation" style="position: relative;">qqq个操作: 1、递归进行如下操作:如果当前节点是白色,那么将它染成黑色;如果当前节点是黑色,对它的所有儿子调用该操作。 2、将一颗子树所有的点染成白色。 3、查询一个点的颜色,是黑色输出"black",白色输出"white"。 n≤105,q≤105
? 解题记录 ? ? Codeforces ? ? 动态规划 ? ? 组合数 ?    2018-09-18 08:10:36    300    0    0
Kuro has recently won the "Most intelligent cat ever" contest. The three friends then decided to go to Katie's home to celebrate Kuro's winning. After a big meal, they took a small break then started playing games. Kuro challenged Katie to create a game with only a white paper, a pencil, a pair of s
? 解题记录 ? ? Codeforces ? ? 动态规划 ?    2018-09-16 16:14:11    455    0    0
You are given a square board, consisting of n" data-mce-tabindex="0">nn rows and n" data-mce-tabindex="0">nn columns. Each tile in it should be colored either white or black. Let's call some coloring beautiful if each pair of adjacent rows are either the same or d
? 解题记录 ? ? Codeforces ? ? 动态规划 ?    2018-09-13 22:57:18    497    0    0
For an array b" data-mce-tabindex="0">bb of length m" data-mce-tabindex="0">mm we define the function f" data-mce-tabindex="0">ff as f(b)={b[1]if m=1f(b[1]⊕b[2],b[2]⊕b[3],…,b[m−1]⊕b[m])otherwise,"
? 解题记录 ? ? Codeforces ? ? 动态规划 ? ? 数位dp ? ? 搜索 ?    2018-09-13 22:52:19    464    0    0
output standard output Let's call some positive integer classy if its decimal representation contains no more than 3" data-mce-tabindex="0">33 non-zero digits. For example, numbers 4" data-mce-tabindex="0">44, 200000" data-mce-tabindex="0">200000200000, 1