KADR's blog

By KADR, 7 years ago, translation, In English,

Hello everyone!

Codeforces Round #153 will take place on Thursday, December 6th at 19:30 MSK. This is my third Codeforces round and I hope there will be more.

I'd like to thank Shtrix, Seyaua, sdya and Gerald for helping me to prepare the round. Special thanks to Delinur for translation of all problem statements into English.

I hope you will like the problems.

Good luck and have fun!

UPD: Complete version of English editorial is now available.

Congratulations to the winners!

Division 1:

  1. Egor
  2. tourist
  3. rng_58
  4. kelvin
  5. Burunduk1

Division 2:

  1. inker
  2. dslovemz
  3. memo1288
 
 
 
 
  • Vote: I like it
  • +173
  • Vote: I do not like it

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

All that red color suggest a hard contest :)

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

    I guess that not hard but interesting :)

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

      Thx for negative votes :D

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

        You're always welcome)

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

          It's better to not write anything :)

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

            It looks like NiVEr is trying to reach a new low of negative comment rating and he's doing a pretty good job at it. :)

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

          OH MY GOD IT'S THE BEST JOKE I'VE HEARD!!!!)))))

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

      Hope so :)

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

    This was discussed a short time ago: http://codeforces.com/blog/entry/5975

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

    JOIN THE ILLUMINATI illuminati.order100@yahoo.com JOIN THE ILLUMINATI FROM SOUTH AFRICA, USA, OR ANYWHERE IN THE WORLD TODAY BE RICH, FAME, AND POSSES POWER.email us on illuminati.order100@yahoo.com for immediate initiation New members registration is now open online now !!!!! BENEFITS GIVEN TO NEW MEMBERS WHO JOIN ILLUMINATI. A Cash Reward of USD $300,000 USD A New Sleek Dream CAR valued at USD $120,000 USD A Dream House bought in the country of your own choice One Month holiday (fully paid) to your dream tourist destination. One year Golf Membership package A V.I.P treatment in all Airports in the World A total Lifestyle change Access to Bohemian Grove Monthly payment of $1,000,000 USD into your bank account every month as a member One Month booked Appointment with Top 5 world Leaders and Top 5 Celebrities in the World. If you are interested call the agent now send your e-mail to illuminati.order100@yahoo.com for immediately initiation.New members registration is now open online —

    E-mail via illuminati.order100@yahoo.com

    JOIN THE ILLUMINATI AND GET RICH AND POSSES POWER''''

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

AT LAST !!

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

Hac in hora ... Et defectus

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

I have to go to school on Dec.7 Maybe i can't do this.

T T

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

yeees!Can you make more contests,please?It's boring when there's nothing on codeforces...:)

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

Are the scores of the problems decided? edit: Sorry, I was not asking for the scores of the problems, but if they will be static or dynamic :)

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

I think contest had better be arranged in Friday or Saturday,in that case more people can compete in contest.

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

    No it wouldn't be better because we would had to wait more. Everyone is getting bored from waiting.

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

Let's hope the server will stable during competition

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

    Let's pray for the welfare of the server. 42. Amen.

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

Seyaua, sdya are the same person ! :D ****

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

I think it has been long since last competition. Thanks for all the contests and their makers, I really enjoy myself in the contests!

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

Good Luck Everybody!

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

Good luck everyone!! Have fun!! :D:D

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

Was I the only man who had "error 502" now?

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

There is one thing that I will never forget about this contest

There's only one thing Petya likes more than numbers: playing with little Masha.

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

Little Petya likes "a lot of things" a lot :D

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

    Sometimes you get a mistake, the author is the same :D Sorry for my bad english :p

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

I solve problem B of Div.1

then lock my answer

and go hack two contestant with same Test Case

but unfortunately when i checked my hack TC too my code , I saw my solve give WA too :|

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

What was the challenge case for Div 1 Problem B? No one did many challenges in my room, so my solution could be wrong :( .

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

    2 3

    2 1

    2 1

    Answer: NO

    3 3

    2 3 1

    3 1 2

    Answer: YES

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

      Now that someone tells me, I'm scared of testing my code on it...

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

      My code managed to pass those tests. Do you mind sharing what test you used to hack me?

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

    Something like

    4 7

    2 1 4 3

    2 1 4 3

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

    1 1 1 1

    Answer NO :)

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

    I think if there was no challenges, it would be a lot of WA. This task checks contestant's attention.

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

Very slow system testing :(

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

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

Are the solutions being checked manually?

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

    Seems that they put too many test cases in Little Xor.

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

Sooooo slow system testing :(

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

The problems are harder and harder?T T need to work hard^ ^

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

    Sorry to say but it's easier than the last contest :)

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

Unlike Codeforces Round #152, this contest has a very low speed system testing... :(

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

Everybody seems to get WA in test case 12 in Div 2 -problem B. I wonder what that test case is ?

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

    I guess a case with n<3.

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

      I think many people think that "-1"'s case is only on n <= 2 and all array fill whit the same number. if N = 3 and array is {2, 1, 2} we can't do any swap.

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

    You can see this test case after the contest.

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

System testing has already lasted 20 minutes, but checked solutions of first 15 minutes of contest, that's amazing speed:)

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

why you need that too many test cases !!! :o

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

very slow test system(((

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

Seems strange, but I think Problem B was harder than Problem C. Problem C was quite standard, and non-standard problems cause much more trouble for the competitors:)

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

    It is so bad of me that I even did not check the tricky case that I generated for Div 2 B.

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

Thank you for really nice problems and amazing contest :)

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

Here is my solution to problem B div 1: http://codeforces.com/contest/251/submission/2710934 The veredict was: "Runtime error on test 1". But I tested the same test in my computer with the same code and it worked fine. Has anyone had this problem?

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

For Problem B ,Div 2 , an O(n^3) solution is also passing [code]

I noticed through the test case that it is actually never going O(n^3) when all elements of the array are not the same and when n is large . But I can not understand why this happens .Can anyone explain please

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

    I think it is misleading, if we consider n <= 10^5 how is it possible that O(n^3) would pass? Well I guess that the swapping which leads to unsorted array is found quite fast and that is why a solution with such big complexity passes. Because otherwise also O(n^2) would be difficult to pass in that time lime.

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

    The complexity of this solution is O(N).

    Suppose N > 3. Then it's enough to check only 3 different pairs of distinct integers. One of them will be the solution we are looking for. The reason is that these 3 pairs lead to 3 different arrays, but there are only 2 possible sorted arrays, so one of these 3 arrays will be unsorted.

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

.. . How to solve Problem E. ? ... QAQ

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

    I'll post the complete editorial in a few days. Now I can give you a hint.

    Suppose there exists a node of degree 3. Let's take any such node and call it a root. Then we can reduce our problem to the following one: given a non-root node v we need to calculate the number of ways to place the sub-tree of node v on a rectangle 2xK for some K with the restriction that v is placed to the upper-left corner of this rectangle. Note that the value of K can be determined uniquely from the size of sub-tree. This problem can be solved with DP in linear time.

    The reduction to the described problem is also non-trivial, but at least it's easier than the whole problem.

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

      。。。THX alot !...

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

      editorial in English too, I hope? Google Translate doesn't work well sometimes.

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

How to solve problem D div 1 ?

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

Can anyone show me the logic in choosing 0 (numbers that divide lcm(2..k)) to be the mediate value in problem C div 1?

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

    In case you misunderstood my words (I assume that by seeing those down votes), this is merely a question :)

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

Anyone can tell me how to solve C div 1 :( Just a hint, plz :D

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

    The essential trick was that if your current integer is divisible by all numbers from 2 to k, then the only thing you can do is to decrease this integer by one. Therefore, you can use dynamic programming to count how much time you need to reduce your integer by LCM. For instance, suppose a=80, b=3, k=3. Then LCM(2,3)=6. So you count separately the time you need to get from 80 to 78, then from 78 to 72, the from 72 to 66, ..., from 12 to 6, and finally from 6 to 3. It's easy to notice that all of those in the middle are equal.

    P.S. That's a shame that I didn't see this trick during the contest, but I was thinking of some DP with LCM...

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

      Then LCM(2,3)=6

      2 what ????

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

        I don't get your question. LCM(2..k)=LCM(2,3)=6.

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

          Sorry, I already understand your answer :D Okay :D thanks for your hint :)

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

Fail (( My solution in D(div2) was correct ... I just forgot to clear my array ...

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

Editorial is published in Russian here @ http://codeforces.com/blog/entry/6054

I wonder if it is possible for someone to please kindly translate that into English for me?

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

Where can i see the editorial?

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

Are there any editorial?

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

    only published in Russian, I'm afraid.

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

      I'll publish the complete editorial on both languages soon. Currently I'm out of country and don't have enough time for editorial. Sorry for the delay.

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

I can't understand the Russian tutorial of Div.1 E. >_< I hope the English tutorial will be published soon. :)