CF280C-Game on Tree 题目: 题目描述: Momiji has got a rooted tree, consisting of $ n $ nodes. The tree nodes are numbered by integers from $ 1 $ to $ n $ . The root has number $ 1 $ . Momiji decided to play a game on this tree. The game consists of several steps. On each step, Momiji chooses one of the
CF19E-Fairy 题目: 题目描述: Once upon a time there lived a good fairy A. One day a fine young man B came to her and asked to predict his future. The fairy looked into her magic ball and said that soon the fine young man will meet the most beautiful princess ever and will marry her. Then she drew on a sheet of paper $
CF455D-Serega and Fun 题目: 题目描述: Serega loves fun. However, everyone has fun in the unique manner. Serega has fun by solving query problems. One day Fedor came up with such a problem. You are given an array $ a $ consisting of $ n $ positive integers and queries to it. The queries can be of two types: Make a unit cyclic shift to
P3181-[HAOI2016]找相同字符 题目: 题目描述: 给定两个字符串,求出在两个字符串中各取出一个子串使得这两个子串相同的方案数。两个方
P4248-[AHOI2013]差异 题目: 题目描述: 给定一个长度为 $n$ 的字符串 $S$,令 $T_i$ 表示它从第 $i$ 个字符开始的后缀。求 $\displaystyle \sum_{1\leqslant i<j\leqslant n}\text{len}(T_i)+\text{len}(T_j)-2\times\text{lcp}(T_i,T_j)$ 其中,$\t
P3763-[TJOI2017]DNA 题目: 题目描述: 加里敦大学的生物研究所,发现了决定人喜不喜欢吃藕的基因序列 $S$,有这个序列的碱基序列就会表现出喜欢吃藕的性状,但是研究人