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

Автор erniepsycholone, 3 месяца назад, По-английски

“It is not important to be better than someone else, but to be better than you were yesterday.” — Master Oogway, Kung Fu Panda

Hello, Codeforces! We are proud to present Codeforces Round 929 (Div. 3), and we hereby invite all of you to take part in it. This round will start on Feb/27/2024 17:35 (Moscow time). You will have 2 hours and 15 minutes to solve 7 problems. The penalty for a wrong submission is equal to 10 minutes.

This round will be rated for participants with ratings lower than 1600. However, all of you who wish to take part and have a rating of 1600 or higher, are welcome to register for the round unofficially.

The round will be hosted by rules of educational rounds (extended ICPC). Thus, solutions will be judged on preliminary tests during the round, and after the round, it will be a 12-hour phase of open hacks.

Remember that only the trusted participants of the third division will be included in the official standings table. As stated in this blog, this is a compulsory measure for combating unsporting behaviour and upholding gracious professionalism. To qualify as a trusted participant of the third division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them)

  • do not have a point of 1900 or higher in the rating.

Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you.

The problems were authored and prepared by erniepsycholone, snowysecret, dbsbs, jerryliuhkg, lomienyeet, and our beloved coordinator Vladosiya.

We would like to thank:

We hope that this contest, regardless of your background, rating and result, will increase your exposure to competitive programming and make you better than you were yesterday. Have fun!

UPD: Let's continue the streak of announcements with photos of the authors. This time with our coordinator and testers :)

UPD2: We discovered the screencast from Um_nik a short while before the end of the contest, and it had around 400 views by the end of the contest. Round is still rated, however, people who have used his solutions will be punished.

UPD3: Editorial is out

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

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

As a part of the problemsetting team, we unfortunately cannot offer any competitive programming socks as prizes.

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

{Get's a -200 Δ} "There are no accidents" $$$-$$$ Master Oogway, Kung Fu Panda

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

As a coauthor, I encourage everyone to participate, regardless of your ratings. I also hope you enjoy the problems. :)

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

Wish to become an expert with this round :)

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

As a grandmaster testing...

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

    As an international master, I am disappointed that there has been no international master testing.

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

Time to unleash the inner Kung Fu Coder and make Master Oogway proud! #CodefuPanda

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

Will become Expert after this contest

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

As a tester, I cannot pupil

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

As one of the testers of this round (i definitely dropped to specialist on purpose to get my own line in the round announcement), I unfortunately did not receive any competitive programming socks for my testing efforts.

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

After rating rollback i became Expert so this is my first Unrated Div3 :)

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

Random meme:

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

maybe you can translate the saying into master turtle.

»
3 месяца назад, # |
  Проголосовать: нравится -13 Проголосовать: не нравится

As a participant, CR7 is GOAT.

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

nice ạ

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

As a tester, I encourage every fellow programmer participating in the round to look at every problem to prevent skill issue. But anyways I hope everyone participating can have fun and hopefully learn something from this well crafted round~~

(The problemsetting team has genuinely dedicating a whole load of time to make sure this round runs smoothly with great problems!)

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

NEW DIV 3 ROUND YEAHHH

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

so many dbs students no kgv fame :( (dbs op)

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

Master Oogway quote beautifully encapsulates the essence of personal growth and self-improvement. Focusing on our own progress rather than comparing ourselves to others is a valuable mindset to adopt. Each day presents an opportunity for us to strive for excellence and become the best version of ourselves. Thank you for sharing such a meaningful perspective!

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

As a tester, I wish you high rating and hope you achieve the rank you aspire to be :)

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

The secret ingredient is... !

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

    Actually, the secret ingredient is... !

    Spoiler

    Big respect to Master Oogway though.

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

It's time to make yourself and you better♥♥♥.

"Goodluck.", — Master Oogway, Kung Fu Panda.

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

ok

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

I hope I get blue :)

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

the quote hits really hard...

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

i wish i could solve A,B,C.

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

DBS forces

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

Finally unrated for me!

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

GOOD LUCK !!!

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

Cumulative sum of their age is less than me or they looks very young?

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

Nice, new round, new training. BOTAAAAAAAT

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

Finally, another round where I can try hit pupil!

Good Luck for everyone!

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

Ohhhh,I see Atletico Madrid fan

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

I hope to solve AE

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

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

