1229

洛谷 P1229

题目链接 有4种结构。 对于只有一个儿子(度为1)的结点,其子节点在左/右不影响先序/后序的遍历顺序,总树数*2。即每多一个度为1的结点,二叉树数量翻倍。 即当先根序列为\(.....X Y.....,\) 后根序列为\(.........YX...\)时翻倍。求出这种结构的个数即可。 #inclu ......
P1229 1229

[CF1229E]Marek and Matching

This is a harder version of the problem. In this version, \(n \le 7\).Marek is working hard on creating strong test cases to his new algorithmic probl ......
Matching 1229E Marek 1229 and

CF1229F Mateusz and Escape Room

# CF1229F Mateusz and Escape Room 很好的题目。 对于此类在环上的问题,一个经典的思路是断环成链。我们先形式化的描述题意,即给 $i$ 向 $i + 1$ 定一个流量 $x_i$(可能为负)。限制则为 $$ \forall i, a_i + x_{i - 1} - x ......
Mateusz Escape 1229F 1229 Room

Codeforces 1229B Kamil and Making a Stream

$\gcd$ 一个性质:对于正整数 $x$, 重复 $x\leftarrow \gcd(x, i)$($i\ge 0$)直到 $x = 1$,$x$ 出现的值个数上限为 $\log_2(x)+1$ 证明:考虑到 $x$ 是逐渐变小,则在 $x$ 变小的情况下,对于 $x = \prod_{i=1}^ ......
Codeforces Making Stream 1229B Kamil
共4篇  :1/1页 首页上一页1下一页尾页