Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

K1o0n's blog

By K1o0n, 4 weeks ago, translation, In English

Thank you all for participating!

2275A - In Search of Convenience

Solution
Code

2275B - Did Not Go to Print

Solution
Code

2275C - Unrequited Love

Solution
Code

2275D - Precision Alignment

Solution
Code

2275E - Repentance Is Already on the Way

Solution
Code

2275F - Tea Blend

Solution
Code

2275G - Copper Squander

Solution
Code

2275H - A Problem to Warm Up the Eyebrows

Solution
Code
  • Vote: I like it
  • +51
  • Vote: I do not like it

»
4 weeks ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

K1o0n

Please pin announcement and editorial to the contest.

»
4 weeks ago, hide # |
 
Vote: I like it +13 Vote: I do not like it

Very nice contest, had lots of fun with the unique problem-setting style (haven't seen these types recently).

»
4 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hot take but I think that D and E > F, as someone that solved D and F I think that the observation on F was easier than seeing the greedy on E and the impl on D

  • »
    »
    4 weeks ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    D,imo was pretty straight forward towards the BSOA paradigm ,check fn was also simple!

  • »
    »
    4 weeks ago, hide # ^ |
    ← Rev. 2  
    Vote: I like it +5 Vote: I do not like it

    I felt D was pretty simple, E wrecked me hard. I tried making an graph on it and got stuck

    Also D can be solved without binary search My code $$$O(n log n)$$$

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

      EXACTLYY I DID IT SO TOO! such a smart solution :) E also wrecked me and im a bit sad because i uspolved f around 8-10 mins after the round if i had gotten it i woulda gotten +70-75 delta but i ended up with +6

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

      cool man! amazing sol

    • »
      »
      »
      4 weeks ago, hide # ^ |
      ← Rev. 2  
      Vote: I like it 0 Vote: I do not like it

      Tried to do it in the same manner :D Got stuck in implementation hell though for some reason, and towards the end I forgot we could use at most k operations rather than exactly k, so I "hallucinated" a special case where we didn't have enough operations to increase the least valued triplet(s) and got caught up in that. Your code is way cleaner than what I was doing...

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

      What do you do if you want to increment a prefix to the next value but there isn't enough k? for example with k = 50 and sum array: 1 1 1 100

      If you don't use binary search in a similar instance would it be TLE?

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

        you increment it as much as you can. so in this case, you'll be able to do 1 + floor(50/3) = 17

        if the costs of any of those triplets corresponding to the sum 1 is nonzero (i.e. that triplet is ascending), then subtract those costs first and then proceed similarly. if you don't have enough k to subtract those costs, then you choose to not do these operations at all, and leave the answer at 1. Hope this makes sense (and feel free to point out any errors here)

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

      xD,I was also doing the same thing,but due to a careless slip,I ignored the case where c>=b>=a,I thought its a waste of opeartions to increase the numbers here but i was wrong. I implemented it but got wrong answers due to this (c>=b>=a) case,though i used binary search afterwards and rectified my mistake.

      D was conceptually simple id say,just implementation:)) I found E easier than D :)

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

        same here :p. the structure of the paths in E is just so limiting Maybe I'm biased, but I think if the order of D and E was exchanged in the contest there wouldn't be a huge difference in the number of solves haha. But I guess it makes sense because D's ideal solution is more of a 'standard' concept (bs on ans)

»
4 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Problem E is genuinely interesting. At first I tried to look at the relationship among four adjacent points, and after more than half an hour I finally spotted a real pattern.

To start with, let's call the move a[i] → b[i] → a[i+1] → b[i+1] an N-shaped path, and a[i] → b[i+1] → a[i+2] a V-shaped path.

Core observation: any valid strategy must take N-shaped paths first, and V-shaped paths afterwards.

Proof by contradiction: once an N-shaped path has been walked over the interval [l, r], there is no way to come back — that is, [1, r] becomes unreachable. If a V-shaped path also occurs inside [1, r], then some point is necessarily missed, and such a point can never be reached by us, which violates the requirement.

For a chosen N-shaped or V-shaped path, the route length is fixed, so we can simply DP over the split point.

393812042

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

    I just realized that calling it an N-shaped path isn't quite rigorous — it should be an inverted-N. :D

»
4 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

if you're getting WA on test 3 on D and you put L=-1e18 and R=1e18, then you have to change your bounds, answer is at most $$$1e18 + 1e9*3$$$

»
4 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

was this a binary search round?

»
4 weeks ago, hide # |
← Rev. 2  
Vote: I like it 0 Vote: I do not like it

K1o0n

at problem E you don't take input of array b

»
4 weeks ago, hide # |
← Rev. 2  
Vote: I like it +8 Vote: I do not like it

The solution for C is missing taking of inputs

»
4 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Its my first rated contest and its so good!

»
3 weeks ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

K1o0n appreciation for humor on problem G !

»
2 weeks ago, hide # |
← Rev. 2  
Vote: I like it 0 Vote: I do not like it

can someone help me,my approach for D is,i initially sort in ascending order then what i am doing is making all then previous ones equal to the next one(till it is possible).Finally we distribute the restover operation among the already processed labs

here is the URL https://codeforces.me/contest/2275/submission/395415094

I agree that is really messy,but what i am asking is if my approach is right,ai is saying it is wrong(but idts).IS MY APPROACH WRONG

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

This is too crazy for beginners. But I like these kinds of questions that exercise the mind.

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

Man! What can I say! Mamba out!