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

Автор keko37, история, 3 года назад, По-английски

Hi everyone!

The sixth round of COCI will be held tomorrow, April 9th at 14:00 UTC. You can access the judging system here. If you are not familiar with the COCI contest format, we encourage you to read the announcement.

The round was prepared by ominikfistric, Bartol, pavkal5, and me.

Feel free to discuss the problems in the comment section after the contest ends.

Hope to see you tomorrow!

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

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

It clashes with Educational Codeforces Round 126. I have tried to ask the author of the Educational Codeforces Round for rescheduling but maybe I am just a CM, there was no reply.

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

It consides with CF edu round, Can you change the time of it? keko37

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится +19 Проголосовать: не нравится

    The dates for all COCI rounds are known from the start of each year, and it doesn't make sense to change it last second for a cf educational round (also applies the other way around, since much work and effort is put into each contest, and you wouldn't want to disrupt the schedule of thousands of participants — for iamttm's comment)

    If you favor one of the contests you can complete the other by yourself later, which I know isn't the same, but I think it's the best you can do right now...

    Of course it would be nice if the scheduling of contests on cf will be done with accordance to other major contests and events (which I think is already the case, at least partially), but there are simply too many contests for it to be possible :/

    Anyways good luck on whatever contest you choose to participate in!

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

Friendly reminder, the contest starts in less than an hour :)

»
3 года назад, # |
Rev. 4   Проголосовать: нравится +50 Проголосовать: не нравится

seems i was the only full scorer this time :)

here are my solutions:

D
D code
E
E code
»
3 года назад, # |
Rev. 3   Проголосовать: нравится +9 Проголосовать: не нравится

My solution for D:

Let's first solve the problem if we only have to print the answer after all the concatenations.

You can simulate the concatenations using a DSU by storing a deque of characters in each component.

Then after you have the final string, you can build a palindromic tree on it. The number of distinct palindromes in the string is just the number of nodes without the two roots.

To support answering after each concatenation, you can store a palindromic tree in each component in the DSU.

To do the merging, you only need to modify the palindromic tree so that it can add characters to the front and the end, and then you can merge two palindromic trees just like deques.

Notes for implementation: Normally, a palindromic tree supports adding a character to one of the ends. To support adding characters to both ends, you can store two pointers, the first points to the longest palindromic prefix, and the second points to the longest palindromic suffix. When merging, you need to be careful to preserve the order, e.g. when merging $$$x$$$ and $$$y$$$ you have to put the characters of $$$y$$$ after the characters of $$$x$$$ if $$$y$$$ has more characters or $$$x$$$ before $$$y$$$ is $$$y$$$ has more characters.