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

Автор Ashishgup, 4 года назад, По-английски

Hi everyone!

I would like to invite you to another one of our rounds, that I set with my friends FastestFinger, smartnj, the_hyp0cr1t3 and ridbit10.

The round Codeforces Round 651 (Div. 2) will take place on Jun/20/2020 17:35 (Moscow time). If your rating is less than 2100, this round will be rated for you; otherwise, you can participate out of competition.

I would really like to thank my co-setters and:

Based on past reviews, we have:

  • Tried to make A easier and make the difficulty gradient a bit better
  • Reduced the number of AdHoc problems and made the problemset more diverse

You will be given 6 problems and 2 hours 15 minutes to solve them.

Good luck! :D

The scoring distribution will be: $$$500 - 1000 - 1500 - 2000 - 2500 - (2000 + 1250)$$$

Upd: Quick editorial — Hope you guys found the problems interesting :D

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

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

Be ready for an interesting round :).

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

    All questions on maths and num theory. Questions not spread on different topics. Not an interesting round, sadly.

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

      Only first two problems were math, but not the rest, i was also annoyed to see two consecutive GCD related problems.

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

        I won't call even A and B math. Yes they use a math concept (which every problem on CF does lol).

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

      Only A and B it`s math and num theory.I would even say that A is more about logic. B — the simplest math at the elementary school level. even + even = even, odd + odd = even, even + odd = odd. C — a little connected with math, but you can exit by simple programming, solving the problem in sqrt(N)*log(N). D, E and F — not math. In addition, 95% of codeforces problems are somehow related to math

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

      But the problems were good

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

    Now we are waiting for your round to be interested. :D

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

Ashishgupforces, niceforces, hopefullynogreedyforces

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

    !(MATHFORCES)

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

      No, you wrong. A — logic and a some math. B — elementary school math: even+even ==even, odd+odd=even even + odd = odd. C — you can solve this task without math — only programming(for example complexity sqrt(N)*log(N)). D — binary search or DP. E and F1 F2 — no math

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

Hoping to haffun :p

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

Ashishgup problem-set are so much interesting every-time. Hope we enjoy and learn so much from this one too .

UPD: A,B both gcd related (slightly boring) but overall i think a good contest..

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

I hope we are not stuck on A and B for eternity this time.

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

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

All of my AshishGup rounds have gone really bad (0 problems and 1 problem solved), but THIS time, REDEMPTION time. Gl to everyone who has also suffered till now like me. :D

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

genius problems with short statements!
As a tester, I recommend you to participate.

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

I'm ready for atleast 2 penalties in problem A
Edit : I didn't notice this, my bad
Based on past reviews, we have: Tried to make A easier and make the difficulty gradient a bit better

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

Another interactive problem by FastestFinger?

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

Every round of Ashishgup has been penaltyforces for me
![ ](

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

Ashishgup contest exist !! Everytime -_-

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

Ah shit, here we go again

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

Ashishgup round! I am super excited!!!!! Hopefully I'll at least solve A this time :D

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

Having tested some of the problems, I can confirm that they are very interesting and all the statements are quite short! If you participate, you are likely to enjoy the problem-set, as I did!

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

Weekend=Ashishgup Round

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

The frequency of Ashishgup round is increasing exponentially :P btw, i enjoyed his previous two rounds.

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

An army of testers!!

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

Another one ! Excited btw.

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

Here before AshishGup becomes the top contributor on Codeforces! XD

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

FastestFinger is ready to provide the fastest editorial (after the contest) :)

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

I gave one Ashish round before and it boosted my ratings. Hopefully, this will too.

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

Announcement writer panel of codeforces:

Educational rounds: awoo

Division 3: vovuh

Division 2: Ashishgup

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

This is the third round by almost same set of authors within less than a month, so I am curious; is the long contest approval queue issue fixed, or the contests of popular authors (i.e. those known to make a quality problemset) are processed out of queue?

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

    One of the reasons could be that these authors being experienced, require lesser iterations to get their problems/contests approved?

    Also, knowing FastestFinger personally, he recently switched jobs and got a little bit of free time in between and as a result he could focus more on creating problems. He had a few ideas in mind for long just didn't have the time, similarly, I guess Ashish is in his final year at university, and due to Corona, the academics have been paused so probably he also is able to dedicate time to designing quality problems. I believe something similar should be the case with other authors too.

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

      Sure, the round coordinators may have found all the problems submitted to be of good quality.

      But for that round coordinators need to view the submitted problems. Until an year ago at least, it would basically take forever (months!) for your contest proposal to be even viewed, because coordinators were overburdened with proposals.

      That's what I was asking about. Do contest proposals now take less time to be reviewed now? Or are authors who have prior experience setting good contests given priority?

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

Wrong answer on pretest2

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

Deleted

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

Yet another Indian contest!!!

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

what are ad hoc problems ?

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

    These are problems for which there exists no general technique or algorithm, i.e. no well-studied solution. Each ad-hoc problem is unique, and requires a specialized approach.

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

Whaaat?? Now you are telling here you reduced the number of adhoc problems, in next contest announcement, someone would say there would be a dp problem, then after sometimes, maybe we would eventually end up to see some setter say C would be binary search, D would be dp, E would be dfs and so on.
Please, don't give spoilers.

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

    Wtf!? Spoil? Which part is the spoil part? When you see a problem you can recognize which problem is adhoc and wich one is not. And it doesnt realy matter in the solution.

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

    I think you are right. Any insight comment about problems of upcoming contest is to much. It is like little boys want to be important: "I know something you don't know, haha".

    This is espcially true for testers comments, but also true for problemsetters. Why not talk after the contest about it?

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

Ashishgup authored 6 contests and already number 5 in the top contributors list. That shows the quality of the rounds.

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

    already number 5 in the top contributors list mostly because of the presence of the large Indian community. But, of course, there's no doubt about the quality of the rounds.

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

    quality with popularity **

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

Looking forward to some interesting problems!

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

At this rate In 5 or 6 month of time ashish gup will have more contribution than mike himself

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

Deleted

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

Ashishgup!! One of the finest problem-setters.Hope I'll solve till B this time :D

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

Has MikeMirzayanov already made aryanc403 coordinator of codeforces??..

For those who don't get it

PS : Although it's not daily, atleast it's weekly..

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

The round seems to be unfriendly to Chinese participants. And when will tutorial be published?

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


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

Maybe this time it will succeed

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

Thanks to everyone commenting about it, I am starting noticing that there is a pattern to every Problem Setter, some tend to use bits too much and others are good in questions with edge cases.
The last time I participated in @Ashishgup's #646 I was able to solve B but couldn't do A and C, which proves a lot of the comments down below :P

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

At least now I would be able to solve "A" problem

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

Ashishgup rounds have been good to me, hopefully that continues :)

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

I want to share something which got into my head suddenly..as.. "More time you spend on paper and pen...less time you need to debug". How many of you agree to this...I liked it very much so thought to share with you guys..if you apply this it can be very helpful.

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

    More time you spend on debugging, less time you need to spend on paper and pen.

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

      But while contests it can be very risky because there are penalties for wrong answers...so you may loose points...

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

    Thats correct i always do that! But thinking to implementing some problem when it solved is very important too. Just put 5 min to think about the implementation and then start coding it will be great and your wrong submission will be decreased :)

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

    And here I rarely use a paper and pen while giving contests

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

Looking forward to solve atleast 2 questions in less time. In previous Ashish Gupta rounds, I struggled a lot to solve question 1. Who's with me?

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

People need to understand They are not getting a rating update for making memes !

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

none of them like my comment so i delete it

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

A wasn't hard — it just required reading skills. When you are rushing through A and B it's very easy to misread the task and fall into trap of initial misunderstanding. It happened to me during your last round with A (where I read that we can't use adjacent cells, not the whole row or column) and during Global Round 8 with B (where I read that you should get the exact value of k, not >= k).

These are small mistakes, which can make the task way harder. You don't know how to solve it, at the same time, you see that a lot of people can, you get confused, you don't know what's going on — it also impacts your perception of the subsequent tasks (if A or B is that hard, how hard the next tasks could be?), blocks your thinking, raises your stress level and the whole contest is ruined and your rating goes down big.

Because of this, I prefer div 1 rounds (at which I can't currently participate) or TopCoder — where you have a smaller number of harder tasks and there is no need to rush. Nevertheless, I still think that the coder should know how to read the task, so I will keep trying.

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

It's raining contests on codeforces.

4 contests within a span of 10 days.

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

Ashishgup again?

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

relevant memes in editorial is the coolest part

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

Ashishgup orz!!!

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

nyo me adhoc problems :(

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

Ratings in Ashishgup 's round

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

Previous contests from Ashishgup here

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

Personally, I love Ashishgup's round. Because his statement was short and clear.

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

contest created by Ashishgup are really exiciting

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

Again, we have 4 div2 contests in a row without any div1..

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

3a7as7

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

    This is a really awesome comment! I don't understand why there aren't more upvotes on this. Maximum appreciation wsxx!

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

Cam someone please explain the meaning of ad hoc problem?

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

    Please read upper comment (:

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

    It's Basically Like Building Up A Soln For A Particular Problem as In It would Work Only For That One Problem unlike Greedy And Dp. More or less it's Like Constructive Algo.

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

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

Will there be an Interactive problem?

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

Ok, road to -100 сontribution

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

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

I think the next contest is vovuh's div.3 looking forward to it!

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

Is it a rule to have authors as characters in problems in all Indian contests?

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

    It's a little bit of obsession with the name.

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

    Isn't that fun?

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

      Well, it's better to use a name that exists in real life than an imaginary name.

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

      Is not at all, is harder to type those names instead of the usual "Bob" and "Alice".

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

        Who said you to type it everytime.. You could have just copied the two names in local string variable and printed that instead.. It would have even easier than your Bob and Alice..

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

          That is what I should have done, but you can see that is in fact a problem if we need to add more lines of code and does not contribute to make the problem any better. I did not type the names not even once time because could not type a name like "Ashishgup" if is not from pure memory.

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

A easier than previous Ashishgup rounds' A

B required observation, comparatively easy

C lovely problem, needed more observation

D most appreciable problem in the contest

I highly appreciate the problem statements. Strong pretests were really an additional advantage. Thanks for such a great contest!!

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

    E requires clever thinking, was easier than C and D IMO. But it requires a good mathematical proof. Also most of the users didn't even bother solving E after failing at D.

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

all problems except D are amaaaaaazing

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

You should really clarify the word optimal in Ques C

there are multiple paths and we can't know which one is optimal

To explain clearly there are cases where optimal can mean ASHISH dividing by the greatest Odd divisor first and lose or dividing it in such a way that he will win later on

This should be clarified, i tried multiple answers and none of them pass the pretest 2, not even the simplest ones and not even the complex ones.

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

D is the sexiest problem , great work guys .

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

    Can you share your approach?

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

      Basically you need to focus on making odds or evens as optimal as other will not affect as min is taken. Now they have to be alternate also. Now if you observe, you will find that you could binary search the max of one sequence and after taking the indices of all less than that max, try to assign alternatively and if it's possible, then lower the value. Take care of adjacent indices.

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

    My initial thought is solution is equal to finding a subset with floor(k/2) elements with no consecutive drafts from the array. To solve this I thought (k/2) * n dp array is enough but it seems like it exceeds memory limit.

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

What is pretest 10 for problem E?

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

Was D dp with binary search? UPD: Solved with Binary search.

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

    I did it with binary search but was getting WA on pretest 10. I couldn't find the mistake of my code.

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

      try

      7 6

      1 2 3 1 2 4 1

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

        My code gives 2. Is it true?

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

          it's true

          but my code use a simpler way to check:

          int a[N],d[N];
          int n,k;
          int check(int v) {
              if (a[1]<=v) d[1]=1; else d[1]=0;
          
              if (d[1]>=k) return 1;
              for (int i=2;i<n;i++) {
                  if (a[i]<=v)
                      d[i]=max(d[i-2]+1,d[i-1]);
                  else
                      d[i]=max(d[i-2],d[i-1]);
                  if (d[i]>=k) return 1;
              }
              return 0;
          }
          
        • »
          »
          »
          »
          »
          4 года назад, # ^ |
          Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

          if k odd, I add a element 0 to front and change k++ n++

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

How to solve D?

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

    bin search by the answer. It's rather easy to check if a given min-max is achievable

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

      How can we check if a given answer is possible?

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

        we try to fit odd positions and we try to fit even positions. In either case we greedily check if there is a subsequence of element < target with gaps in between

        i = begin_i num_to_take = ... while i < end_i and num_to_take > 0: if vs[i] <= max_v: i += 1 num_to_take -= 1 i += 1 return num_to_take == 0

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

    I'd solve with Binary search For fixed C value: 1. fix even position, add odd position any element, for even positions add <= C. 2. fix odd position: add even position any element, for odd position add <= C.

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

What is the test case 10 of problem E?

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

ParityForces !

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

In problem D, the optimal sequence is always a substring?

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

What was test 10 on problem E?

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

    my code fails this:

    18

    111011100100100100

    000100011011011011

    I think the correct answer for this is 5.

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

Since, sum of two even are even as well as sum of two odds are even. So, I took n-1 such pairs such that either at those indices sum of the elements are even i.e I took a pair (even,even) or (odd,odd), actually not the elements, rather their indices. Suppose we place these elements [the sum of those] in b then b will contain all even numbers. So, GCD of all of them will be 2 or any other even number i.e. GCD>1 in all cases. But my code gives WA, can anyone explain why ?

Testcase=int(input())
for _ in range(Testcase):
	n=int(input())
	arr=list(map(int,input().split()))
	odds=[]
	evens=[]
	for i in range(2*n):
		if arr[i]%2==0:
			evens.append(i+1)
		else:
			odds.append(i+1)
	cnt=1
	#print('#',_+1)
	while(cnt<n):
		if len(odds)>1:
			a,b=odds.pop(),odds.pop()
			print(a,b)
			cnt+=1
		if len(evens)>1:
			a,b=evens.pop(),evens.pop()
			print(a,b)
			cnt+=1
  • »
    »
    4 года назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    elif? You actualy can at exit from loop get $$$cnt > n$$$. Let's say $$$cnt = n - 1$$$ and both ifs executed. Then you write in output all numbers

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

I enjoyed the problems. It was a nice contest. I hope for a rating increase.

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

    Go to CF-predictor and it tells you your rating change. (Its also a browser extension for chrome:))

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

      Unfortunately CF-Predictor has not shown an accurate result recently. Apparently the point is a change in the rating system.But still shows an almost correct result.

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

I know that strong pretests are generally a good thing, but having 0 hacks in the whole contest seems a bit extreme...

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

Ashishgup and FastestFinger play a game.

Sounds bad

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

I liked the contest but isn't the gap between C and D too large?

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

    D was easier than C for me .

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

      It is easy for you if you know dp (in my opinion it is solved through dp). C is the simplest division of a number into divisors. And the number of solved C and D (4700 and 700) suggests that it’s easier to split the number into factors. :D

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

        i solved it without dp it is easy if you know binary search on the answer

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

          Hmm. thank you for idea, but agree, dividing x by y is easier than implementing a binary search by answer :)

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

Folks, how do I see the pretests failed? I can see only the first OK's on my submit page. Should I just wait till the full test finishes?

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

Best difficulty gradient ever!

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

i think if i had five min more i could solve D :(((

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

Loved the contest. Can't thank the setters enough. It was probably the perfect Div 2 I could ever ask for. And the quick editorial as ever. AshishGup and FastestFinger never fail to impress!

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

I really enjoyed problem C not too hard not too easy it's just how it should be

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

Ashishgup's contests make me realize how much i lack in constructive and how dumb i am :(

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

    At least you didn't waste 20 min on A XD like how I did I feel so dump

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

My previous post was receiving a lot of downvotes. So I have removed it

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

    I assume you realized the trouble. You should not share anything "during" the contest. You might want to record and upload it after the contest, just like the grandmasters' screencasts.

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

Ashishgup Orz. 3 great contests 3 weeks in a row!

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

My screencast of the round (solutions at the end)

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

Thanks Ashishgup! Problems were really nice and very interesting! I will wait for your the next round.

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

My C solution:

idea

code 1: 84456260

code 2

Good Luck

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

Does anyone know why this gives TLE for B

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

    i < e.size() - 2

    if size of e is 1 then e.size() - 2 overflows and become very large values because e.size() is of type unsigned.

    i'd suggest to always write it in form i + x < e.size() to avoid such issues or you can typecast it to int like i < (int)e.size() - 2

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

IMG-20200620-232439

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

Ashishgup and team really do come up with some interesting problems everytime..Always new things to learn everytime!

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

Nice problemset! really enjoyed! problem E might get more AC if E came before D.

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

To not keep you waiting, the ratings updated preliminarily. In a few hours, I will remove the cheaters, fix wrong division cases and update ratings them again!

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

I'm getting TLE in this code of E problem . Can anyone help please ? ```

