Блог пользователя saliii

Автор saliii, 8 лет назад, По-английски

I appreciate if anyone can help me share his good problems of POIs, just list them in the comments and I'll check them all.

Link

Given a string S of size n. We define as follows:

In other hand, is a set of sizes of periods A such that S = AAA...AB(B is a prefix of A).

Now, we want to create the minimum lexicographically string C of size n such that .

There are k such tests.

1 ≤ k ≤ 20, 1 ≤ n ≤ 250000

________________
3
ABIABUABIAB
BABBAB
BABURBAB
________________
01001101001
010010
01000010
________________

Some of hints only make a good look and may not solve the problem. When you look in that way, you'll come close to the solution. And if you didn't look in that way, you won't get the next hints and you'll get confused in 13 spoilers.

hint1
hint2

Some problem just used this idea : 526D - Om Nom and Necklace

hint3
hint4

Tell me if you come up with a easier and shorter answer, I'll become glad.

Code

Hope you enjoy the problem :) and it helped you.

  • Проголосовать: нравится
  • -19
  • Проголосовать: не нравится

»
8 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Auto comment: topic has been updated by saliii (previous revision, new revision, compare).

»
8 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by saliii (previous revision, new revision, compare).