Problem StatementTaichi thinks a binary string X of odd length N is beautiful if it is possible to apply the following operation N−12 times so that the only character of the resulting string is 1 : Choose three consecutive&n
Problem StatementSnuke has a rooted tree with N vertices, numbered 1 through N. Vertex 1 is the root of the tree, and the parent of Vertex i ( 2≤i≤N ) is Vertex Pi ( Pi<i ). There is a number, 0 or 1, writte
Problem StatementIn Republic of AtCoder, Snuke Chameleons (Family: Chamaeleonidae, Genus: Bartaberia) are very popular pets. Ringo keeps N" data-mce-tabindex="0">NN Snuke Chameleons in a cage. A Snuke Chameleon that has not eaten anything is blue. It changes its color according to the f
Problem StatementFind the number of the possible tuples of sequences (A0,A1,…,AN) that satisfy all of the following conditions, modulo M: For every i (0≤i≤N), Ai is a sequence of length i consisting of integers between 1 and K (inclusi
Problem StatementWe have a sequence A of length N. On this sequence, we can perform the following two kinds of operations: Swap two adjacent elements. Select one element, and increment it by 1. We will repeatedly perform these operations so that A will be a non-decreasi