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

Автор atoiz, история, 6 лет назад, По-английски

(Translation: Hello)

We are very happy to invite you to take part in our contest, Codeforces Round 666 (Div. 1) and Codeforces Round 666 (Div. 2). The contest starts on 30.08.2020 17:35 (Московское время) and lasts 2 hours. In both divisions, there will be 5 problems for you to solve.

The problems were authored and prepared by ruanxiaoyu, DatVu, MofK, and me.

We are very grateful and would like to sincerely thank the following people for their assistance in preparing the round:

Finally, we would like to thank all of you for participating in the contest!

We have spent many months to brainstorm ideas, ended up discarding most of them, and finally chosen our best ideas to compose together this contest, so we hope you will enjoy our round! (and hope the Devil's Number won't haunt our round XD)

Good luck, have fun!

The score distribution will be announced later.

UPD1: Here is the score distribution:

Div. 1: 500 — 1000 — 1750 — 2250 — 2500

Div. 2: 500 — 1000 — 1250 — 1750 — 2500

Hope the long queue disappears soon :'(.

UPD2: Congratulations to the winners:

Div.1

  1. tourist
  2. Radewoosh
  3. aid
  4. ksun48
  5. Um_nik

Div.2

  1. chokottodake
  2. The_Noble_Brahman_Bison
  3. mickey639
  4. matt64
  5. Kai29

We apologize for the late editorial. Anyway, here it is: Editorial

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

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

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

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

As a Maripium fan, I want to start an orz chain.

Maripium orz.

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

Will this contest be Lucifer themed?

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

I tested this round when I was blue!!! xD

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

As an author of Round 666, I just want to say that right now I have exactly 666 friends on Codeforces!

Edit: Wow, it lasted a whole 3 minutes! Now I have 667...

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

OMG!!!! 666 round, so scared!! OMG

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

♫ 666 the Number of the Beast
Sacrifice is going on tonight ♫

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

WOW! palindrome round.

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

What’s devil’s number?

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

300iq seems like having an Asia tour on Internet and now he is arriving at Vietnam.

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

Others: " I know coding "
LGMs: " Coding knows me "

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

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +76 Проголосовать: не нравится
  1. $$$666 = \sum\limits_{i=1} ^ {36} i$$$
  2. $$$666\times 69$$$ is a palindrome.
  3. Look at my profile picture. I also recorded a video of it happening.
»
6 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +9 Проголосовать: не нравится

5 problems and div.1 & div.2 looks like round is going to be tough.

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

hope pretests passed => main tests passed

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

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

rip Devil

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

six six six

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

six six six, nice round, :) from VietNam with love <3

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

How many languages does 300iq plan to master?

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

atoiz orz

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

Wow Rated contest after a long gap,Contest is seems to be very Interesting...

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

Hope for strong pretests.

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

This is the last contest I can play before school starts. (T_T)

Then I will become Candidate Master!

QQ图片20200829125713.gif

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

me when i see the image: chrome translate can translate image ???? :D ???? what is going on ????

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

Ya, From VietNam with Love. Good luck to the contest and for all

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

excited for vietnamese contest

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

húuuuuuuuu!!!!!!!!

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

If this round isn't DOOM themed I will lose all hope in humanity.

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

What is codeforces Round X? is it a new type of round?

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

    I think it implies that the date is decided for the contest but they still don't know if there will be additional rounds before that round, hence they have just named it Round X for the moment. If you see there is 18 days gap between Round 669 and Round X and most probably more rounds will be added in those 18 days gap, hence the name X.

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

I hope to get the 666th place :)

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

Here it is! +666

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

Why score distributions are announced later? I don't know the reason. Can anyone tell me?

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

Again,the long queue issue ..Waiting my solution to be executed...[user:MkeMirzayanov] Please look into it

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

Is the codeforces queue long just to make it feel like a bad omen?

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

Hope your first contest will not be ruined by the long queue issue. I have submitted a solution one hour ago and still, it's in the queue. Hope it will be solved before the contest.

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

Looks like problems from hell.

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

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

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

The queue disappeared!

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

Score distribution looks very scary.
B and C have difference of 250 points only
This indicates two types of round
1. Speed-forces
2. The hard one or unbalanced
Fingers crossed....

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

round-666 will be my 66 contest :D

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

Queue disappeared :) All the best everyone for the round.

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

To do well in this contest you have to listen to Iron Maiden not TWICE :P

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

Hakuna Matata!!

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

I had already got a correct answer in B at 34 minutes , I resubmitted now and it also passed but my timing has been updated according to present timing. PLease look into this

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

Is there a way to find the number of pretests in a problem?

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

Reading E is so fun. haha

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

This really is a cursed round

Upd: I had insane skill-issue at the time. My bad : )

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

After this round, I hate 666.

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

finally some interesting problems i love it!!

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

We have spent many months to brainstorm ideas, so we hope you will enjoy our round!

Duh

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

