Автор BledDest, 6 лет назад, перевод, По-русски

Привет, Codeforces!

6 марта в 18:05 MSK начнётся Educational Codeforces Round 39.

Продолжается серия образовательных раундов в рамках инициативы Harbour.Space University! Подробности о сотрудничестве Harbour.Space University и Codeforces можно прочитать в посте.

Этот раунд — особенный: трое лучших участников среди тех, у кого есть возможность принимать участие в ACM ICPC, получат специальное приглашение на Hello India x Russia Programming boot camp от Codeforces и SDV, с полной оплатой.

Social Discovery Ventures (SDV) создаёт и развивает Интернет-проекты, помогающие людям со всего мира общаться друг с другом.

Победителям раунда полностью оплатят участие в Hello India x Russia Programming boot camp, проживание и питание в Индии.

В этом раунде также разыгрывается специальный региональный приз — компания Phaze Ventures полностью оплатит участие в Hello India x Russia Programming boot camp трём лучшим участникам раунда из Омана (также среди тех, у кого есть возможность принимать участие в ACM ICPC).

Раунд будет рейтинговым для Div. 2. Соревнование будет проводиться по немного расширенным правилам ACM ICPC. После окончания раунда будет период времени длительностью в один день, в течение которого вы можете попробовать взломать абсолютно любое решение (в том числе свое). Причем исходный код будет предоставлен не только для чтения, но и для копирования.

Вам будет предложено 7 задач на 2 часа. Авторы задач — awoo, vovuh и я.

Удачи участникам! Надеюсь, вы найдёте для себя в раунде что-то интересное.

UPD: Опубликован разбор задач.

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

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

It's not in the upcoming contests list?

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

Will it be on Codeforces? Because it's not on the contest list of Codeforces.

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится -32 Проголосовать: не нравится

    Are you blind?

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

      Nope, but I think you need some memory refreshment as this contest was added in the list 1 day ago. My comment was before that time. Thank you.

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

Wow, what a pleasant surprise.

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

Acceptable start time for Chinese users:)

Vote for the contest and it will appear on the HOME Page?

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

Unfortunately, we cannot add the contest to the registration form right now, and when we will be able to do it, it might be too late for some participants.

We've decided to postpone the round. It will start on March 06, 18:05 MSK (exactly 24 hours after initially announced time).

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

Mandatory comment- "Hope the problem statements are as short as the announcement!".

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

Please rated for Div.1 and Div.2

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится -25 Проголосовать: не нравится

Удачи

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

"Educational Round — Top three contestants among those who are eligible for participating in ACM ICPC will be invited to attend the Hello India x Russia Programming boot camp under the Codeforces + SDV banners, on a full team sponsorship. Social Discovery Ventures (SDV) creates, develops and funds Internet projects specialising in communication platforms that enable people across the world to get closer and expand their social networks."

I have a question top winner are always top why you don't give a chance a pupil? they haven't anyy quality? Do a Randomly Winner.It will be help for him and her -_-

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится -26 Проголосовать: не нравится

    Losers are losers

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

    This is the bug of competetive programming — only the world best participants can win prizes, it is dissapointing -_-. A lot of newbies quickly lose interest -_-. In any other sports participants are divided according to their age/gender/rating etc. and it is possible to win the prizes in any competition, if you are good for it.

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

Clarification: everyone is eligible to win invitations or that is for div2 participants only?

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

there is no contest on contests page..

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

I feel like educational rounds are kinda easier than regular CF rounds. Is that true?

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

The contest starts in 23 minutes, but I can not sign up...

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

when can I register?

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

Hope the problem statements are not as long as the announcement

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

Что подразумевается под возможностью участия в acm icpc? Проживание в определеном регионе, или что-то другое?

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

I wish everyone hacks himself!

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится -6 Проголосовать: не нравится

School 23:00 lights out,but the content begin in 23:05.so I urgently hope to 2 hours ahead of the game

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

“Top three contestants among those who are eligible for participating in ACM ICPC will be invited to attend the Hello India x Russia Programming boot camp under the Codeforces + SDV banners, on a full team sponsorship.”

