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

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

“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

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

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

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

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

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

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

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

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

As a grandmaster testing...

»
2 года назад, скрыть # |
 
Проголосовать: нравится -6 Проголосовать: не нравится

Will become Expert after this contest

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

As a tester, I cannot pupil

»
2 года назад, скрыть # |
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.

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

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

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

Random meme:

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

maybe you can translate the saying into master turtle.

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

nice ạ

»
2 года назад, скрыть # |
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!)

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

NEW DIV 3 ROUND YEAHHH

»
2 года назад, скрыть # |
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!

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

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

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

The secret ingredient is... !

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

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

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

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

I hope I get blue :)

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

the quote hits really hard...

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

DBS forces

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

Finally unrated for me!

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

GOOD LUCK !!!

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

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

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

Finally, another round where I can try hit pupil!

Good Luck for everyone!

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

Ohhhh,I see Atletico Madrid fan

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

I hope to solve AE

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

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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 :(

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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.

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

I hope to successfully enter the youth league tonight :)

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

Hoping for a fun contest.

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

give me a chance that making my name become yellow!

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

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

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

Good luck to everyone!

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

Mathforces

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

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

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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.

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

..

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

Thanks for the fast editorial!

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

is problem E binary search?

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

problem e was truly painful to implement

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

can someone tell me where it is giving wrong answer 248621389

»
2 года назад, скрыть # |
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://mirror.codeforces.com/contest/1933/submission/248632005

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

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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.)

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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!

»
2 года назад, скрыть # |
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?

»
2 года назад, скрыть # |
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
»
2 года назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

Is this one about turtles?

Every question is about a turtle.

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится +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.

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

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

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

Problems: Turtle

Editoral: Rabbit

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

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

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

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

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

fastest editorial ever seen

»
2 года назад, скрыть # |
 
Проголосовать: нравится 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 :)

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

.

»
2 года назад, скрыть # |
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.

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

Please don't make this one unrated:(

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

In C, l could have been much larger.

»
2 года назад, скрыть # |
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
»
2 года назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится

The best insane problem D ever !!

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

Great Contest

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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.

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

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 года назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

why Um_nik why

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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!

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

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

https://imgur.com/dKUPRJ3

»
2 года назад, скрыть # |
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

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

Really Great Problemset!

»
2 года назад, скрыть # |
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
»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Um_nik you are very bad

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

Problem F is Awesome.

A bit different from usual problems.

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

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

»
2 года назад, скрыть # |
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.

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

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

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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://mirror.codeforces.com/contest/1933/submission/248595937

»
2 года назад, скрыть # |
 
Проголосовать: нравится 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 -.-

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

I hope the round doesn't get unrated.

»
2 года назад, скрыть # |
 
Проголосовать: нравится 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)

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

Thanks for making the round rated.

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

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

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

    What's the idea?

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

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

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

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

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

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

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

»
2 года назад, скрыть # |
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.

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится +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).

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

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

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

"Round is still rated"

Lets goooooooooooooooooo

»
2 года назад, скрыть # |
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).

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

any hints for $$$F$$$?

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится +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.

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

Hints for G?

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

Thanks for the great problem F!

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

Indian youtubers?

No, Um_nik

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

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

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

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

    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 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
2 года назад, скрыть # |
 
Проголосовать: нравится 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 :)

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

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

»
2 года назад, скрыть # |
 
Проголосовать: нравится 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)) ?

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 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.

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

Where is the editorial?