https://codeforces.com/contest/1330/problem/D 题目大意:给出一个限制 d 与模数 m ,求出可以构造出的满足条件的数组 a 的个数,需要满足以下条件: 1.数组 a 的长度大于等于 1 2.数组 a 严格递增 3.任意的ai <=d且>=1 4.对于数组 a ,需要构造出一个数组 b :满足当 i == 1 时:b[ 1 ] = a[ 1 ], i > 1 时:b[ i ] = b[ i - 1 ] XOR a[ i…
题目链接 D. Appleman and Tree time limit per test :2 seconds memory limit per test: 256 megabytes input :standard input output:standard output Appleman has a tree with n vertices. Some of the vertices (at least one) are colored black and other vertices a…
C. Dasha and Password time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output After overcoming the stairs Dasha came to classes. She needed to write a password to begin her classes. The password i…
B. Name That Tune time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output It turns out that you are a great fan of rock band AC/PE. Peter learned that and started the following game: he plays the f…
D. Nauuo and Circle •参考资料 [1]:https://www.cnblogs.com/wyxdrqc/p/10990378.html •题意 给出你一个包含 n 个点的树,这 n 个点编号为 1~n: 给出一个圆,圆上放置 n 个位置,第 i 个位置对应树中的某个节点,并且不重复: 求在圆上还原这棵树后,使得边不相交的总方案数: •题解 ①为何每一颗子树一定是连续的一段圆弧? 假设不是连续的圆弧,如图所示: 为了使 x 接到树上,必然会有 x-y 或 x-z 相连的边,这样…
Brain's Photos 题目链接: http://codeforces.com/contest/707/problem/A Description Small, but very brave, mouse Brain was not accepted to summer school of young villains. He was upset and decided to postpone his plans of taking over the world, but to becom…