首页 > TAG信息列表 > Petr

CF986B Petr and Permutations(逆序对)

题目描述 Petr likes to come up with problems about randomly generated data. This time problem is about random permutation. He decided to generate a random permutation this way: he takes identity permutation of numbers from 11 to nn and then 3n3n times takes a

codeforces982F

The Meeting Place Cannot Be Changed  CodeForces - 982F  Petr is a detective in Braginsk. Somebody stole a huge amount of money from a bank and Petr is to catch him. Somebody told Petr that some luxurious car moves along the roads without stopping. Petr kn

【Codeforces 113B】Petr#

Codeforces 113 B 题意:有一个母串\(S\)以及两个串\(S_{begin}\)和\(S_{end}\),问\(S\)中以\(S_{begin}\)为开头并且以\(S_{end}\)为结尾的不同子串的个数。 思路1(后缀自动机): 首先肯定要把后缀自动机构建出来(第一次一遍敲对后缀自动机祭),然后我们考虑\(S_{begin}\)(和\(S_{end}\),是对称