https://codeforces.com/contest/1370/submission/84518033 ``` Ashishgup FastestFinger

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

I found E easier than D. D's implementation was little tough so I proceeded to E. Best choice of my Life.

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

    I actually didn't find the implementation for D difficult. I believe the observation was more difficult to make.

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

      Actually I was thinking another solution which was getting hard to implement. We usually go with the first soln that comes to our mind.

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

Is there someone else who solved D with DSU?

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

    Ya buddy!! well failed in contest though... Here is the submission 84521452

    Btw did anyone solve D using dp??

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

      can you share your approach

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

        Ya sure... i used the concept of forming segments of visited indices using dsu.. If the length of a segment is increased to become odd, increment the counter... If the counter>=(k/2) print the value at that index...

        U may need to take care of some boundary cases if counter ==k/2 :

        1) valueAt(0) and ValueAt(n-1) can't be in the same segment if (k%2==0).

        2) if (k%2) , if 0 is the starting index or n-1 is the ending vertex , counter should be equal to (k+1)/2

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

I wanna know why Ashishgup left my contest (Code Chronicles 1.0) midway yesterday ? I was so happy to see him solve our questions. Anyways his contest today was beautiful. Thanks to him I became an Expert on CF. I think Ashishgup read my comment on his previous contest. xD

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

    I must say, your contest was good. Although I took it casually as it was unrated but still I got a good rank. That's when I realized that being calm is very important during a contest. What you learn from the problems is much more important than your rank. Thanks for the lesson :)

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

      Glad you liked the contest! Although it was unrated we had put in lot of efforts to create a good problem set. :)

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

        The problems were actually really good. I hope, we'll get to see more contests from you. :)

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