Pretests for B :(

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

Div1 C was really painful

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

    Agreed, statement was very long.

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

    The statement looked so painful that after solving all the other tasks in div2 I decided to quit without approaching it

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

    Disagree. The first impression was indeed painful, but the seemingly annoying parts disappeared quickly. Code is short and contains no strange special cases.

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

      Hmm, my code doesn't look that short. Maybe I'we just done things in a too complex way

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

      contains no strange special cases

      I'm very curious as to how you solved this problem, because my solution is case whack after case whack.

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

        Are the cases only on paper or in the code too? Now I'm kind of worried that I'll fail system tests.

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

          The cases are in my code, but I'm not sure if they're actually necessary or I'm just being a clown as usual.

          My code (apologies, I don't appear to know what line breaks are)
  • »
    »
    6 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +51 Проголосовать: не нравится

    I dare to disagree with you. I think Div1 C was a beautiful dp problem.

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

what is the pretest 4 of B.. Any guess ???

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

How to solve B?? Should we brute force all possible values of c and then find minimum cost??

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

How to solve D?

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

Approach for B?

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

    Sort the array in ascending order and find the two value of X(ceil and floor) for which pow(X,(n-1)) is closer to maximum value of the array. Let say you have an array [1,2,7] so the number whose (n-1)th power is closest to 7 are 2 and 3 (pow(2,2)=4 and pow(3,2)=9) now take these two values and iterate in the array and calculate what is the answer if we take 2 and if we take 3 and then print a minimum of these two.

    My submission 91391756

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

Nice problem, like this round

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

Please don't tell me that the constraints in D were so low only to confuse the heck out of me.

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

I feel like dumb after i fixed the bug for C that i was missing n = 1, just a minute before the contest. Really painful.

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

What is the logic in Div2 B

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

Div2 C was by far one of the most interesting observations used on an ad-hoc problem.

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

Let's hope the main tests pass :P

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

Could not solve even B this time :( Any idea on how to do it

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

I'm sorry guys, but Div1 C killed this round for me. The idea is straightforward, but dealing with all the details was too hard for me. Besides, I noticed that $$$r_1 \le r_2 \le r_3$$$ only 15 minutes before the end of the contest :(

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

Div2 B. Im trying to brute force. 1 < i < sqrt(max(list)) But I got TLE on pretest 4

How to approach it?

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

    I used ternary search on $$$c$$$. Passed the pretests.

    EDIT: No it doesn't work that way. My solution failed in the real tests. There could be local minimas too, and I didn't think of that.

    The correct way to solve it is to notice that you can not have a value for $$$c^i$$$ for any number greater than 2e9. (As you can always select $$$c=1$$$). So, if you have $$$n$$$ numbers then you can find the upper limit of the range of values for $$$c$$$. That is,

    $$$up^{(n-1)} \lt =2e9$$$

    . To be more careful, I selected 1e10 instead of 2e9. So I got up = pow(10,10.0/(n-1)). Now you can go from 1 to up, and keep track of the minimum abs diff.

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

    Sort the array in ascending order and find the two value of X(ceil and floor) for which pow(X,(n-1)) is closer to the maximum value of the array. Let say you have an array [1,2,7] so the number whose (n-1)th power is closest to 7 are 2 and 3 (pow(2,2)=4 and pow(3,2)=9) now take these two values and iterate in the array and calculate what is the answer if we take 2 and if we take 3 and then print a minimum of these two.

    My submission 91391756

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

What was the point of Div1C? It had a really long and complex statement, but once you understood what was actually being asked, it was easy and fairly uninteresting :/

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

I implemented Div2 C at last moment is this code correct or still it require something else!

https://ideone.com/HJ3kDp

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

    My idea is first we can make any possible number with two numbers whose gcd is 1. thus for each Ai I was trying to make -Ai. IN 2 operations by using n and n-1 length of segment in first 2 operations. In one remaining operation first remaining value was tackled by me separately thus a total of 3 operations!

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

Out of curiosity, did anyone manage to get pretests passed on Div 1 C using the +1 / +2 dp and running an exponential brute force at the end instead of handling cases?

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

Div2 C was nice :) took too much time to solve it

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

Looks like solving linear congruences a∗x≡b (mod n) was an overkill for C lol.

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

Devil fooled me with div2A

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

Someone, please explain B and C. In B I iterate over constant c until power(c,n) <= 1e18, and permutation I choose the sorted one.

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

Problems B and C gave me PTSD.

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

Could someone please tell what is the problem for my soln to B?

https://mirror.codeforces.com/contest/1397/submission/91418834

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

How to solve Div2 D ??

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

Some people complained that the pony round had long problem statements

Ha-ha.

Look at Monster Invader. That is how you write long statements

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

For correct solution, the timing is updated ,for incorrect it is not updated. Why the rule that the recent solved timing would be considered ?I solved Problem B nearly 30 min from the contest and then at last just to conform ,it resubmitted it with a small change so that it does not fail system test and it updated my timing. Why not make it something like If the first correct attempt fails, then the next one is considered. Also for who are new to codeforces at least the link of the rules could be included in the contest posts.

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

I've written a fairly straight-forward brute for B.

Could someone tell, if i'm missing something? Solution Failing on TC3

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

Was I the only one to not attempt Div-1 C seriously initially considering its low number of submissions in the beginning?

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

Who else skips a heart beat when you go to the Dashboard during system tests and you see RED on your problems? (and 1 second later realize/remember it's just the bad attempts).

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

Although I couldn't solve C, looking at its solution, I can say it's a pretty cool ad-hoc problem.

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

problem C: Help Dora to find all the ways to beat the level

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

I misunderstood Problem B and tried solving it taking into consideration a different c for each a[i]...

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

Please, A quick editorial

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

Weak pretests = Many hacks = (Actually not super) long systest queue($$$3$$$ pretests, $$$60$$$ systest for $$$A$$$...)

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

Anyone interested in hacking my code, Here's the testcase : 3 1 1 1

Weak Pretests guys :(

»
6 лет назад, скрыть # |
Rev. 9  
Проголосовать: нравится +123 Проголосовать: не нравится
D2A
D2B
D2C/D1A
D2D/D1B
D2E/D1C
  • »
    »
    6 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    IN div2 B I calculated (n-1)th root of largest element ad tried from 1 to that value plus 2.whats wrong with that. I also sorted the array to calculate the cost.

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

      It is possible for the largest element at the end of the process to be much, much larger than the largest element at the beginning. See my comment above.

      In addition, be careful about overflows.

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

      For B : Sort the array in ascending order and find the two value of X(ceil and floor) for which pow(X,(n-1)) is closer to the maximum value of the array. Let say you have an array [1,2,7] so the number whose (n-1)th power is closest to 7 are 2 and 3 (pow(2,2)=4 and pow(3,2)=9) now take these two values and iterate in the array and calculate what is the answer if we take 2 and if we take 3 and then print a minimum of these two.

      My submission 91391756

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

    For D2C/D1A we can also use one operation of length n, subtracting n*a[i] from all elements for 1 <= i < n and adding 0 to the last one. Then one operation of length n-1, adding (n-1)*a[i] (initial value of a[i]) to all elements for 1 <= i < n. The last operation will be of length 1, applied to the last element, subtracting it from itself. (And the case with n=1 should be treated separately with any approach. For example subtract the only element from itself in one operation, then add 0 in the subsequent two operations.)

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

tourist exorcised the devil.

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

Am I the only one really bothered by Div1 C statement?

If Ziota damages the boss but does not kill it immediately, **he** is forced to move out of the current level to an arbitrary adjacent level [...]. Ziota **can also** choose to move to an adjacent level

At first, I thought "he" referred to the boss, who would flee if not killed. This was enforced by the next sentence (the boss is forced to do something. Ziota can also choose to do it).

The wording in the sample is also unhelpful:

forced to move to either stage four or two, here we move to stage four

We? Ziota was in third person singular throughout the problem statement, why use "we" now? Ziota and the boss?

The statement is "correct", but these things get hard to read if you're not a native speaker and are reading in a hurry during the contest. Why not use the character name?

After re-reading the problem many times I submitted a suggestion the change the use of "he" for the character name, which got "No comments". I wished it could have been updated, so at least others wouldn't spend time figuring this out.

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

    Well I only read the problem and I did not read it your way. I think it's about computer games logic, and that's why it passed through all the testers... For some reason you assumed in your head that Ziota is the feared, all powerful being, but that's usually the boss.
    If you are playing a game and you reach a super strong boss that kills you with ONE SHOT, and you miss a shot (or hit but not kill), who runs away afraid? you or the boss?
    Usually all you do is run and dodge while the boss attacks...

    (I literally imagined teleporting between worlds making a single shot and continuing to teleport. I have a clear vision of this computer game in my head LOL)

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

      Having a 1 HP boss run behind other small enemies isn't that unreasonable. And again, during the contest it's easy to misinterpret the statement if it's a bit ambiguous and you're not a native speaker. I don't see why they wouldn't change it

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

what is meant by reorder in question B??????

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

My solution to Div2 C was to just simulate every player choosing pile with max number of stones (among available ones).

I'm still not 100% convinced, but it passed pretests (soon I will see if it passes the main tests).

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

    I used this solution as well. Looking at others' solutions, it seems that another approach is to say that player 1 wins if there is a pile with size at least all other piles combined, otherwise determine the winner by the parity of the total amount of stones. I believe it can be shown that the two approaches are equivalent.

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

    I think the idea is that a player can claim "ownership" of a pile because if the only take from that pile, the other player can never take from it due to the rules. So, if a player takes from the non-largest pile, it could lead to a situation where the largest pile > sum of the other piles.

    So if a pile > sum of the other piles (this must be the max pile), take from that pile. The other player can never take from that pile. Otherwise, never make it so that the max pile > sum of the other piles, which you can do by always taking the max pile. Then it just comes down to parity.

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

      But how to prove that if sum of the max pile is less or equal to other piles combined "HL" will always win?

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

        HL won't always win, it depends on the parity, you can prove it by induction.

        Suppose we have $$$x$$$ stones for some even $$$x$$$ and that the max pile is not bigger than all the others combined. If $$$x = 0$$$, the proposition holds trivially. Assume, by induction, the proposition is true for all arrangements with $$$x - 2$$$ stones. Then, no matter which pile T chooses, HL can always choose another one such that the (possibly new) max pile is not bigger than all others combined. Moreover, after this we'll have $$$x - 2$$$ stones. By the induction hypothesis, HL wins.

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

What is the approch for div 2 B

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

    We can simply try all possible numbers for C.

    This is possible since if n is big, there are only very small numbers for c possible, and if n is small we can actually try all possible C. (max sqrt(1e9), ie 1e5)

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

    Find (n-1)th root of the maximum value in the array. This will be double type value so you have to add 0.5 and then take the floor of that so that value gets rounded off properly. This value is c for our array then calculate the sum of the absolute difference of a[i] and c^i for all.

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

    Start by calculating the score for c=1, it is the one that will certainly not overflow long long in any case. Then, taking larger values of c, the score may first decrease (this may be the case for small values of n), then increase forever after passing the minimum, or it can immediately increase (for large n even powers of 2 will already overflow), the score for c=1 being optimal. So iterate over c values starting from 2, continuing while getting answers smaller than the current optimum, and in the first instance when the current optimum is exceeded interrupt the search, we are past the turning point.

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

      I think that too might cause overflow. I came up woth a formulaa to find the upper limit upto which i should consider c. double x=pow((double)(arr[n-1]),(1.0/(double)(n-1))); ll st=floor(x+0.5); ll ans=LLONG_MAX; ll c=floor(pow(10.0,17.0/(double)(n-1))); for(ll i=1;i<=min(st+2,c);i++) { ... }

      this worked for me

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

      Suppose the previous_optimal is x and we are in the process of finding the current_optimal and current_optimal current value is < x. How can we be sure that the next value(candidate) added to the current_optimal will not overflow current optimal as if it will overflow current_optimal then current_optimal can be < prev_optimal after all the overflows.

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

I Think Div-2-B was pretty hard for newbi contestant like as me ☹️

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

Mastering puzzles is really necessary to be good at CP? Is it?

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

Anyone else solve Div 1C/2E without realizing r1<=r2<=r3?

OOPS

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

I wouldn't say this round is bad by itself, but I really expected something special prepared for #666

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

Found out that my A failed system tests because I wrote for(int i = 1... when I was supposed to write for(int i = 0.... Almost 500 points blown away for nothing :P

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

I know, for interview preparation, there is leetcode. But sometimes I wonder, will the problems in Div 2, like A,B,C, will they really help me in interviews, as they are just some tricks. You understand the trick, you get AC, else not. More of a mind game type. Can someone answer this?

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

(a + x * b) % n = 0 can anyone tell me what will be value of x (here b is prime) ??

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

Problem set was really good. Div2(C) was tricky and one of the best one.

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

How did you solve Task B?

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

How to avoid long queues? Answer: write a problem like B with like 5 pretests and run the contest

(yes I'm frustrated :p nice contest otherwise imo)

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

I felt humiliated by Div2 C

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

Anyone else who lost motivation to solve Div2 E just by seeing the size of problem statement?

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

Is #667 (Div. 3) going be rated?

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

Were pretests really weak today? Can't believe both A and B failed system tests.

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

Great contest..

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

Was it only me or n=1 troubled many in problem C ?

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

Great contest, problem setters! A question though.. Do you folks intentionally make weak pretests (for A in my case)? I'm asking this because, I made a substantial blunder in A, and somehow the pretests still passed for me(and then, it failed in system tests).

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

I have a wrong solution for Problem D. And it has got Accepted after system testing. 91418247

WA case:

1

2

1 15

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

For div2 B, how do you prove that simply sorting gives the best permutation?

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

    like consider the GP as 1,c,c2,c3 and the sorted araay be a0,a1,a2,a3.....an you will make ai-->ci else if difference of a(i+1) and ci is less than that of ai and ci then you have to transform ai to a much larger no. which will not be optimum. this was what i used and am not sure whether is correct or not.

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

    let's say you want to make your array to exist on a number line

    <------c^0---c^1----c^2--------c^(n-1)--> This is required array for a particular value of chosen c. Cool.

    Now lets say your array contains a1, a2......an-1. on a number line. Now the mapping we chose is to map minimum value in a to minimum value in c , and so on. lets say our array is sorted a0<=a1<=a2.....Now we will prove why we chose the sorted order as follows. Say at any point ai> ai+1. By contradiction and you matched ai to say c2 and say ai+1 to c3. lets say ai+1< c2 <c3<ai. And if we tried matching ai+1 to c3 and ai to c2. then see the segment between c2 and c3 is included twice which is not optimal.

    >>>>>>>>>>>

    | |

    ai+1.....c2----c3----ai.

    |           | 
    
          >>>>>>>>>>>>

    Hence it is always it is viable to map with nearest value.

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

    Exchange argument should work. If our target values are $$$x$$$ and $$$y$$$, $$$x \lt y$$$, and we have two value $$$a$$$ and $$$b$$$, $$$a \lt b$$$, matching them in sorted order will cost us $$$abs(x-a) + abs(y-b)$$$. If instead we match $$$x$$$ with $$$b$$$ and $$$a$$$ with $$$y$$$, we need to prove that the cost can't get any less

    Case 1: $$$b$$$ < $$$x$$$ or $$$a$$$ > $$$y$$$
    Then the total cost doesn't change. One will cost less by $$$b - a$$$, and the other will cost more also by $$$b - a$$$.

    Case 2: $$$a \lt x \lt y \lt b$$$ or $$$a \lt x \lt b \lt y$$$ (similar case if $$$x \lt a$$$)
    You can draw the four values in a line and it should be clear that matching $$$b$$$ with $$$x$$$ is going to result in more cost.

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

    We can prove a more general statement.

    Given two sequences $$$a$$$ and $$$b$$$ with the same length $$$n$$$ and $$$b$$$ strictly increasing find a permutation $$$c$$$ of $$$a$$$ such that $$$\sum \lvert c_i - b_i \rvert$$$ is minimal.

    We claim that the optimal permutation is non-decreasing.

    It is easy to prove it for $$$n = 2$$$ by considering a few different general cases. For $$$n \gt 2$$$, assuming that $$$c$$$ is not sorted, we can improve the sum over any two elements that are not in order (and the total sum) by swapping them. Repeat until c is sorted.

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

My B , failed in main test cases :(((

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

the contest must have been cursed

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

BINOD.

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

https://mirror.codeforces.com/contest/1397/submission/91390761 This is my submission of question div2 B, and it returned the wrong answer in the eighth test case. But the result I run locally is indeed 912788665, what's the problem? I changed the compiler to VS C++ 2017, and the result was ACCEPTED! Can this question be judged again? And I'm curious where is the mistake?

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

div2D/div1B defeated me... I still don't have an intuition for it... but I should have just tried it anyways.

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

My B and C both failed on system testing
vary sad contest for me....

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

Teach me to read pls(

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

Can anyone please tell me why is this wrong for Div2 A?

#include<bits/stdc++.h>
using namespace std;

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        string s;
        unordered_map<char, int> m;
        while(n--){
            cin>>s;
            for(int i=0; i<s.size(); i++){
                m[s[i]]++;
            }
        }
        int flag=0;
        for(auto it: m){
            if((it.second%n !=0){
                flag=1;
                cout<<"NO"<<"\n";
                break;
            }
        }
        if(!flag) cout<<"YES"<<"\n";
    }
    return 0;
}
»
6 лет назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

Anyone else who solved 2C using extended Euclidean algorithms like me? :(

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

Looking forward to seeing the proof for the solution of Div2 D...

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

man problem C was so fucking beautiful, Sometime i just don't get it ,why I can't catch these problems, fuck ups after fuck ups. Man cp can really hurt dumb fucks like me.

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

What wrong with my 91425950 for problem C in div2

Checker Log wrong answer Integer -1 violates the range [1, 4]

thus for the sample, why the following is wrong answer atoiz

1 4 
0 0 -8 -4
1
-1
2 4
-3 6 0
»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Question C in Div 2 — Multiples of length.91406408 On system Testing it got Time Limit Exceeded (on TestCase 70(last test case) ) verdict but now on running its displaying AC Verdict. What to do?Can anyone help?

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

3 times WA is huge demotivation. I was like, ratings can go to hell, I am not solving it :D

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

Please make the round unrated

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

My approach for problem E:

First we decide for each edge how many times it is passed through, then we could easily construct a matching using bottom-up.

It is easy to see, that a sequence of numbers (of times an edge is passed through) corresponds to a perfect matching if and only if : for every node $$$u$$$ (suppose its adjacent edges have numbers $$$a_1,a_2,\ldots,a_d$$$), the conditions $$$(\sum a_i)\bmod 2=1$$$ and $$$2\max\{a_i\}\le (\sum a_i)+1$$$ hold.

Starting from $$$a(u,v)=\min\{size_u,size_v\}$$$, each time we decrease the maximum value by $$$2$$$. It's obvious that the conditions above always hold (until some $$$a(u,v) \lt 0$$$). We want the sum of $$$a(u,v)$$$ equals to $$$k$$$, so we can use binary search to find the final sequence.

The overall complexity is $$$O(n\log n)$$$.

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

I don't know why this solution is giving Runtime error : Wrong Answer!! whereas the same code with if-else condition is accepted : Accepted

Someone please explain it!! As I am losing 50 points because of this.

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

Hexakosioihexekontahexaphobia is the fear of the number "666" .

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

I declared 25 size array for 26 characters.

I deserve weak pretest.

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

DIV1 B and DIV2 B should have been swapped

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

Why did my first submission 91409058 printed some random negative number? I just replaced printf with cout (91412283) and it worked correctly. atoiz

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

The problems are tricky but they are good.

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

Why this submission 91375766 gives runtime error on test 3 I ran the code on my machine and it gave me the correct answer

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

I used INT_MAX to set limit for long long int type data.Press F for me. Got WA in div2 B

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

When will rating be updated

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

Can someone please explain to me the exact score decline function for problems? And how a wrong submission penalty affects it?
I can't find it anywhere and I would really love to know the gravity of every passing minute or wrong pretest submission.

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

DIV2 B solution without using log to calculate upper bound : 91433534

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

Can someone prove the correctness when using greedy to solve the DIV1B? THX~

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

I just realized how ironic it is that today of all days I started to watch Lucifer on netflix... it's ok. I'm a little scared it's just another crime show.

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

Genuine question: if the problems take months of preparing, with lots of time spent writing/testing and scheduling, why aren't the editorials immediately ready after the contest? Isn't there plenty of time to write it between conception of the problem and the contest date?

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

Rating Update!!!

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

why is there no change in my rating after participating in 666 div 2?? I solved one problem but there is not even +1 or -1 , exactly same ..have the ratings not updated?

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

I faced this issue of signed integer overflow, where I can easily see passing the same code for test case 17 in my machine but failing here. I am using G++17 latest on my machine. I couldn't find any solution that what is different with codeforces C++17 compiler. My submission link

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

When will rating be updated?

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

Can this comment reach 666 upvotes?

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

[problem:B — Power Sequence] [contest:Codeforces Round #666 (Div. 2)]

Mistake by CodeForces Judges!!!!!!!!!

In Problem B under test case no. 56:

**CASE 1:**
if the resulting power sequence will be : 1  1^2  1^3  1^4  1^5  1^6  1^7  1^8   ..... 1^32 
	then cost will be 4073741790  (_marked as correct by judges_)
**CASE 2:**
if the resulting power sequence will be : 1  2^2  2^3  2^4  2^5  2^6  2^7  2^8   ..... 2^32 
	then cost will be 2368709120  (_less than that of previous case_)
**CONCLUSION:** 
The maximum possible range of a[n-1]  for a perfect power sequence is not mentioned anywhere. And so, CASE 2 must be the correct answer for this problem.

p.s : I have used this headline just for attention on my doubt.. No offense on headline please. Thanku for ur replies.

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

can someone give an explanation to why the Div2 D depends only in the parity if there is not a pile bigger then the sum?

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

    I didn't participate officially in the competition yesterday (12:35am for me), but read the questions and my solution sketch for Div2D/1B is as follows:

    Let S represent the sum of the piles of stones and let M be the max number of stones in one pile. Let R = S-M be the remainder — the number of stones in the other piles.

    If M > R (2M > S) then the first player wins: they repeatedly take from the M pile. The second player is forced to take one of the R stones from another pile. After 2R moves, there is only one pile remaining with M-R > 0 stones; the first player takes from this pile and then wins.

    Otherwise, if M <= R, we take two cases depending on the parity of S.

    Let's first look at S odd; let S = 2P+1. Firstly, the first player should take from pile M. Then there are S-1 stones remaining. We can create (S-1)/2 = P pairs of stones such that each pair comes from two different piles. This can always be done by creating a pair between the two piles of greatest size. By doing this pairing, no matter what move player 2 does, player 1 can always pick the other stone in its corresponding pair. Since player 1 always has a move/response to player 2, they will win.

    On the other hand, if S is even, then player 2 does this pairing strategy immediately; they have an answer to any move that player 1 does, so since player 2 can always move, they will win.

    We can see why this pairing strategy doesn't work if M > R (like in the first case) — we're not able to create all the pairs because the pile with max stones has too many stones in it; if the remainder is R (R = S-M), then you can create at most R pairs.

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

Thank for the contest but I want to ask a problem happen with me: I submitted it 6 times in problem B. The 6th time I was accepted, but when I reviewed the results, no results for my 6th submission and no grade for it. I want to ask why is that? I submit when time have 50 minute left. Have someone know this problem?

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

hey guys. i have a problem about 1397B - Power Sequence that i dont understand, hope someone can help me :)

this submission 91447181 is wrong at test 44 , because variable "power" is int and overflow happens. when i change variable "power" from int to long long , which is this submission 91446926, its wrong at test 4 and i dont know why.

sorry for my poor English by the way.

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

    We cannot go above the required c as it will always result in overflow For eg as in test case 4 N=100 so the appropriate c is 1 but in your code, you are also computing it for c=2 also and then comparing, for c=2 it will always have overflow(2^100 is large).By using power as int you were lucky as it resulted in greater value(at c=2 after overflow)than previous. Whereas for long long you got smaller value(again after overflow).So we cannot go to 1 higher value of c. My code for reference https://mirror.codeforces.com/contest/1397/submission/91450164

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

I like this contest. :)

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

In problem D of div2 can anyone help that for pile 2 1 3 2 how they are going....

according to me,

1st player chooses 3 in 1st turn and removes only 1 from this

2nd player chooses 2 in his 1st turn and removes only 1 from this

1st player chooses 2(new) in his 2nd turn without making empty the 1st pile he chooses of 3

2nd player chooses 1(new) in his 2nd turn without making empty the 1st pile he chooses of 2

then player 1 empty his pile from 3,2 one by one and similarly player 2 from 2,1 pile and player 1 has more number of the pile to remove so player 1 wins

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

I saw many people pass 1B with a O(n) solution.I just know O(sum log sum) where sum = $$$\sum a_i$$$.Can somebody explains it?

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

due to a small doubt i resubmitted my solution for question A , but during system testing my first solution was skippped , though it was compeltly correct.Can i get any help regarding this.After the contest i checked my previous submission , it was also an accepted solution.Please help . Link for resubmitted solution: https://mirror.codeforces.com/contest/1397/submission/91394792 Link of skipped solution: https://mirror.codeforces.com/contest/1397/submission/91357472 Link of skipped solution which was also an accepted solution : https://mirror.codeforces.com/contest/1397/submission/91424283 please help with this, i got -106 due to this blunder.

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

I am still eagerly waiting for that UPD : Editorial is published !!! Anyone Else still waiting ?

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

oh god where is the tutorial?

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

submission:(http://)https://mirror.codeforces.com/contest/1397/submission/91449160

why it is showing signed integer overflow on the line 43 thank u

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

div2D's easy solution

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

    can you please give your proof? mx part was easy but I can't think of the sum&1 part

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

      If $$$\mathrm{mx} \leq \frac12 \mathrm{sum}$$$ and $$$\mathrm{sum}$$$ is even, then we can pair all the stones on the table into pairs so that each pair contains stones from two different stacks. (We can do it e.g. by repeatedly removing two stones from two highest stacks and pairing them together; we can prove that the conditions $$$\mathrm{mx} \leq \frac12 \mathrm{sum}$$$ and $$$\mathrm{sum}\%2=0$$$ are satisfied throughout the process.) Then, the second player has a winning strategy -- whenever the first player picks some stone, the second player removes the other stone from the pair.

      On the other hand, if $$$\mathrm{mx} \leq \frac12 \mathrm{sum}$$$ and $$$\mathrm{sum}$$$ is odd, then the first player removes a stone from the highest stack. Then we can convince ourselves that we now have that $$$\mathrm{mx} \leq \frac12 \mathrm{sum}$$$ and $$$\mathrm{sum}$$$ is even, but now the second player is to move. Hence, the first player wins.


      It appears that this part of the solution is arbitrary:

      [...] we can pair all the stones on the table into pairs so that each pair contains stones from two different stacks.

      But it is nice to remember that this condition holds if and only if $$$\mathrm{mx} \leq \frac12 \mathrm{sum}$$$ and $$$\mathrm{sum}\%2=0$$$; this is quite useful e.g. in game theory or some optimization problems.

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

      We can consider each stone as a vertex, and each pair of stones from two different piles are connected by an edge. The first player chooses an arbitrary vertex, and in each turn a player chooses a vertex that wasn't chosen before and is connected with the vertex chosen in the previous turn. It's the well-known theorem that the first player loses if and only if the graph has a perfect matching.

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

My solution with explanation for problem E: https://mirror.codeforces.com/blog/entry/82130

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

Since the editorial is taking so long, would anyone who solved Div1D share how they solved it?

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

    Brief editorial: For every x,we enumerate y from 0 to L.Suppose the left-bottom vertex of matrix is $$$(x,y)$$$ .We maintain an array $$$a_{x \dots L}$$$ ,means $$$(i,y_2)(y_2 \ge a_i)$$$ is an legal right-top vertex.We may erase some candy during enumerating y,so there will be some events like $$$(l,r,y')$$$ ,means for $$$l \le i \le r$$$ ,$$$a_i=\max(a_i,y')$$$ .We can enumerate y from L to 0 and maintain a set for every color to get the events.The total events number is $$$O(n)$$$ .Use segment tree to maintain $$$a$$$ ,time complexity is $$$O(n^2 \log n)$$$ .

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

Hello everyone. I had a submission 91458515 which fails on the problem B but a similar submission 91458087 passed. The only difference between the two is — in one I assign the initial answer as 'LONG_MAX' and for the other, it is '1e15'. This should not break the solution to my knowledge. I may be missing something. If someone can point out the reason it would be very helpful to me.

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

Annotation-2020-08-31-130026

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

when will we get editorials

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

I thought I would reach Violet(1900) this time :(

»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
Video explanation Div 2 a,b,c,d
»
6 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +8 Проголосовать: не нравится

Hope the long wait for EDITORIAL disappears soon :'(.

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

Hi

My submission for Problem B Div.2 is failing in the cf compiler at test case 44. While running the same test case in my local compiler it seems to be giving the right answer.

https://mirror.codeforces.com/contest/1397/submission/91479829

Can someone help me with the same.

Thanks!

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

In Div.2 B , firstly I sorted the array and then took (n-1)th root of last number , say it came to be 6.4 , then I took 6 and 7 , calculated answer in both cases and found minimum of that , still WA at pretest 4 . Is my logic wrong or I did mistake in implementation part ? My code : https://mirror.codeforces.com/contest/1397/submission/91376042

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

when editorials will be published?

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

Is the editorial not released due to the long queue?

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

For div 2 problem C -

Can some1 explain what is the proof for k1 * n + k2 * (n — 1) = 0, in other words some multiples of coprimes can produce any number we want?

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

For div 2 problem D what should be the output for 1 2 1 3 According to me, it should be T but the accepted code says its HL. Explanation- first, T picks 3 one now it piles are 1,2 now HL has to pick 1 so now piles are 0,2 now T has to pick 2 so new piles are 0,1 now HL can,t pick either so T should win. UPD: I got it Sorry actually max>rest_sum so it is T

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

In division 2 question 2, in the following test case, why is the answer to this test case 1999982505 ? With c = 31623 we can get even smaller value 1999954247. TEST CASE: 3 1000000000 1000000000 1000000000

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

Since I joined Codeforces Community, this is the slowest editorial among all of the contest!

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

Hurry up with the tutorial, Please!!

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

In stoned Game problem , according to me there can be multiple answer, as it depands on "T" and "HL" which pile they choose. can anyone help ,

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

    This is a misunderstanding of the concept. It is stated that both play "optimally".

    Which means that the one losing the game would have made at least one other move that he did, if that would have helped to not be the loser. But he didn't, which means that no such move is possible.

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

Here are my solution to Div2 probE.91547269

In each level of the game, we have two plans to kill all monsters:

  1. Using Pistol to kill all normal monsters and then use awp kill boss immediately.
  2. Using Pistol to kill all monsters (include boss), or using Laser gun kill all normal monsters and deals 1 hp damage to boss and then use Pistol to kill it.

The difference between two plans is that boss will not be killed immediately if using plan 2, so we have to move to adjacent levels twice and spend $$$ 2d $$$ time (assume that we stay in current level after kill all monsters).

Let $$$ \text{once}[i] $$$ be the time we kill all monsters in level $$$ i $$$ by plan 1 , and $$$ \text{twice}[i] $$$ be the time we kill all monsters in level $$$ i $$$ by plan 2. At the beginning, we start the game at level $$$1$$$, and at a certain time, we are at level $$$i$$$, where all monsters in level less than $$$i$$$ were killed and all others are alive. This just same as we start the game at level $$$i$$$. So we using dynamic programming and let $$$dp[i]$$$ be the minimum time to finish the game if we start the game at level $$$i$$$.

Normally, we kill all monsters in current level, then move to next level. So we have $$$dp[i]=\min(dp[i],min(\text{once}[i],\text{twice}[i])+d+dp[i+1])$$$. And let's consider if we use plan 2 in level $$$i$$$, after deals 1 hp damage to boss we are forced to move to next level. If we use plan 2 again in level $$$i+1$$$, then we will move back to level $$$i$$$, we now kill the level $$$i$$$ boss, back to level $$$i+1$$$, and kill the boss too. Now we are at level $$$i+1$$$, where all monsters in level $$$i$$$ and $$$i+1$$$ were killed. We have moved to adjacenct level three times, if we move to level $$$i+2$$$ next, then the total time we spend on this two level is $$$\text{twice}[i]+\text{twice}[i+1]$$$. So we also have $$$dp[i]=\min(dp[i],\text{twice}[i]+\text{twice}[i+1])+dp[i+2])$$$.

And there is also a corner case. Let's consider $$$dp[n-1]$$$, if we use plan 2 in level $$$n-1$$$, then we will finish the game at level $$$n-1$$$. So we have $$$dp[n-1]=\min(dp[n-1],min(\text{twice}[n-1]+\text{once}[n],\text{twice}[n-1]+\text{twice}[n]-d))$$$.

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

Any idea till when will the Tutorial be uploaded? I am stuck on the last question, Div 2.

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

Where is the tutorial?

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

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

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

For the problem 1396A - Multiples of Length, Do I have to select different segments in each step?