300iq's blog

By 300iq, 6 years ago, translation, In English

Hello everybody!

Now the winter SIS (Summer Informatics School) is taking place, and we, as part of the parallel A+ with its teachers, have prepared a complete Codeforces Round.

The round will happen at Jan/05/2019 19:35 (Moscow time) and will last for 2.5 hours. There will be 6 problems in each division.

The tasks of the round were invented and prepared by 300iq, scanhex, cookiedoth, VeryLonelyRaccoon, ----------, kkarnauk, forestryks, TheWayISteppedOutTheCar, LordVoldebug, romanovsavelij, golub, ismagilov.code,alexey_kuldoshin, LadyPython, Jatana under the guidance of teachers izban, VArtem, meshanya, pashka.

Also thanks for testing isaf27, peltorator, Kurpilyansky.

And, of course, thanks to MikeMirzayanov for great systems Codeforces and Polygon.

Good luck everybody!

UPD: Since the registration opens before the recalculation of the rating after Hello 2019, in case of a division change, the participants will be moved to another division.

UPD: Editorial.

  • Vote: I like it
  • +645
  • Vote: I do not like it

| Write comment?
»
6 years ago, # |
  Vote: I like it +16 Vote: I do not like it

I'd very much like to see rated rounds which are shorter than 2 hours, not longer.

For me, it's much easier to dedicate 1.5 consecutive hours to writing a contest than to have 2.5 or 3 hours available.

  • »
    »
    6 years ago, # ^ |
    Rev. 3   Vote: I like it -79 Vote: I do not like it

    .

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +42 Vote: I do not like it

      Your comment was downvoted desperately, therefore we can conclude that CF community is unfavourably disposed towards Gassa making a contest.

      • »
        »
        »
        »
        6 years ago, # ^ |
        Rev. 2   Vote: I like it +3 Vote: I do not like it

        sorry, what i replied above means i look forward to Gassa's marathon contest ..

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I think that 1.5 hours isn't enough for CF contest with current format (5-6 problems).

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it -16 Vote: I do not like it

      We should add a contest that runs for 1.5 hours on 2 or 3 problems of high difficulty with batch scoring. Unrated, of course.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    I think maybe the div.3 rounds could be set as 1.5hrs long.

»
6 years ago, # |
  Vote: I like it -44 Vote: I do not like it

2 consecutive contests to start the year? bring me some of that

»
6 years ago, # |
Rev. 6   Vote: I like it -47 Vote: I do not like it

Cool! 300iq is now purple!