Kids are writing problems for a grownup like me. I guess that is the benefit of receiving a good education right from your childhood. The first time I used a computer was when I entered college :(

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

I predict that there would be a problem involving some range queries or stuff like that probably C or D It would have a simpler solution but will be overkilled by many using segment trees or something similar.

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

I hope to successfully enter the youth league tonight :)

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

Hoping for a fun contest.

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

give me a chance that making my name become yellow!

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

Thanks for continuing streak of putting authors pictures on the contest blog

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

Good luck to everyone!

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

Hope fast ABCD

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

Mathforces

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

LOL, umnik_team uploaded the solutions before the end of the div

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

um_nik is 1 hour ahead of us(iykyk)

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

WTF is this? why were the solutions posted before the round ends by Um_nik??? This is not fair. I hope they dont make this round unrated because of this.

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

    The problem-setting team has acknowledged the issue, and I have already tried my best to contact Um_nik on the issue a while ago to try to remove the video. I also hope the round doesn't get unrated :(

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

    Most of the participants wouldn't have even seen the video. Hope contest doesn't get unrated (even though I couldn't implement E), as I truly enjoyed the contest.

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

..

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

Thanks for the fast editorial!

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

I hate myself for not reading problem E correctly I was able to do it in 10 min once, I read the statement properly...

anybody did the same mistake?

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

is problem E binary search?

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

    I used ternary search

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

    yes

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

    yup. DP to calculate sum i -> j. then binary search

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

      search over what

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

        to find out K such that Math.abs(aL + a(L + 1) + ... + a(K) — U — 0.5) is Max

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

          why does that function work

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

            n = 1 => U

            n = 2 => U + U — 1

            n = 3 => U + U — 1 + U — 2

            ...

            n = m => U*m-(1 + 2 + .. + m-1) = U*m-(m-1)*m/2 = -1/2*m^2 + (1/2 + U) * m.

            It max when m = 1/2 + U

            => find K such that aL + a(L + 1) + ... + a(K) closest to m or 1/2 + U

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

              yeah sorry you're right, I misread the problem statement. shit. this is so much easier than what I was tryna do

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

    I was able to do it using binary search

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

    yes, binary search on convex function.

    you can see my code for reference:

    problem E solution
    • »
      »
      »
      3 месяца назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      its just a linearly increasing function.. the score is the convex function... only the index is needed so you can just use binary search on prefix sums

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

        yes i saw after the contest, did not realise it in heat of the contest, as I misread the problem wasted 1 hour on completly different problem.

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

problem e was truly painful to implement

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

can someone tell me where it is giving wrong answer 248621389

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

I used logic similar to finding peak element in array. But got WA. Could anyone please point out the mistake in my code?

Submission : https://codeforces.com/contest/1933/submission/248632005

Edit : Found the mistake. I was subtracting a[low-1] instead of a[l-1] :(

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

    Thanks for the hint and your code,I tried implementing using peak element concept, but got stuck in the code, actually I did not initialize my ans to l and also did not make neighbour= -INF if they did not exist and your code came to my rescue.

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

It was a good bluff to require us to answer modulo 998244353 in problem G. (I intuitively knew that the answer could not be large given the harsh conditions, but because of this requirement, I was not sure of my consideration that there are at most 8 patterns even after writing an experimental code with a brute force.)

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

great contest! i really enjoyed A,B,C,D,E, but couldn't implement bs in E, I need to practice more bs problems( Anyway great contest!

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

anyone can explain the test case in problem G ?

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

Um_nik has uploaded a video about solving this contest before the contest ended: https://www.youtube.com/watch?v=Asqk4kXi8os&ab_channel=umnik_team . Will this contest unrated?

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

    There is no point in making the contest unrated. Cheating happens and solutions get leaked on Telegram and YouTube in every contest.

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

    I think it should be unrated because there used to be cheating to some level but this is not done, i was able to solve 4 in div 3 which is good enough, still suffered 44 rating decrease because of soo many cheaters. Ratings should be rollbacked for this contest. This was too much!

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

Brooooo my stupid "print" statement costed me PROBLEM-C ripppppp

print
without

This could have been the greatest clutch of my life but NOPE. I want to jump off a cliff :((

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

Hints for all the problems before the editorial comes out.

A: Collect all the negatives in one subarray.

B: Maximum answer can be 2. Think about the cases when 1 and 2 will be answer.

C: What if we fix values of (x, y)? Also, the value of k will not be always distinct.

D: What if you keep minimum element at first? What if there are multiple minimums?

E: The sum is increasing upto a point and then it decreases. It starts decreasing after the (u + 1)-th section.

F: Firstly, coming at the same position again is not optimal. Secondly, we don't need the UP move until the last column.

G: Constructive problem, try to come up with a pattern using second test of sample. Also, the answer can be max upto 8, ignore the modulo.

Thanks to the authors for some very interesting problems.


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

    Happy to hear that you liked F a lot (I wrote it) Thank you very much you have made my day.

    Hopefully, I don't get downvoted by saying this... ik this task kinda was a nightmare at first sight for some of you, but hope it was an interesting and insightful task. Hope it wasn't that hard to understand as well, I already tried to draw better graphics for the explanation.

    Anyways, we will try to get the editorials out as fast as possible :)

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

      Keep up good work making problems interesting to think about and easy but not boring to implement.

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

      No no, I think it was fine for everyone. And, the graphics were actually cool.

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

      I really liked F :> Might even take inspiration from it to create some educational DP problems myself

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

    hi, about problem F, do we really this observation to come up with a solution,

    "Secondly, we don't need the UP move until the last column."

    I think we can use simple bfs to reach the end

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

      The observation is correct, but there are also other ways to realize such an observation which will be mentioned in the editorials. Of course there might be alternate solutions that also work, but having this observation does simplify the question a lot and can be done through dp or bfs.

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

        yeah, I do know that, just wanted to know if someone solved this by just first obs,

        from each point, we move to three possible cells(up, down, right), using bfs we find the ans for last cell

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

    In problem C, Why I am getting TLE in this code. It is O(max(13,sqrt(100))+ 3*10^3) .

    My submission

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

      You forgot to add the complexity of creating a 10^6 sized vector in each testcase.

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

        Thank you. I realised that I don't need to create those arrays .

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

    In E, how can you say that the sum is a convex function?

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

      you may have misread the problem description just like i did. among tracks the decline by one continues.

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

    Could you please explain why we dont have to use the UP move until the last column, it will be very helpful

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

      When you're doing the UP move, your position relative to stones isn't changing, so basically the whole setup is same in a rotational manner. The only thing that changes is relative position of ending cell, which you can also change when you're in the last column.

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

    someone explain what does it mean by seeing the grid in the pov of grid? Everyone says see the grid as static? Someone kindly explain

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

Is this one about turtles?

Every question is about a turtle.

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

    Originally we had a storyline, but it was decided to be removed in the end to improve the task's clarity. The idea came from a few sources. The first one is because the old workplace or "home" of my school's robotics team (I was the captain last year) was next to a turtle pond, and so I have a strong love for turtles :) FYI, each of the teachers having their seats next to the pond were also called turtles with different nicknames for each of them. The second reason was that we liked Master Oogway in the movie Kung Fu Panda, so we thought it would be a good choice to use it as a theme, both silly and inspirational.

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

Don't know! Should I be motivated or demotivated?! after seeing the problem setters...:/)

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

I could not even solve B. Every one here is discussing about problem E

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

Problems: Turtle

Editoral: Rabbit

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

W contest , W younglings who made these questions ,Hope its not gone to waste cause of the stream upload

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

Can anyone give any counterexample where this submission 248545787 doesn't work for C?

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

fastest editorial ever seen

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

I performed well in this contest but the contest is unrated for me because I became exactly 1600 after the rating roll back.

If I was 1599 I got +70 at least :)

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

https://codeforces.com/contest/1933/submission/248622479 can anyone tell me what is wrong with this code for problem E

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

.

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

    If this is true I think CF can spot cheaters and skip them. so no worry :)

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

    i mean people always post the solutions on youtube while the contest is running and have alot of views as well. i don't understand why when umnik do it it will be unrated , F and G don't have a lot of ACs anyway.

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

      [deleted] it's not intentional ,it's a mistake and he apologized

      Edit: it was a great contest ,hope to see more such contest from authors

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

        nvm

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

          Few stupid guys!=whole india Stop using "Indians" "Russians" "Chinese" Do you compare umnik with this guys ? Definitely not

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

            ok buddy I'll edit the comment and remove indians since this annoyed a lot of people.

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

              No hate bro ,what you said is correct there is a mass cheating in every contest and we can't stop them

              I know that umnik is not one of them

              but we can't judge a country by some brainless individuals

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

