erniepsycholone's blog

By erniepsycholone, 2 years ago, In English

“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 27.02.2024 17:35 (Московское время). 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

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

| Write comment?
»
2 years ago, hide # |
 
Vote: I like it +49 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it +43 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it +24 Vote: I do not like it

As a grandmaster testing...

»
2 years ago, hide # |
 
Vote: I like it -6 Vote: I do not like it

Will become Expert after this contest

»
2 years ago, hide # |
 
Vote: I like it +37 Vote: I do not like it

As a tester, I cannot pupil

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +6 Vote: I do not like it

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.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it +129 Vote: I do not like it

Random meme:

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

maybe you can translate the saying into master turtle.

»
2 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

nice ạ

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +6 Vote: I do not like it

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!)

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

NEW DIV 3 ROUND YEAHHH

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +6 Vote: I do not like it

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!

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +10 Vote: I do not like it

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

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

The secret ingredient is... !

Spoiler
  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +2 Vote: I do not like it

    Actually, the secret ingredient is... !

    Spoiler

    Big respect to Master Oogway though.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

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

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I hope I get blue :)

»
2 years ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

the quote hits really hard...

»
2 years ago, hide # |
 
Vote: I like it -16 Vote: I do not like it

DBS forces

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Finally unrated for me!

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

GOOD LUCK !!!

»
2 years ago, hide # |
 
Vote: I like it +15 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Finally, another round where I can try hit pupil!

Good Luck for everyone!

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Ohhhh,I see Atletico Madrid fan

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

I hope to solve AE

»
2 years ago, hide # |
 
Vote: I like it +18 Vote: I do not like it

»
2 years ago, hide # |
 
Vote: I like it +45 Vote: I do not like it

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 :(

»
2 years ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

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.

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

I hope to successfully enter the youth league tonight :)

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Hoping for a fun contest.

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

give me a chance that making my name become yellow!

»
2 years ago, hide # |
 
Vote: I like it +21 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Good luck to everyone!

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Mathforces

»
2 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it +28 Vote: I do not like it

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.

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +1 Vote: I do not like it

..

»
2 years ago, hide # |
 
Vote: I like it +73 Vote: I do not like it

Thanks for the fast editorial!

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

is problem E binary search?

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

    I used ternary search

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

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

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

      search over what

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

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

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

          why does that function work

          • »
            »
            »
            »
            »
            »
            2 years ago, hide # ^ |
            Rev. 3  
            Vote: I like it 0 Vote: I do not like it

            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

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

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

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

    yes, binary search on convex function.

    you can see my code for reference:

    problem E solution
    • »
      »
      »
      2 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      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

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

problem e was truly painful to implement

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

can someone tell me where it is giving wrong answer 248621389

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

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://mirror.codeforces.com/contest/1933/submission/248632005

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

»
2 years ago, hide # |
 
Vote: I like it +34 Vote: I do not like it

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.)

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

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!

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

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?

»
2 years ago, hide # |
Rev. 3  
Vote: I like it +26 Vote: I do not like it

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
  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +44 Vote: I do not like it

    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 :)

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

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

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

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

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

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

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

    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

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

      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.

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

        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

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

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

    My submission

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

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

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

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

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

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

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

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

    • »
      »
      »
      2 years ago, hide # ^ |
       
      Vote: I like it +3 Vote: I do not like it

      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.

»
2 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

Is this one about turtles?

Every question is about a turtle.

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

    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.

»
2 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

Problems: Turtle

Editoral: Rabbit

»
2 years ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

fastest editorial ever seen

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 :)

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

.

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

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

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

    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.

    • »
      »
      »
      2 years ago, hide # ^ |
      Rev. 5  
      Vote: I like it 0 Vote: I do not like it

      [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

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

        nvm

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

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

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

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

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

              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

»
2 years ago, hide # |
Rev. 3  
Vote: I like it +13 Vote: I do not like it

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.

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

Please don't make this one unrated:(

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

In C, l could have been much larger.

»
2 years ago, hide # |
Rev. 4  
Vote: I like it +11 Vote: I do not like it

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
  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

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

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

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

    • »
      »
      »
      2 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it
      Proof
  • »
    »
    2 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    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 ?

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

      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)

»
2 years ago, hide # |
 
Vote: I like it +13 Vote: I do not like it

The best insane problem D ever !!

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

Great Contest

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

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.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

in prob C https://mirror.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

»
2 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

why Um_nik why

»
2 years ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

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!

»
2 years ago, hide # |
 
Vote: I like it +69 Vote: I do not like it

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

https://imgur.com/dKUPRJ3

»
2 years ago, hide # |
Rev. 2  
Vote: I like it -20 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Really Great Problemset!

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

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
»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Um_nik you are very bad

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

    Everyone makes mistake

    • »
      »
      »
      2 years ago, hide # ^ |
      Rev. 2  
      Vote: I like it +20 Vote: I do not like it

      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. :)

»
2 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Problem F is Awesome.

A bit different from usual problems.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

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

    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

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +3 Vote: I do not like it

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.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it +13 Vote: I do not like it

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://mirror.codeforces.com/contest/1933/submission/248595937

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 -.-

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I hope the round doesn't get unrated.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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)

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Thanks for making the round rated.

»
2 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

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

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

    What's the idea?

    • »
      »
      »
      2 years ago, hide # ^ |
      Rev. 2  
      Vote: I like it +3 Vote: I do not like it

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

      Spoiler
»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

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

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +8 Vote: I do not like it
#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.

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +31 Vote: I do not like it

    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).

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

"Round is still rated"

Lets goooooooooooooooooo

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

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

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

any hints for $$$F$$$?

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

    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.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hints for G?

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Thanks for the great problem F!

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Indian youtubers?

No, Um_nik

»
2 years ago, hide # |
 
Vote: I like it +30 Vote: I do not like it

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +8 Vote: I do not like it

    I have a question! should we avoid the usage of un_map in contests? is this a thing in competitive programming? because the only way to find out that un_map will cost O(n) is by submitting the solution during the contest and wait LOL :)

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 :)

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

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

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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)) ?

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

    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.

»
2 years ago, hide # |
 
Vote: I like it +14 Vote: I do not like it

Where is the editorial?