Edit: Not anymore :(

»
6 years ago, # |
  Vote: I like it -48 Vote: I do not like it

10 min delay :|

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +60 Vote: I do not like it

    Haha, maybe you're comment in the wrong thread

»
6 years ago, # |
  Vote: I like it -51 Vote: I do not like it

13 problem setters for 8 problems ...........

»
6 years ago, # |
  Vote: I like it -143 Vote: I do not like it

 Dear CF, is it very cold there?

Why are you freezing up?

»
6 years ago, # |
  Vote: I like it +24 Vote: I do not like it

The contest length is 2.5 hours in the blog but it shows 2 hours in the upcoming contests.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it -16 Vote: I do not like it

    I think it is of 2 hour because normally all the contest of this type is of 2 hours... @300iq please make us sure

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It is updated now.

»
6 years ago, # |
Rev. 3   Vote: I like it -257 Vote: I do not like it

I think CODEFORCES hates me! Whatever comment(or reply) I make (I tried many kinds. Contributed, Made Memes, Helped people etc.), always get dozens of downvotes. I'm really sad about it. I don't want to contribute anymore! It's already -24 and going down.

  • »
    »
    6 years ago, # ^ |
    Rev. 5   Vote: I like it +3 Vote: I do not like it

    grey-dude >:( it's under -24 now

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +15 Vote: I do not like it

    well, think about the person you helped or people who laughed when they saw your memes,

    what i'm saying, is "Care about community!" and not about contribution points. if you helped somebody, that is good enough for you to keep doing it.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +12 Vote: I do not like it

    The way you comment reminds me of attention girls in instagram

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +27 Vote: I do not like it

    Because people are rankist!

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    This is so sad alexa play despacito

»
6 years ago, # |
  Vote: I like it -6 Vote: I do not like it

Oh no, the magic has gone :( Now I can't play to the chameleon

»
6 years ago, # |
  Vote: I like it -9 Vote: I do not like it

After a bad experience of acm icpc, finally I am going to start this year with a new way and this is the first contest for my new journey for this year..

»
6 years ago, # |
  Vote: I like it +177 Vote: I do not like it

the winter SIS (Summer Informatics School)

Hold up.

»
6 years ago, # |
  Vote: I like it -13 Vote: I do not like it

Every JBer show me ur hands up

»
6 years ago, # |
  Vote: I like it +5 Vote: I do not like it

The registration page says the contest is two hours long--is it still intended to run for 2.5 hours?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    Maybe, Yes! (2.5 hours) Now it shows the length correctly. (Maybe it's updated)

»
6 years ago, # |
  Vote: I like it +7 Vote: I do not like it

Another contest with 300iq in problemsetters

Looking forward to good tasks

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

The time of the match is very unfriendly to Chinese players.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Practically everybody in East Asia too

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      Yah. But south-east Asins are having a good time I think >_<

      • »
        »
        »
        »
        6 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Nope :( I'm in the part of South-East Asia where the contest starts at 11:35 PM :(

        • »
          »
          »
          »
          »
          6 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Yah, it will start at 10:35 PM in our country. I think we are almost at the same area . By the way, think about chinese people. they have to sit for contest at midnight :( Maybe we are a bit lucky :D

»
6 years ago, # |
  Vote: I like it +22 Vote: I do not like it

Oof.. Red and Orange problemsetters in disguise! XD

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Seems like it’s going to be a good round

»
6 years ago, # |
  Vote: I like it +17 Vote: I do not like it

starts at 01:35 in South Korea... I'm willing to exchange tomorrows day time to a codeforce round XD

»
6 years ago, # |
  Vote: I like it +21 Vote: I do not like it

Score distribution?

»
6 years ago, # |
  Vote: I like it +2 Vote: I do not like it

Scoring Distribution?

»
6 years ago, # |
  Vote: I like it +15 Vote: I do not like it

lol what a contest :D

»
6 years ago, # |
  Vote: I like it +26 Vote: I do not like it

Wow!!! Problem F of div2 in not present in div1.
wonder!! why it is so??

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Nice difficulty-balanced div2D and div2E/F

»
6 years ago, # |
  Vote: I like it +36 Vote: I do not like it

Is there a straight-forward solution for Div1B that's not a disgusting ton of mindless casework? That problem ruined the contest for me, so I hope there's something at least somewhat neat.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I think its just two cases and then DP

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I don't think I have done any caseworking

  • »
    »
    6 years ago, # ^ |
    Rev. 3   Vote: I like it +48 Vote: I do not like it

    If my solution is correct:

    Good table is either

    1) Each row is XYXYXYXY

    So after you fix 2 symbols in the first row (just iterate over all possible combinations), symbols in all other rows are known. For each row you should check what is "cheaper" to make — XYXYXYXY... or YXYXYXYX...

    2) Same, but with rows instead of columns.

    • »
      »
      »
      6 years ago, # ^ |
      Rev. 2   Vote: I like it +14 Vote: I do not like it

      Blah, you're right, I suck. Did the first part of that observation and then did the second still with the mindset of rows, which made stuff blurry.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +20 Vote: I do not like it

    Either each row or each column consists of two alternating symbols.

»
6 years ago, # |
  Vote: I like it +18 Vote: I do not like it

A was a little difficult to understand.

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

what is test 6 in Div2 D ?

  • »
    »
    6 years ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    n=7 p[i]={1 2 3 1 5 5} s[i]={1 -1 2 -1 -1 5 5} ans = 6 a[v]= {1,1,0,0,4,0,0};

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It's not optimal to make the value of node U as s[U]-s[parent of parent of U] if S[U]!=-1

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      why not

      • »
        »
        »
        »
        6 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        If value of mid node (s[mid] is equal to -1) val then it contributes to answer only val and child of mid will contribute S[child]-s[parent of mid]-val but if val is 0 then they contibute sum of S[child]-S[parent of mid]. First case is sum of S[child] — sum of S[parent of mid]-val * numberofchild which is better
        Optimal value of val is minimum of S[child]-S[parent of mid]

  • »
    »
    6 years ago, # ^ |
    Rev. 2   Vote: I like it +3 Vote: I do not like it

    If your subtree's root is at an even depth, then making its value 0 is not optimal. Consider the tree with edges 1-2, 2-3 and 2-4. If the values are 0,-1,5,5 respectively, you want the node 2 to take 5 and not pass on the value to the nodes 3 and 4

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      so what is the optimal answer ?

      • »
        »
        »
        »
        6 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        The total optimal sum is 5, and not 10. Since node 2 is the root, it contributes to the sum for both 3 and 4, hence effectively reducing the total sum.

        • »
          »
          »
          »
          »
          6 years ago, # ^ |
          Rev. 2   Vote: I like it 0 Vote: I do not like it

          yes I understood the test

          how to get the optimal answer in general

          • »
            »
            »
            »
            »
            »
            6 years ago, # ^ |
            Rev. 2   Vote: I like it +8 Vote: I do not like it

            Check minimum sv from even node's sons, substract sv from node's father and you get optimal av (and sv too) for this node. If node is even and hasn't sons, you set its av as 0. For odd nodes you just calculate svsfather.

            • »
              »
              »
              »
              »
              »
              »
              6 years ago, # ^ |
              Rev. 2   Vote: I like it 0 Vote: I do not like it

              mj

              • »
                »
                »
                »
                »
                »
                »
                »
                6 years ago, # ^ |
                  Vote: I like it +8 Vote: I do not like it

                Suppose we calculated optimal sv and av values for every node on path 1 -> Parent of CurrNode. Let SumOnPath be sCurrNodesFather

                If CurrNode's depth is odd, we can unambiguously determine its av, the sv is given in input.

                Now move to the even depth case with 1+ sons Setting aCurrNode only affects contiguous sons ason value — the sson is constant. Since we can set aCurrNode to any value, we want to choose one that minimizes sum of ason.

                ason can be represented as

                ason = ssonaCurrNode — SumOnPath

                So

                is constant, so maximizing the value of aCurrNode will minimize a Also, av cannot be negative, so maximum value of aCurrNode is minimum of sson - SumOnPath

                Starting from root (where we have av and sv ) we can calculate all the values using dynamic programming.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Try: 4 1 2 2 3 -1 8 5

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Consider the case : 4 1 2 2 3 -1 7 7

    Answer should be 7

  • »
    »
    6 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Try this: 3 1 2 2 -1 3 Answer is 3

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone give a hint for E Div2?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Notice that either all the rows or all the columns must have only 2 letters each. Thus, iterate for all the possibilities.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Why ? I get it, instincts, no one demonstrates it himself during the contest. But why is it so ?

      • »
        »
        »
        »
        6 years ago, # ^ |
          Vote: I like it +46 Vote: I do not like it

        It is clear that no column/row has only 1 letter. Then, we need to show that if some row has 3 or 4 different letters, then all of the columns must have only 2 different letters (and the same switching rows and columns).

        Then, suppose that row i has 3 different symbols. As no two consecutive letters can be the same, we can guarantee that there is an index j such that si, j - 1, si, j and si, j + 1 are pairwise different. Also, as {si, j - 1,  si, j,  si + 1, j - 1, si + 1, j} = {si + 1, j - 1,  si + 1, j,  si + 2, j - 1, si + 2, j} (= {'A', 'C', 'G', 'T'}), it must happen that the letters in si, j - 1, si, j are the same as those in si + 2, j - 1, si + 2, j. Analogously, {si, j, si, j + 1} = {si + 2, j, si + 2, j + 1}. Since si, j - 1 ≠ si, j + 1, from our construction, in order to accomplish these two equalities si, j = si + 2, j, and thus, si, j - 1 = si + 2, j - 1 and si, j + 1 = si + 2, j + 1. You can continue this argument for the whole row, and discover that row i and row i + 2 are the same. Using induction, every row j such that i mod 2 = j mod 2 must be the same.

        But then, every column repeats characters every 2 steps, as we wanted to show.

»
6 years ago, # |
  Vote: I like it +53 Vote: I do not like it

The problems were very good! Fantastic! Thank you for great contest!!!

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Nice to hear, thanks

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Why did this post get so many upvotes ? I get it, the contest was awesome but anybody could've commented that...

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anyone share their approach to E? Also, for div 2 F, I think the solution would be dfs-based, at each step finding how many cookies can be eaten if Mitya ends the game at that point. Can someone confirm this?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    Yes that's right if we sort all cookies from root to node v, we want maximum x such that the first x cookies cost is smaller equal to T — 2 * (sum of all edge from root to v). We can do it with segment tree and after that in every move (except root) Mitya goes to the second child (by amount of its dp) and we can find the answer.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Hey..could you elaborate further on how to find the maximum x using segment tree? The remaining solution is clear.. Thanks!

      • »
        »
        »
        »
        6 years ago, # ^ |
          Vote: I like it +5 Vote: I do not like it

        For each node save number of cookie and sum of cookie and determine that go to left node or right node plus number of left node cookie.

        My code :48007201

»
6 years ago, # |
  Vote: I like it -29 Vote: I do not like it

Horrible, misleading problem statements!!

»
6 years ago, # |
  Vote: I like it +26 Vote: I do not like it

In problem Div1D, don't you have to dynamically keep the Huffman tree in order to answer the queries, or is there an easier approach?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You can change it to just insertions and undoes with the dynamic connectivity trick. However I don't see how to do undoes without persistence, which would definitely TLE.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +7 Vote: I do not like it

    Sort the numbers. Calculate the partial sum. At first, set ans = cnt-1. Then, for each i reduce ans by one if a[i] > partial_sum[i-1]*2. This can be done with a segment tree because the number of such cases is at most lg(1e9).

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    I passed pretests with this idea:

    sort all numbers in ascending order, count how many numbers such that they are bigger than twice the sum of all previous numbers, let this count be K and N is total number of numbers, then the answer is N — K.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +18 Vote: I do not like it

    There is an observation, that the result is #fishes - #(fishes which are more than 2 timesheavier than all fishes lighter than them (after sorting)).

    Next observation: is some fish can decrease the result by one, it is a result of a lower_bound operation for some power of 2. It helps easily find fishes which can decrease the result.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +14 Vote: I do not like it

      Yeah, once you figure out the observation, it’s easy.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +10 Vote: I do not like it

      How did you prove 1st observation ??

      • »
        »
        »
        »
        6 years ago, # ^ |
          Vote: I like it +105 Vote: I do not like it

        I don't prove, I code :P

        • »
          »
          »
          »
          »
          6 years ago, # ^ |
            Vote: I like it +5 Vote: I do not like it

          Then, where did you come up with that from?

          • »
            »
            »
            »
            »
            »
            6 years ago, # ^ |
              Vote: I like it +3 Vote: I do not like it

            I guessed/observed that they should eat themselves from the smallest ones. What happens when second smallest fish after eating the smallest fish becomes greater than the third smallest fish? The order is distorted, but the intuition is, that because of that the fishes became very close to each other, so now I will be able to do many dangerous fights (until the situation with much greater fish happens, because then for sure I won't be able to do the dangerous fight).

        • »
          »
          »
          »
          »
          6 years ago, # ^ |
            Vote: I like it +13 Vote: I do not like it

          what do you do when you get WA in this case? I mean how do you tell whether it's a bug or wrong observation? :P

          • »
            »
            »
            »
            »
            »
            6 years ago, # ^ |
              Vote: I like it +5 Vote: I do not like it

            It appears he never has bugs:))

            • »
              »
              »
              »
              »
              »
              »
              6 years ago, # ^ |
                Vote: I like it +7 Vote: I do not like it

              apparently he never make wrong observations too :D

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

went for overkill on DIV2D with hld and still WA

»
6 years ago, # |
Rev. 2   Vote: I like it -82 Vote: I do not like it

What a great contest!!

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Was O(QlogQlog109) supposed to fail in D1D or only my implementation has a too big constant?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I passed pretests with such complexity.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      :(

      Maybe the 3000 ms TL was too high then. :/

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Your implementation has a very bad constant. We have java solution which uses less than 1,3 seconds in all tests

»
6 years ago, # |
  Vote: I like it +10 Vote: I do not like it

Why would Div1C be excluded and not being used for problem F of Div.2 version, instead there comes a new problem in place of this? :O

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    I guess they just had too many problems (because they were doing this as a class work) and wanted to include all of them.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it -18 Vote: I do not like it

      It was no a classwork. We just thought that div2 is too easy for div1 and we didn't want to give our div1 for div1 because it can be too hard for them, and we wanted to give for div1 more problem there you need to write not very simple code, so we decided to put it there

»
6 years ago, # |
  Vote: I like it -7 Vote: I do not like it

Most contests are imbalanced these days :'(

»
6 years ago, # |
  Vote: I like it +4 Vote: I do not like it

problem D was very nice :DD , how to solve Div2E ?

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

HELP,

what is pretest 4 for the ACTG problem?

»
6 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

what is test 14 in Div2 D ?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    n=7 p[i]={1 2 3 1 5 5} s[i]={1 -1 2 -1 -1 5 5} ans = 6 a[v]= {1,1,0,0,4,0,0};

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Very great contest for non Div-1 coders like me. I particularly liked the gradient of submissions and the Div2-D problem. Ideal contest to increase rating for a graph lover like me.

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

what is test 4 in div2 F?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Mine was reading the statement again "The total time , including the descend and ascend". I don't know if yours failed from the same cause;

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It was just a random test

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Does anyone know what was pretest 16 for Div2D?

  • »
    »
    6 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Answer needs to be long long. Explanation : s[i] <= 10^9. Sample case : 5 1 1 2 3 1 -1 -1 10^9 10^9

»
6 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Isn't it a O(n) solution(Div2 B)? 48005949. If so, why did it pass a test n = 1e9?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    May be 1e9 was not part of the pretests

  • »
    »
    6 years ago, # ^ |
    Rev. 2   Vote: I like it -7 Vote: I do not like it

    It should be possible to do about 1e9 cpu instructions in less than a second.

    So it can fit into a 1e9-for if the constant is small enough.

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

is Div2 F binary search? I was trying to check whether it is possible to eat x cookies, but couldn't succeed.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    No. We don't have a solution, using binary search, it is just dp with data structures, you will be able to read it in editorial soon

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      alexey_kuldoshin fugazi I do have a solution with binary search. BIT+binary search. submission

      • »
        »
        »
        »
        6 years ago, # ^ |
        Rev. 2   Vote: I like it +3 Vote: I do not like it

        Oh, ofcourse you can do fenwick + binary search, but u don't need binary search here! U can use binary lifting!) Your complexity will be nlogn but not nlog^2, and fenwick with binary lifting was our main correct solution

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I used Binary Search with Segment Trees too, cuz why bother

»
6 years ago, # |
  Vote: I like it +11 Vote: I do not like it

That moment when you solve E 5 minutes before the end of the round but yiu cant submit it because you have the worst internet connection in the universe :( :( :(

I fucking hate my life :( :( :( Hope its not correct :( :( :(

»
6 years ago, # |
  Vote: I like it +118 Vote: I do not like it

The problem setter of Div1E should stop creating problems.

»
6 years ago, # |
  Vote: I like it +62 Vote: I do not like it

My screencast will be available here after it finishes processing: https://youtu.be/WR9rMvE-d9Y

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

C felt so empty :(

A how could initial height be 1 if we have two rocks.. and calling the second rock "second rock" doesn't that mean the first one is heigher but that wasn't mentioned.

sadly I'm not good in graphs to try D .

  • »
    »
    6 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    if you had examined the sample inputs you would have noticed that wasn't true (for A).

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      that's called invalid input and they should not do tricks here

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Is there a specific reason why integer overflow hacks didn't work on this contest? A person I tried to hack used int everywhere, but somehow his submission in C++11 managed to print 3000000000. Is the int limit bigger than 2^31-1? :O

»
6 years ago, # |
  Vote: I like it +5 Vote: I do not like it

i got the #victoryroyale on this contest

»
6 years ago, # |
  Vote: I like it +35 Vote: I do not like it

Let me ask. Is F just a HLD on a suffix tree with segment tree with operations like "do x[i]=x[i]+1 on the interval" and "get sum of x[i]*a[i] from the interval"? I think that I was close, I had tree and HLD already but the fact that we have to do queries in a middle of an edge defeated me and I run out of time.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +31 Vote: I do not like it

    I don't know how to do it with 1D queries, our solution have sweep line at each heavy path...

»
6 years ago, # |
  Vote: I like it +12 Vote: I do not like it

cool picture in div2F

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Is there anyone solve Problem C (div.2) with DP ?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes I do; 1 line typo .. BAAM!!

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    yes, I did but unfortunately wrote 'n' instead of 'k' in the inner loop and not even a single pretest had k>n case.
    AC solution after the contest: submission

»
6 years ago, # |
Rev. 3   Vote: I like it +1 Vote: I do not like it

How to solve Div2 F?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it
  • »
    »
    6 years ago, # ^ |
    Rev. 4   Vote: I like it +1 Vote: I do not like it

    We can solve this problem by using minimax + greedy and segmentation tree. Assume we are at some node u in the tree, then we have remaining time = T - 2 * sum_l, where sum_l is sum of l over all edges from root to current node u. Now we can use a segmentation tree to greedily eat as many cookies with our remaining time from min. time required per cookie to max. time required per cookie for cookies on path from root to u. This segment tree has a leaf for each possible value of ti (so 1...1000000), and stores per interval total cookies in the interval and total time required to eat all cookies in the interval. When we arrive at node u, we add x[u] cookies to all intervals t[u] lies in. When we backtrack from u, we remove the x[u] cookies. Vasya always cuts the edge that leads to the best result, but in the root Mitya can choose an edge before Vasya is allowed to cut. This solution is O(N log 1000000). Corresponding code: https://codeforces.me/contest/1099/submission/48030249 .

»
6 years ago, # |
  Vote: I like it +33 Vote: I do not like it

Just curious, why is div2 F not available in div1?

»
6 years ago, # |
  Vote: I like it -18 Vote: I do not like it

Was this round unrated?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    No it was rated, but ratings will be updated later.

»
6 years ago, # |
Rev. 2   Vote: I like it -13 Vote: I do not like it

My solution for the problem C was shown as "accepted" but then after the contest, they realised I had a wrong answer? Like.. How is that allowed!!?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +157 Vote: I do not like it

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +52 Vote: I do not like it

    To give a serious answer:

    There are pretests for the contest, where you will be given a particular verdict (in your case, Accepted). Afterwards, the submissions are run on a more thorough set of test cases, where the real verdict is made.

    There are a few reasons for this – one is that it lightens the load on the servers to only run the submissions on <20 cases, as opposed to ~100. Another is that it allows for "hacking", where you can look at other people's submissions for a problem that were accepted on pretests but have a bug in them, and create a test case that exposes the bug. All the successful test cases created from hacking are added to the total test case suite that runs after the contest. This is pretty beneficial to problem setters, because it can be difficult to think about the wrong solutions that will be made, and the corner cases that must be created to expose the bugs in the wrong solutions. The hacking system essentially crowdsources the creation of thorough test cases, making a more accurate problem for everybody.

    Failing on system tests is, unfortunately, part of the game here. On the bright side, it could be worse: Some contests, like Topcoder and Facebook HackerCup don't run your code on any test cases until after the contest is over.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +26 Vote: I do not like it

      actually verdict is "pretests passed" that should give one some hint

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Is it only me or somebody else also who was expecting a higher rating change? Rating Predictor is showing +162 but I got just +73 whereas my friends' ratings changed as per shown in rating predictor.

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

For those who are afraid of precision errors.. Div2-B Solution

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Can you explain it,please

    • »
      »
      »
      6 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      We begin with a single square and then add more squares gradually. let a[0] and a[1] be the length and width(so both are 1 initially) Now, each time I'll pick the smaller of the two(which is a[0] since it is sorted) and increment it by 1(i.e. add one more segment to it)..with this extra segment drawn, I'll be able to complete a[1] more squares using this new segment as guide. Stop when at least n squares are drawn(i.e. while cur<n).

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +13 Vote: I do not like it

      always put a space after a comma.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Or just notice that solution can only be 2*sqrt(n),sqrt(n)+sqrt(n)+1 or 2*(sqrt(n)+1).

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      How you proved it?

      • »
        »
        »
        »
        6 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Optimal solution is to have sides (horizontal and vertical) as much as equal as you can. If you have x horizontal lines and y vertical, then number of squares formed is x*y. So square root minimize number of lines needed.

      • »
        »
        »
        »
        6 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        how did you prove it?*

        • »
          »
          »
          »
          »
          6 years ago, # ^ |
          Rev. 2   Vote: I like it +22 Vote: I do not like it

          H ow did you prove it? *

          (Every sentence starts with a capital letter.)

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      Or just check sqrt-20 to sqrt+20 :)))

      Code: 47977441

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

How to solve Div2 D???

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Hint: the best S[i] for some unknown node is the minimum S[j] of its children, or the same of its parent if it has no children. After figuring out the optimal S[i] for every node, you can restore the original A[i] for each node.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Spoiler
»
6 years ago, # |
  Vote: I like it +16 Vote: I do not like it

Editorial?

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

editorial?

  • »
    »
    6 years ago, # ^ |
    Rev. 4   Vote: I like it 0 Vote: I do not like it

    It's here

    UPD: Oh... It's not translated yet.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it -19 Vote: I do not like it

      yeah you know what about writing it in English in the first place like a normal person not in your language that no one cares about

      • »
        »
        »
        »
        6 years ago, # ^ |
        Rev. 3   Vote: I like it -20 Vote: I do not like it

        Considering Codeforces owners, authors of this contest and a huge part of this community are russians, I think your trolling sucks.

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I did'nt get the problem statement of div2-B, can anyone pls elaborate it.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    here -> Visualized solution. Solution : -find the first number square num_sqr , which is bigger then n. -if n > (num_sqr — sqrt(num_sqr), print 2 * sqrt(num_sqr) — else print 2 * sqrt(num_sqr) — 1

»
6 years ago, # |
  Vote: I like it +12 Vote: I do not like it

Where is the editorial?

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

when editorial will come ??

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

As the editorial is not published till now can somebody tell how to solve div2E and div2F?

»
6 years ago, # |
  Vote: I like it -13 Vote: I do not like it

is it rated?

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I love that contests are being held so often now :) I am learning a lot of things thanks to that , I have high hopes that it will keep going this way !!!!

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    i don't think so lul

  • »
    »
    6 years ago, # ^ |
      Vote: I like it -9 Vote: I do not like it

    you do not need to put a space between the last word in your question/sentence and the question mark/exclamation mark.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +40 Vote: I do not like it

      Every sentence starts with capital letter.

    • »
      »
      »
      6 years ago, # ^ |
      Rev. 3   Vote: I like it -7 Vote: I do not like it

      I appreciate your work, grammar.nazi. But I think you're in a wrong place. It's a community of Programming/Programmers. People type their comment here to express their idea. So, grammar doesn't matter here that much. People may learn many sides of grammar and be aware of grammatical mistakes but it's kinda disturbing. I think you'll get a bunch of downvotes every time you try to correct people's comments (I upvoted your reply). Don't mind.

      [Sorry that my reply may also have some grammatical mistakes. (I'm not a native speaker of English and I think many people aren't too.)]

      • »
        »
        »
        »
        6 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        The account was created for the sole porpuse of trolling so please do not encourage him.

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

is there a DP approach to solve C?

»
6 years ago, # |
  Vote: I like it +1 Vote: I do not like it

When is the editorial translation going to be here?

»
6 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Is there some one know the link of this problem: given a string, and some query [l,r] find the maximum i such that s[l,i]==s[r-i,r]... I'm pretty sure it is in codeforces gym thanks

»
6 years ago, # |
Rev. 3   Vote: I like it +18 Vote: I do not like it

I have a sol to solve problem F:

first we can solve the lcp[i,l] l<=i<=r not consider the bound of r restriction.

then we can try the minus old and add new value of point i s[l,l+i]==s[r-i,r].

we can solve first question by sweepline the increasing order

of rank[l], and build 2D segment tree, it can be solved

by O(n*lg(n)^2)

then we consider to find point s[l,l+i]==s[r-i,i].

there is a problem in gym find the maximum i, if we

got maximum i, then we can got sec maximum j that

s[l,l+j]==s[r-j,r] so we can get it is a repetition of s[r-i,r-j-1]==s[r-j,r-j+i-j-1].....it is a arithmetic progression

we can find the next bound of this arithmetic progression by O(1) and this number of segment is not bigger than log(n) with small constant factor

»
6 years ago, # |
  Vote: I like it +22 Vote: I do not like it

What a great contest!!

»
6 years ago, # |
  Vote: I like it -36 Vote: I do not like it

Such shameless authors , nearly 25 people involved in the round and still no translation for the editorial. I think this affects not only the authors but also codeforces's reputation.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +50 Vote: I do not like it

    We sincerely apologize for the delay with the English version of the editorial. It's now available (link).

    However, before writing offensive & demanding comments, please understand that yesterday was the last day of the camp, and all of us needed to travel really long way home. Quite obviously English is not a mother tongue for any of the high-school students who prepared the round, and it takes a lot of time to write something readable.

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I AK IOI. I AK ACM World Final. I AK Universe OI. I hangbeat tourist. I'm txdy.

»
4 years ago, # |
  Vote: I like it +2 Vote: I do not like it

.