really liked both F and G, they are great! though $$$n, m \geq 5$$$ and strong sample little bit spoiled main idea of problem G, IMO.

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

Please don't make this one unrated:(

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

In C, l could have been much larger.

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

UPD2: Since the editorial is not out yet...

A solution
B solution
C solution

Original Post: Solved ABCDEF and I had no non-trivial idea for G. I enjoyed this problemset, and DEF are good problems in my opinion.

D solution
E solution
F solution

UPD: G upsolved. The ST was slow and I submitted 1 hour after finishing coding.

G hint 1
G hint 2
  • »
    »
    3 месяца назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Please tell me what is wrong with my implementation of E. I can't think of anyother way to implement it and also cannot make this implementation work. 248638966

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

      why are you going up to u+1?

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

        I may be wrong about it. Is that the issue ? I tried submitting with critical = u which also doesn't work.

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

          if two index that are adjacent make same answer then you should take the lowest one. I think in the first test case your answer is giving wa. 3 1 4 1 5 9 for l = 1 and u = 8 your code gives r = 4. But r = 3 also gives the maximum sum. You should go upto u and check the next index also which is res+1. if it makes greater sum then output res+1 otherwise output res.

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

    Good hint for F. I was able to code it up after looking at your hint

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

    begin with other elements, and you will get 0 at the first x. can you explain this with proof? Thanks in advance

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

    For Problem-F

    Can you please help me :

    lets say that we reached the cell a[i][m-1] ...

    Why currAnswer = dist[i][m-1] + abs ( n-1 -i ) is not correct ?? ( where dist[][] can be found by simple BFS ) and thus the final answer will be Minimum over all i...

    How to correct it ?

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

      What if you walk down and there are rocks in your way? The "wait" is to go up all the way(i.e. stay in place from the grid's viewpoint)

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

The best insane problem D ever !!

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

Great Contest

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

Please don't make contest unrated. Just check for plagiarism for problems E,F,G that were send last 30 minutes with the umnik's code from youtube.

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

in prob C https://codeforces.com/contest/1933/submission/248626484 I am getting wrong answer from codeforces judge but if I am testing the wrong test case on my local machine it's giving me the right answer? WA on test case 2 40th test 8 4 780

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

why Um_nik why

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

The contest was very interesting, thanks to the organizers of the contest. I just found this stream where Um_nik broadcast the last ~1 hour of the contest. I felt very sad because some of the participants cheated and one of the great codeforcers has ruined contest. In fact, it's not about cheating, but about respect for the creators of the contest.

Dear organizers you did really greate job!

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

heres why i solved this G 2x faster than rainboy.

https://imgur.com/dKUPRJ3

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

sirs

thank u the much for this roudn !!

but fapipitito notice G is pretty specil?? fapipotato confused !!

fapipotato find solution near end but cannot code fast be cause hand weakk :((((

i liek all problom and this very high qualiti round!!

mcuh love and look forward to more future later round from u guys!!

fapi potato

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

:)

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

Really Great Problemset!

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

I did a BFS implementation in Problem F. Sadly, I got a TLE on Test 12. Can someone point out how to avoid it from my code?

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

Um_nik you are very bad

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

    Everyone makes mistake

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

      I guess Master Oogway's words work again, "There is always something more to learn. Even for a (Legendary Grand) Master" lol.

      And despite such issues may be problematic, I think we shouldn't put all the blame onto Um_nik as him doing his videos were for a good cause in teaching programming, just that he may have accidentally posted it early. Additionally, he has already apologised as well and I agree everyone makes mistakes, me included. Hopefully, such issues will be prevented in the future. :)

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

Problem F is Awesome.

A bit different from usual problems.

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

was stuck at e, but then saw huge num of ac in E, around 4500 solve, now really upset after seeing the comments.

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

    e is still not hard despite the cheating . you just have to find the first sum that's bigger than u, using binary search and find what's bigger this value or the one behind it

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

      True. E was easy, but as i become super saiyan level dumb durning contest, i forgot to check the values behind

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

Problem F: BFS with one tricky observation. In this problem, the robot will move upward only when it's in the last column. Due to this constraint, the straightforward Depth-First Search (DFS) approach might lead to Time Limit Exceeded (TLE). This optimization should help improve the performance and prevent TLE.

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

    I tried DFS, but getting WA 248632066. Any possible reason you could tell?

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

      I haven't viewed your code but I don't think DFS will work, because BFS guarantees the lowest depth when each node is first visited but DFS does not

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

        You don't need to ever revisit any cell, so it doesn't matter BFS or DFS. AC with DFS

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

          You have to revisit cells if you are doing DFS and what you have linked is BFS

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

            Whether it is a B of D FS is determined by the order of traversal, and not the function name or use of recursion.

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

              Okay, the order of traversal in your linked solution is bfs order and if it was dfs order , you would need to revisit cells
              does this satisfy your highness?

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

Can anyone tell why my code for E is giving TLE on 8th TC after applying Binary Search. 248643885

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

Can anyone try and hack my submission for F? I just did a O(n^3) BFS and used bitset to store visited. It passed somewhat comfortably but I'm wondering if there's a case where it blows up. https://codeforces.com/contest/1933/submission/248595937

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

    are u checking upward in all columns ??

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

    Hacked.

    I generated a $$$1000 \times 1000$$$ grid with all $$$0$$$'s to greedily maximize the number of neighbors of each cell.

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

    I just added a condition where I move upward only in the last column and the runtime improved significantly, I don't think it can be hacked now. I think this implementation is very interesting because you are essentially doing the n^3 bfs with one little optimization for the transitions and the O(n^3) memory being reduced by a factor of 32 with bitset making it enought to pass the limits. https://codeforces.com/contest/1933/submission/248663273

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

      bitsets are so dumb bro if u were really that good u would've figured out something easier noobie

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

        shut up bro

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

          hey friend,

          just wanted to drop a quick note to say sorry for what went down the other day. i know i messed up and i feel really bad about it. didn't mean to hurt your feelings or make things awkward between us. i hope we can talk it out and move past this. let's grab a coffee or something soon and chat about it. again, really sorry, mate.

          take care, [Your Name]

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

          Nah man , he is onto something

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

      I think with your new optimization the time complexity actually becomes $$$O(N^2)$$$, and your space complexity would be $$$O\left(\frac{N^3}{32}\right)$$$ as you have stated.

      Moreover, I noticed that with your new optimization you don't even need the 3rd dimension for the visit array, since I think you can arrive at cell $$$(i, j)$$$ only if the time $$$t \equiv i + j \quad (\text{mod } N)$$$. So, you can optimize the space complexity further to $$$O\left(\frac{N^2}{32}\right)$$$. (see https://codeforces.com/contest/1933/submission/248668841)

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

        The time complexity is still technically O(n^3/32) as I need to initialize the bitsets, however your idea fixes that issue. The 100ms saved is most likely just due to the fact that there wasn't a need for so much data to be initalized.

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

It was indeed a good round, I just hope it doesn't get unrated.

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

I almost gave up doing competitive programming. After 19 months almost I thought, let's start again. I was reading the explanation of test cases of problem B. And I Couldn't even figure out how that explanation matches the output. Suddenly I see a message popping up, saying there was an error in the explanation of Problem B. How could the problem setters or the testers miss such error I don't know. I was totally frustrated and couldn't even focus anymore sadly. Such a frustrating experience -.-

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

I hope the round doesn't get unrated.

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

really thank you It was a good math contest Just remember from now on, this is Codeforce not MathForces

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

Was this really a Codeforce contest, 4 math and number theory questions in a row

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

    Most CP problems require math on some level. Maybe try learning it?

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

      YES Most CP problems require math on some level. but all of them doesn't have math tag

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

      oh bro Now I want to teach you something very friendly In Codeforce, tags are set for many questions that show the key ideas of the solution and the algorithms necessary for the solution. So it's better to learn how to use this site before you come and comment

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

help in problem C

here L = k * a^x * b^y, so, K must be a divisor of L. Now i need to check which of the divisors can be represented in (a^x*b^y) and count them. What is wrong with this idea? i think it shouldn't give TLE. My Source Code (WA on test 2)

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

    Try putting your "k" values in a set. Maybe that helps.

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

    You can keep the K values in hashmap for quick checking.

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

    In the code, you are only considering the case where a^x==l, or (b^y)==(l/a). Instead of thinking for 'k', try to generate all the values of (a^x + b^y) and then check if it divides l. Store the value of corresponding 'k' in a map or a set if it does. To avoid overflow issues you will need to consider the values of 'x' and 'y' up to which a^x and b^y do not exceed 'l'.

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

Thanks for making the round rated.

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

Thanks for problem E, I finally learnt how to implement ternary search.

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

    What's the idea?

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

      My answer won't be perfect, but I hope you understand something.

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

A bit sad that I couldn't code the E problem in time, the prefix sum and a binary search was an obvious idea of the solution. Good contest tho, I assume that it is a perfect example of a well elaborated div3 round. Many thanks to the authors, it was a pleasant adventure!

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

Child labor... unbeliavable.

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

why trivial binary search not working on E! like lower_bound(pref.begin(), pref.end(), pref[l] + u) AAAAAAAAAAAAAAAAA!!!!

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

https://codeforces.com/contest/1933/submission/248653337

Why my this solution is not working for E? im checking mid and mid+1

»
3 месяца назад, # |
Rev. 2   Проголосовать: нравится +8 Проголосовать: не нравится
#include <iostream>
using namespace std;

int main() {
    cout << "1\n"; // End the line after printing "1"
    cout << "1000 1000\n"; // End the line after printing "1000 1000"
    for(int i = 0; i < 1000; i++) {
        for(int j = 0; j < 1000; j++) {
            cout << "0 "; // Print "0 " without a newline
        }
        cout << "\n"; // End the line after printing each row of zeros
    }
    return 0;
}

I am trying to hack Problem F using above generator. But got this Verdict "Validator 'validator.exe' returns exit code 3 [FAIL Expected integer, but "#include" found (stdin, line 1)]". Someone help me find the error.

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

    You have to find and use the "generated input" tab in the hacking interface.

    Besides that, you have to NOT print the trailing space in each line. Your test will be validated and then given to contestant, who doesn't have the obligation to work on malformed input. The validator does not fix formatting for you, it just reports that formatting is wrong (easier this way).

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

I think my code is wrong in problem D 248569476 can someone hack it

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

Thanks for keeping the round rated ❤️. It will encourage honest participants who invested their time in participating in this contest.

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

"Round is still rated"

Lets goooooooooooooooooo

»
3 месяца назад, # |
  Проголосовать: нравится -13 Проголосовать: не нравится

You know u cant detect cheaters they can simply change the code u might find some but still its kinda unfair

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

really enjoyed G and F. I don't know why I wrote a dfs solution for F during contest(that was also wrong).

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

any hints for $$$F$$$?

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

    You can remove the motion of the rocks by moving your reference frame up one unit each time step. From this point of view, at each time step the robot can either stand still, move down and to the right (if there is no rock at the end of this move), or move down two units (if there is no rock at the end of the move or at the intermediate square.) This may make it easier to see which squares the robot can reach and when it can reach them.

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

Hints for G?

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

Thanks for the great problem F!

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

Thank you guys for an amazing Div3!

Wow, the system testing is earlier than usual!

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

Indian youtubers?

No, Um_nik

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

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

in Problem 'D', i used Unordered_map to save time and got TLE on testcase 30 ;(

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

my program got TLE because use unordered_map? 248557195 (problem D)

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

I think that there's a problem of rank updating ychaaibi rating ( 1406 )

Thanks in advance, also thank you for the contest.

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

1599 after rating update. :( Does the rating increase after plag check is done?

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

    Yeah the rank was updated and my rate was also increased by 3 ( 1406 -> 1409 )

    Thank you so much.

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

Thank you to the question team for providing this tournament making it possible for me to pass 5 questions during the tournament. good bye pupil , hello Specialist :)

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

Is there anyway to get editorial of the contests (when over) at one-place.

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

In Question 1933C - Turtle Fingers: Count the Values of k,

Can anyone explain why do i need to iterate the values of x from 0 to (log(l)/log(a) + 1) ? Similarly i need to iterate the values of y from 0 to (log(l)/log(b) + 1) .

Why do i need to check for the last value (log(l)/log(a) + 1) ? Because anyway a power (log(l)/log(a) + 1) will be greater than l.

why does my solution fail when i iterate only till (log(l)/log(a)) ?

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

    When you compute log(l)/log(a) using floating-point arithmetic, you get rounding errors, so the value you compute may be less than the exact value. To see this, use a custom test to run the following program, which attempts to compute $$$\log 243/\log 3$$$:

    Test program

    You will get not 5 but 4.999999999999999.

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

Where is the editorial?

»
3 месяца назад, # |
  Проголосовать: нравится -21 Проголосовать: не нравится

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

I made the same mistake using ideone.com. Next time, I will be more careful. Please, do not reduce my rating. These ratings are very important to me. Please do not block my account or impose penalties. I assure you that I will be more sincere in the future.

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

i was taking this contest in my school(not only this one) a place where lot of computers are place there were many people that were taking this contest simultaniasly
due to my strategic of taking exams and contest , i have breaks through the exam time and it includes changing my position , having some fresh air , eating something , .... i believe when i was walking outside , someone has checked on my computer for codes of contest and because there are schools property , i can not put passwords on computers for security i will be sure that nothing like that will happen again