CF431C】的更多相关文章

Quite recently a creative student Lesha had a lecture on trees. After the lecture Lesha was inspired and came up with the tree of his own which he called a k-tree. A k-tree is an infinite rooted tree where: each vertex has exactly k children; each ed…
题目描述 Quite recently a creative student Lesha had a lecture on trees. After the lecture Lesha was inspired and came up with the tree of his own which he called a k k k -tree. A k k k -tree is an infinite rooted tree where: each vertex has exactly k k…
前言:本文章主要记录一些 \(dp\) 入门题,都是我做过的,希望读者能从这些基础题中打好 \(dp\) 扎实的基础,有不足的地方也欢迎指出.大部分是 \(CodeFoces\) 和 \(Atcoder\) 的题(可以公开代码). T1: CF191A 题意: 给你若干字符串,\(a\) 可以拼接到 \(b\) 后面,当且仅当 \(b\) 的最后一个字符与 \(a\) 的第一个字符相同. 举个栗子:设 \(a,b\) 长度分别为 \(s1,s2\),则拼接后新的字符串为 \(a+b\),长度 \…