I am a bit confused. This was my first contest on Codeforces. I got a +396 and I am a newbie now. I thought the minimum ratings were 1500. What is happening?

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

    They changed the rules. Now, your rating starts from zero and will stabilize in 5-6 rounds hopefully. It's better because with the previous rules there was a decline in the ratings for almost every new participant and it didn't look good.

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

      What exactly do you mean by "stabilize in 5-6 rounds"? Also, if you have the link to the blog post mentioning the change of rules, kindly provide it. Thanks!

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

        I mean you'll be closer to the ratings you actually deserve. Here is the link to the official blog post.

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

Here as the virtual Moss for Codeforces, busting cheaters and getting them out of their bills. I hereby present you another team GStnt and ymkzpx.

Congrats to both of them, Experts -> Candidate Master.

Solutions :

D : 84460179 and 84450653

C : 84458183 and 84460019

Ashishgup MikeMirzayanov isaf27 I guess these both shouldn't be the part of Div1

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

nice contest! I got to yellow. hopefully this is my last rated div2 contest ;)

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

I wasted my whole time in problem C later found that it could also be done by just simulation of the game and memoization.

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

    You didn't waste your time ; you worked harder towards solving it .Cheers !

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

I have a question about F1. When I check my submissions I see the following test 2:

1
4
2 4
1 2
2 4
4 3