Are the finalists meant? Or any contestant who can participate in next ACM ICPC is eligible for the invitation?

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

Russian translation states that it is possible to hack your own solution, while english original doesn't. Is this true and how would doing it affect your score?

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

What if someone has already paid for this? Can we get a reimbursement?

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

rating predictor is not working!!

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

Extremely bad experience on problem C. 13 wa on problem C. Maybe I should go to sleep...

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

How to solve D?

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

    we can use dp. dp states are dp[i][j] --> number of minimum hours he has to stay in the college if he skips 'j' lectures till the ith day!

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

    Calculate pre[i][j] = Minimum time spent in university on i'th day after using j skips on this day.
    Then calculate dp[i][j] = Minimum time spent in first i days after using j skips.
    Answer is dp[n][k].
    Transition is dp[i][j]=dp[i-1][z] + pre[i][j-z]. 0<= z<= j

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

      how to get pre[i][j] ?

      • »
        »
        »
        »
        6 лет назад, # ^ |
        Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

        spend time in university = r — l + 1; we can calculate cost[i'th day][spend time in university] = skip time then pre[i][skip time] = spend time in university

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

        Observe that its useless to skip any lecture which is not at the beginning or the end.
        So, we should always skip some prefix and suffix of lectures.
        Let x be number of skipped prefix lectures and y be number of skipped suffix lectures.
        Try all x,y such that x+y<= k .
        pre[i][x+y]=min(pre[i][x+y], val)
        (pre[i][x+y] is initialised to inf)

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

          So calculating pre[i][j] is a n^3 operation?

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

          What's val in the above expression?

          • »
            »
            »
            »
            »
            »
            6 лет назад, # ^ |
            Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

            The time spent after skipping first 'x' classes and last 'y' classes.
            It can be calculated in O(1) if you store all lecture times in a vector.
            Let size of vector be vs.
            val= 0 if x+y>=vs
            val= v[vs-y-1]-v[x]+1

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

    You may have an initial greedy idea to skip classes on endpoints of a day if skipping that class saves you the most number of hours. Unfortunately, this does not work because of the case

    2 8 2 10111101 11000011

    Greedy solution would skip first and last class on first day, but optimal solution is to skip first and second class on second day.

    We can make sets si for each day i that contain the hours that have classes. Then, for each day, we can calculate the minimum number of hours to attend class that day if we skip j classes on that day, and calculate this number for all j such that 0 ≤ j ≤ min(k, |si|).

    Once we have that, we do a simple dp, where our dp array has n rows and k + 1 columns. dpij will contain the minimum number of hours to attend class after day i while still having j days left to skip. Then, for the first row, we fill it up with the values we calculated in the last paragraph (i.e. dp[0][k] will be total number of hours of day 0, dp[0][k-1] will be minimum number of hours on day 0 if we skip 1 class, dp[0][k-2] will be minimum number of hours on day 0 if we skip 2 classes, etc.). For rows i > 0, we just test the possibility of skipping 0 ≤ j ≤ min(k, |si|) days from each point in the previous row.

    Then the answer will be the minimum number in our last row.

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

any idea what is test 16 for D?

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

    Totally random test with n = m = k = 500

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

      Shouldn't it be prefix/sufix calculation for each row then dp? I couldn't figure why my solutions fails for over an hour :D

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

    i think the test 16 is something like when we skip on ith day some starting lectures and some lectures from last for an optimal solution. e.g 2 6 2 101101 000000 ans=2

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

    I also got WA on test 16, mostly it would be the case of having some prefix and some suffix skipped on a particular day, as I was considering either of them on one day not both.

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

D is harder than usual

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

Well, I solved E in about 15 minutes, and still wondering how could so many people solved D successfully.

Can anyone give me a hint? ;)

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

    http://codeforces.com/blog/entry/58155?#comment-418680

    Btw can you please explain your approach to E?

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

      First of all, here is my submission (36014589), in case my explanations are unclear. ;)

      With each test, provided that the number in the input is guaranteed to have an answer, we are sure that there is an answer with (|S| - 2) '9' digits (perhaps not the most optimal one, just get moving on).

      Now to find an answer with |S| length.

      First, we can use an array to store the number of appearances of each digit. Along with that, we will know the number of digits that has an odd appearance count.

      For example, with 28923845, we have count(2) = count(8) = 2 and count(3) = count(4) = count(5) = count(9) = 1.

      Since the answer is strictly lower than the given number, we can iterate the string from right to left. With each digit position, we can do the following:

      • If an answer has been found before, terminate all iterations.

      • If not, iterate all digits lower than the current one in a decreasing order. This time, all digits to the right of the digit we're iterating can be arbitrarily large without violating the "strictly-lower" criterion, therefore, an answer will be found if:

      1. There are enough digits to the right to compensate with the current number of digits with odd appearance count.

      2. If 1 is satisfied, the remaining digits to the right (after excluding the one used for compensation in step 1) must be an even number (to not creating another odd appearance count again).

      If both are satisfied, then an answer is found: which is all digits to the left of the iterating one (order remained the same), the value we're working on with that digit, and the digits to the right, which are modified according to the above criteria to keep the number "beautiful" and make it as large as possible.

      Taken the example of input 28923845 again.

      Starting at digit 5. As we're not working with this digit any more, decrease count(5) by 1, i.e. count(5) = 0 now.

      Since we still have 3 distinct digits with odd appearance count (3, 4 and 9), it is certain that we can't find an answer here. So we move on to digit 4.

      Again, we have to decrease count(4) by 1, i.e. count(4) = 0.

      Let's replace that digit with '3'. So, count(3) will be increased by 1, i.e. count(3) = 2.

      Now, only digit 9 has an odd appearance count, and we have exactly one digit to the right to spare, so we will set the value of that digit to '9', so all digits will have even appearance count. The answer is 28923839.

      P/s: What if the input is 44400000?

      Since no digit is lower than 0, we will surely start at the rightmost 4.

      Let's replace it by 3. Of course, we can replace a digit on the right by 3 to compensate, and there are 4 digits left un-handled. Since it is an even number of digits, we can safely replace all 4 of them with 9.

      The answer is constructed by the following: first two 4 digits on the leftmost (their states don't change at all), the digit 3 (replaced from the initial rightmost 4), and on the right, we have four 9s and one 3. We will write them from left to right in a descending order to make sure the number's value is largest possible.

      The answer for this input should be 44399993.

      Hope that this help you! ;)

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

      Also, thanks for the hint for D ;)

      I got stuck with greedy for about 30 minutes, and after solving E, for some reasons my mind just froze and couldn't visualize a clear DP approach for it :-P

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

