Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

Utkarsh.25dec's blog

By Utkarsh.25dec, 7 days ago, In English

We invite you to participate in CodeChef’s Starters 11 this Wednesday, September 15th, rated for both division 2 & 3 participants.

Time: 8 PM — 11 PM IST.

Joining me on the problem setting panel are:

The video editorials of the problems will be available on our YouTube channel as soon as the contest ends. Subscribe to get notifications about our new editorials.

Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Hope to see you participating.

Good Luck!

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

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

How many problems would be there for each division?

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

What was there in the explanation of ATM queue?? if 2 is in front of 4, why can't 4 overtake?? It is written the A2 > A4 but A2=2 and A4=4. How is this explanation valid???

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

    2 and 4 , they are talking in terms of indices and not power values! So, A2>A4 (3>1).

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

      UPD: Never mind got it

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

        Basically , in the t(th) second you can think that the following code is executed: pop the a[t]. for e from t+2 to n: if a[e]>a[e-1] swap (a[e],a[e-1])

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

        Because first 4 will overtake 2 and then 5 will also overtake 2 in the same second

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

How to solve COUNTA? there's no editorial for it

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

    Currently the official editorial is yet to be published. I can provide you a rough soln outline.

    B[i] = min(A[i] , A[i+1])

    let us calculate dp[N][2], where dp[i][0] represents B[i] = A[i], and A[i+1] > A[i] and dp[i][1] represents B[i] = A[i+1], and A[i] >= A[i+1].

    We can now calculate dp[i+1][0] and dp[i+1][1] using dp[i][0] and dp[i][1], and making cases on A[i] and A[i+1]

    Think along this direction

»
5 days ago, # |
  Vote: I like it +10 Vote: I do not like it

The Div 2. problemset had really nice problems. Thank you for the nice problemset! It more than made up for the extremely weak testcases in problem C.

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

    Thanks for your feedback. Sorry about the weak test cases in C. Will not repeat this in future contests.