I guess that there should be 3 edges and the last pair are hidden nodes. However, there is a double edge displayed. Is this just an error in a display or an incorrect test or am I missing something?

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

    If you read the “hack input” part of the problem statement, you will find actually the first pair are the hidden nodes.

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

Thanks for the round. Especially the prestests were exceptional.

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

Guys u can refer below link for problem A and B. https://youtu.be/0WYFThVN-GA?sub_confirmation=1

Guys u can refer below link for problem C. https://youtu.be/Tgy6lTxBPwk?sub_confirmation=1

Guys u can refer below link for problem D. https://youtu.be/s_XIa9sVaF0?sub_confirmation=1

Guys u can refer below link for problem E. https://youtu.be/Uirs77-Urp0?sub_confirmation=1

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

Hi MikeMirzayanov please see this solution. How this solution passed? I think this is a bug which should be fixed.

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

I got this message from Codeforces today. Attention!

Your solution 84481546 for the problem 1370C significantly coincides with solutions Aiman11/84481546, mission_thunderbolt/84487119. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://codeforces.com/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked.

I used ideone.com to check the code i had written from scratch as my compiler was not working. I was not aware that the code could be copied by anyone from there or there was a public mode. I am really sorry and this mistake will not be repeated in the future. Please do not take any action for a mistake which was unintentional.

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

    For the first mistake you are simply expelled from the contest. After all, not knowing the rules does not exempt from responsibility.And for the future, ideone has secret mode.

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

Any other person except CM Or MASTER Posts something : Random CF User with 10 submissions : Ohh It's Too hateful let's downvote it

I mean whats all the rage abt?!