C is very easier than usual and D is harder than usual...

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

Was D meant to be a solved in a Knapsack Problem way?

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

Damn Codeforces, it became too slow towards the end

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

I am not a grammer nazi, but this — If you can gen the string that will be obtained from the given string and will be contain english alphabet as a subsequence, print it.

UPD: It's fixed.

  • »
    »
    6 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

    Hoyl, why did nobody tell us this during the contest!? Sorry, it should be fixed now, statement will get updated in a couple of minutes.

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

How to solve C if we are asked to find the minimum number of operations (for any string s and t)

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

    DP[i][j] indicates the minimum way to solve the suffix ending at index i, with j as the letter we are currently trying to assign (starts at 0, goes to 25), S is the input string

    DP[i][j] = Min(S[i]-j + DP[i+1][j+1], DP[i+1][j]) — if S[i] <= j

    DP[i][j] = DP[i+1][j] ------------------------------------ if S[i] > j

    O(N*Alphabet)

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

is there anyone else who cannot see others solution to hack!!!??

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

How to solve problem E?

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

It's sad that my F couldn't get accepted because I didn't initialize 2fib0 and 2fib1 :(

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

So I ended up writing a dp solution for problem C which finds the minimal number of moves. And after the contest I noticed in the problem statement "Your target is to make some number of moves (not necessary minimal)..." :|

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

Implementation issues in D :( Good problem, though, finally a DP problem I was close to solving.

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

seems most of them are hacking them self!lol XDXDXD

only a few who hacked others!! haha

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

    Still, i am not able to see any other solution to problems. Ha Ha Ha

    Hack to other solution how possible without a see code.

  • »
    »
    6 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

    What is the test hack for problem C? I understand now.You are allowed to do multiple replacements for the same position of the string.

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

For the last question. maintaining prefix LIS and suffix LIS in same segtree and function as sum of both.(we subtract i from each a[i] initially and coordinate compress the array)
Can we do something like doing rollbacks on a segment tree in one direction and normal lazy updates in another direction. Does this work?

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

    I'm not sure whether we can do it using only one segment tree, but model solution uses two segment trees with almost the same approach.

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

    I have used one segment tree. There was no need of rollbacks, lazy updates, dynamic segment tree whatsoever. Only range query and point updates.
    Solution

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

How decreasing memory to solve D.

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

http://codeforces.com/contest/946/submission/36016554 can anyone provide a test for which this fails?

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

I had like a minute left and read problem G and BS'd an answer that was basically copy-paste from LIS template.

Threw it together in <30 seconds and submitted without compiling, WA on test 20 lol 36021949

EDIT: I realize the error and I'm surprised it made it as far as test 20.

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

In Berland students study in the university 500 days a week

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

How did http://codeforces.com/profile/assbb solve D and E but not the first 3? Seems a bit curious to me.

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

How this output is ok for problem C?

UPD: Fixed and this solution got hacked.

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

Why do so many people have weird barely readable aliases in their solutions, even for simple problems? Like this, for example.

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

Did someone solve E using Binary Search by fixing the length of the prefix then generate the appropriate suffix?

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

I've just been hacked on problem A, Actually I discovered that I understood it wrong ... but my solution passed during the contest. I don't think that you should put so weak tests like those so solution for another problem pass!!!

Hacking is for some tricky case or clever case that makes the solution wrong but not for making absolutely wrong solutions pass during the contest and then hack them after the contest. I really think you should rethink about that.

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится -16 Проголосовать: не нравится

    The tests are not final. All the solutions will be re-tested on successful hacks after the hacking finishes. One of the points of competitive programming is that you should test your solutions better yourself.

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

      I said I understood the problem wrong ... is it logical for a solution of a problem pass another one!! That's my point, I'm not saying that they should put all the tests, but totally wrong solutions shouldn't pass!!

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

        Yes, actually I too wanted to raise the same issue, the testcases should not be so weak that it passes absolutely wrong solution, like at least it should cover all the basic cases.

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

Test: #1, time: 15 ms., memory: 1908 KB, exit code: 0, checker exit code: 0, verdict: OK

Input

aacceeggiikkmmooqqssuuwwyy

Output

aacceeggiikkmmooqqssuuwwyy

Answer

abcdefghijklmnopqrstuvwxyz

Checker Log

ok Ok

why checker log is ok ok? for problem A this submission

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

how to approach B. My solution gives wrong answer for large test cases.

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

    There is an "else if" missing in Line 15 in your code, without this "else if" the while loop breaks if the condition on Line 15 is not satisfied, however, your code won't pass even if you fixed this line because of the input constraints (10^18) and will give you TLE.

    The right approach is to subtract the quotient of the division of a by 2*b from a and subtract the quotient of b by 2*a from b while you can instead of subtraction.

    My AC Submission : Link

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

What is the solution for F?

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

    I did not solve it incontest and nor have I submitted it later, but pretty sure this is the solution (Confirmed by comparing it with accepted codes).

    Basically notice that when you make the ith fibonacci string you already have a concatentation of F(1)...F(i-1) present so its F(i)...F(i-1)F(i-2)F(i-1)

    An important intuition is that the number of occurences of the string s in F(1)...F(i) can be broken as number of occurences of some prefix of s in F(1)...F(i-1) and number of occurences of the remaining part of s in F(i). [We multiply these].

    To do this, we maintain 2 types of DP. till[i][l][r] stores the number of ways to get s[l...r] as a subsequence till the ith fibonacci string. curr[i][l][r] stores the number of ways to get s[l...r] as a subsequence in the ith fibonacci string. Notice that for each way in till[i-1][l][m] we can match it with a way in curr[i][m+1][r]. Thus we multiply these. We apply a similar logic for the transition of curr. In simple terms these events are independent so they're multiplied.

    Transition:
    1. curr[i][l][r]+=curr[i-2][l][m]*curr[i-1][m+1][r] for all m in [l, r)
    2. till[i][l][r]+=till[i-1][l][n]*curr[i][n+1][r] for all n in [l, r)

    The final answer is till[x-1][0][n-1] if fibonacci index = x and length = n (0 based indexing)

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

    Firstly, for every subsequence that is exactly the pattern, it will appear in 2^(positions free to the left) * 2^(positions free to the right).

    left[i][l][r] = sum of 2^(positions free to the left) for every subsequence that contains exactly characters [l, r[ in the pattern

    right[i][l][r] = sum of 2^(positions free to the right) for every subsequence that contains exactly characters [l, r[ in the pattern

    sub[i][l][r] = number of subsequences that contains exactly characters [l, r[ in the pattern

    sub[i][l][r] = (sum l <= m <= r of sub[i — 1][l][m] * sub[i — 2][m][r]) + sub[i — 1][l][r] + sub[i — 2][l][r]

    left[i][l][r] = (sum l <= m <= r of left[i — 1][l][m] * sub[i — 2][m][r]) + 2^(size of f(i — 1)) * left[i — 2][l][r] + left[i — 1][l][r]

    right[i][l][r] = (sum l <= m <= r of sub[i — 1][l][m] * right[i — 2][m][r]) + 2^(size of f(i — 2)) * right[i — 1][l][r] + right[i — 2][l][r]

    The subsequence either has parts in f(i — 1) and f(i — 2) (the summation part) or is completely inside f(i — 1) or f(i — 2) (the rest). But this isn't the complete answer because it has 2^(one side). So the answer comes either from f(i — 1) and f(i — 2) or from one of them so:

    ans[i] = ans[i — 1] * 2^(size of f(i — 2)) + ans[i — 2] * 2^(size of f(i — 1)) + (sum 0 < m < n of left[i — 1][0][m] * right[i — 2][m][n])

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

    This was 2012 ACM ICPC World Finals problem D. A thorough explanation can be found at:

    https://www.youtube.com/watch?v=dPFq4OLc-_Q

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

Did the image change just now?

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

In D, how could O(n*m²) solutions run in less than 100ms for some people?

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

    n = 500 with o(n ^ 3) just so fast. Btw, for O(n ^ 2), if the operations are not complicated, it works for n = 10000.

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

On problem A ,I think the statement was very confusing. What was meant by "You may partition this sequence into two sequences"?? It seems the sequence should be partitioned into two contiguous part. Here 'partition' and 'sequence' have created confusion. The author should chose words carefully. I misunderstood it. Unfortunately the test cases was so weak that they passed for my wrong solution. Who always read explanation of test cases on A !!

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

    I wasted 10 minutes on this problem and got a penalty of 20 minutes because in my first submission i thought that I must maintain the order of the input and build a prefix sum array to know the best position of splitting :\

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

Problem A was written in a very bad way that I didn't know whether should I treat the input as a contiguous sequence or 2 subsequences after splitting and that cost me 30 penalty points.

Problem C test data was soooo weak and that resulted in hacking a lot of submissions including mine

I hope you consider these 2 issues in the next round, the weak test data and the bad problem formulation

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

    It says "in two sequences". I think this is pretty clear. They would say subsegment if they meant contiguous numbers

»
6 лет назад, # |
Rev. 6   Проголосовать: нравится -11 Проголосовать: не нравится

awoo
vovuh BledDest

SERIOUS BUG !!!!!!( DO READ THIS)

/*

Input

aacceeggiikkmmooqqssuuwwyy

Participant's output

abcdefghijklmnopqrstuvwxyy

Jury's answer

abcdefghijklmnopqrstuvwxyz

Checker comment

ok Ok

*/

How did my solution for C got accepted verdict? It's not giving correct answer even for the 1st testcase.

Here's the link to my accepted solution(during the contest, it got hacked now): http://codeforces.com/contest/946/submission/36018053

Another thing, now if you try to submit the same solution, it gives "wrong answer on test 1".

As you can see it clearly gave wrong answer for the test case but the verdict is "ok,ok" :(.` Can you please fix this? this is a real serious bug. Btw, it really screwed my contest. Now,I am literally inventing ways to screw a contest :(.

/*

Input

aacceeggiikkmmooqqssuuwwyy

Participant's output

abcdefghijklmnopqrstuvwxyy

Jury's answer

abcdefghijklmnopqrstuvwxyz

Checker comment

ok Ok

*/

Thanks!

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

    There was an issue in the checker, for some tests it returned OK instead of WA. It is really unfortunate but it is not a dramatic issue because you can always assume that there weren't such tests during a contest. Obviously, this argument can't be applied to wa1, though our estimated number of people affected is not that great. The participant can literally check his output for the sample case himself. We are still really sorry about it, the checker is fixed now and we will do our best in the following rounds to eliminate the possibility of similar mistakes.

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

Subsequence of the string is the string that is obtained by deleting characters at some positions

Did this note mean any thing to the solution in problem C ?

because it mean we can just print abcdefghijklmnopqrstuvwxyz or im wrong ?

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

    For example, see this test case (note the z at the 2nd position)

    azbcdefghijklmnopqrstuvwxyz

    There is a subsequence valid if we delete the first z, but we didn't use any change operation so the correct output is:

    azbcdefghijklmnopqrstuvwxyz

    The output must contain the changes you made for the string to be ok, but deleting a character is not a "change".

    Hope this helps you!

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

      But he didnot say that i must made a change he just need the final subsequence

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

        Actually it says "You need to print the string that will be obtained from the given string and will be contain english alphabet as a subsequence" and "If you can get a string that can be obtained from the given string and will contain english alphabet as a subsequence, print it."

        It says to print the changed string that contains the alphabet as subsequence, it does not say to print the subsequence.

        I agree that it could not be 100% clear at first sight :p

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

Please put stronger pretests in futur contests, We really don't want this awesome website to turn to Hackforces instead of Codeforces, this is really bad I mean I understand that this whole pretests thing is necessary due to huge number of participants but really try to make sure you put some strong pretests (sometimes a completely wrong solution can pass pretests... ) . In addition to that the hacks idea is really good but I think the hacks should not be very easy like they are now ( some people don't even read the code they just try limit input data and see if they get lucky hacking the solution )

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

After doing 108 successful hacks and then later know that it doesn't give you points in educational rounds..

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

    its doesnot give you point but if your rank is 300 and you hacked user with rank 299 you will be 299 so its good to hack

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

    I was thinking to send a message to inform you but I said maybe he do it for a purpose.

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

When should rankings for div 2 update?

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

How is penalty calculated in educational rounds?

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

    Sum of 1)Time taken for all questions from start of question to accepted solution 2)20*no. of wrong submission

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

      Oh thanks for that. 20 seems quite high tho, considering around 1000 people solve 3 in 30 mins.

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

        Yes, in my opinion in should be lowered, as it is blown out of proportion against time penalty in educational rounds.

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

Why during system test of ACM-style contest pending runs are shown with -x instead of ?x? And API also says that result is final, but some submits are pending

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

Why the rating has not changed so far ?

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

BledDest

This is with regard to question C 946C - String Transformation. I have solved the question C but after system testing i got TLE.

But to my surprise when i resubmitted the same code after the system testing it got accepted . I am posting the links of 2 submissions here one with TLE and other with Accepted.

one with TLE — 36008794

one with Accepted — 36055044

and both solutions are same , you can check yourself by comparing diff(they have no diff)

Can you please see this issue?

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

When rating update will happen for div 2 :(

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

    So u were waiting :D You became specialist. Congrats (Y). I became green :D

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

My cf predictor shows my rating will increase by 125(it has not been wrong yet) . This result was shown to me just after finishing the system testings. As cf rating changes has not been updated yet, may i assume that cf will use a new formula this time to calculate new ratings? Some of the results by cf predictors looked unfair to me. So new formula won't be bad if authority approves.

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

When rating update will happen for div 2 ^_^

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

I think that the reason that the rating is not updated yet is because of the error in the previous test of problem C.

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

nvm

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

Who won the special prizes?