PaciukZvichainyi's blog

By PaciukZvichainyi, 3 days ago, In English

Alternative name: "Road to Master when you don't have time".
Episode 1: link
Episode 2: link
Episode 3: October 2024

UPD: So glad to hear your support <3

I already feel it, just need to be calm.

Practice results

The first half of the month was mind-blowing for me. First, I managed to solve a 3200-rated problem. Then I noticed that I no longer felt as much joy from just solving problems, so I decided to try something new. I started doing virtual contests to see if I had better chance for master than before. I chose contests that I had already completed four years ago, and omg my dopamine levels exploded. In my first virtual contest, I reached top39.

After that, I realized I needed to see my rating, including virtual contests, so I found Codeforces Anytime. Second and third VC — top139 and top183. After two virtual contests, my rating was 1969, and my performance in the last one was 2203. That was impressive for me. I gained a lot of confidence, and in my next official contest, I reached top 39. Hell nah, that felt like a dream. Of course, that contest was late at night, so there were fewer participants, but still it was close to my best finish ever (top 33).

Then came another contest where I gained +54 rating points. Now I have a 2020 rating, and just one more top 100 finish could make me master. But... Average Codeforces moment and I dropped back to rxpert. At least in the last contest of the month, I took back Candidate Master, which is at least something.

Conclusion? Need to write VC before official rounds :)

By the way, I learned one interesting trick that I wish I knew before. I have been using it for a few days and I love it. After solving a problem, I add it to a document and add a few sentences about what the problem taught me. Maybe there is some trick or something else. I find that when I write, I understand the logical steps of the problem better and remember better.
Example: problem

If it looks like binary/ternary search problem, but it doesn't have one extremum, try to use greedy method but find lower/upper bounds for iterator.

So instead of binary_search(1, n) it will look more like for i in lower(n)..=upper(n)

Solved problems:

R 1800 1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3200 Total
Count 5 3 0 6 10 5 6 5 3 4 1 0 1 48

Fun fact: every month I solve more problems (30->39->48) but spent +-the same amount of time. This means that I solve problems faster — nice(2).

Contest results

CF Standings Pos Delta Solved Few notes
Codeforces Round 977 (Div. 2, based on COMPFEST 16 — Final Round) link 1215 -8 3/8 Nothing interesting on contest. Bad C2 implementation. But E1-3 problems were really interesting. Enjoyed upsolving up to E2.
Codeforces Round 978 (Div. 2) link 39 +163 4/7 First contest after practicing few virtual contests. It was like midnight in my region but I decided to participate anyway. Top39. The best finish as for now. Instantly become CM. I actually believe I could solve even D2, but it was hard to focus on last minutes and D2 contains few edge cases. +motivation.
Educational Codeforces Round 170 link 234 +54 5/7 Yeah buddy. That is the performance I expect from myself. Solved 5 problems, let's go. If I haven't made few mistakes on D, I could have been top 70. I really like that I was able E, that is 2200 rating (master performance). Now I have 2020 rating, just one good contest I need.
Codeforces Round 979 (Div. 2) link 4085 -136 3/8 I'm an expert again. From this point I realized I don't want to cf anymore. I was really bad on thinking in this round. And then on implementation (D), so in general it was one of the worst performance during last 3 months. As usual after upsolving up to F, I realized it was just bad day, no need to panic.
Codeforces Global Round 27 link 1990 -38 4/9 First div1+div2 for me (I want to participate in div1 as CM one day). 3 hours of emotional roller coaster (aka pain). I couldn't figure out how to solve C. I knew it should be an easy solution, but my brain stopped working. I almost cried, xd, I was so mad at the problem setters (but the only problem is me). I solved it. "Yeah, now I can quickly solve D, then E, then win the t-shirt." God damn it. Just WA2 all the time. A moment of silence for my angry control system. For the first time, I decided not to finish this contest. I went to the kitchen and made myself some food. Spent 15 minutes. Food in the microwave. Yeah, let's try this thing. Ugh, AC. I'm so glad I got this accepted, otherwise I'd end up with so much negative delta that the next cfs would just have to return those points. But -38 is like 0.5 of a good contest. Not such a big deal. Moving on.
Educational Codeforces Round 171 link 441 +55 4/6 Last contest of the month. I need to become a CM or no one will read my november blog. Solid result. Top441, I almost couldn't have done better. I still don't know how to solve E. Or no, I know how to solve it, but it's f*cking flows. I decided not to even learn flows because I'd forget them after a few minutes anyway. I just understood what flows could theoretically solve, so next time I come across it, I can probably copy-paste a template (or no). Anyway, rating 1900, last cf of the month. What could be better? At least some positive results to keep practicing.
Result link Avg. 1334 +90 Avg. 3.8/7.5 I feel like now I am a solid CM. Nothing more to add. I need to become more consistent and learn how to control my emotions. The last few contests have upset me with how I handled my emotions.

Mini achievements

  • Fully upsolved 5 div2.
  • Made it to the semi-finals of ICPC, but will not be able to attend it because...
  • Finally became Candidate Master (twice) — max rating 2019.
  • Top39 Div2.
  • Solved 3200 problem without editorial (I swear, men, these numbers are pointless).
  • Full live Div3 contest (top80).
  • New topics: Kruskal Reconstruction Tree, Tree flattening with Euler tour, Xor hashing.
  • 30+ active days

Conclusion

It's not as easy as I expected. Sometimes when I'm on +morality and think I already "have master abilities" I start setting higher goals like IM/GM, but then I wake up. I need to learn to control my emotions if I want to see great results. So I'm back in city and ready for changes.

Full text and comments »

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

By PaciukZvichainyi, 5 weeks ago, In English

Alternative name: "Road to Master when you don't have time".
Episode 1: link
Episode 2: September 2024

See you in a month when I'm purple.

Just unlucky?:) Two months of grinding Codeforces and I'm still not purple. It might seem like a failure, but if I look closely, I can see significant improvement compared to my performance in August.

Practice results

I feel like in the second half of the month, I've lost my ability to think properly, feel so dumb. Maybe it's just an illusion because I’m solving 2200-2400 rated problems instead of 1800, but still, it feels strange. I motivate myself by reminding that this must be a transitional stage, after which I'll see a big boost.

University has started, and while it hasn’t taken up much of my time yet, I already spend full saturday for it. Plus, I spend a few hours a week chilling on social media, so compared to August, I probably have only about 70% of that time now.

I started to notice that my desire to code has dropped a bit. My mood for solving problems feels more like a sin(x) function compared to const in last month. Pretty self-explanatory. "The discipline is the most difficult thing" (CR7).

Solved problems:

R 1800 1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 Total
Count 5 4 2 2 15 1 3 1 3 2 1 0 39

Contest results

CF Standings Pos Delta Solved Few notes
Codeforces Round 972 (Div. 2) link 740 +82 4/7 If I hadn't failed one particular line of code, I'd have solved E1 and gotten +160. Speed solving was on decent level.
Codeforces Round 973 (Div. 2) link 988 +30 4/7 I wrote some crazy sh*t for problem D, which is actually quite easy if you think outside of the contest. I didn't have time for problem E, which is trivial, because these "gcd-like" problems have been pretty common during last two month on cf.
Codeforces Round 975 (Div. 2) link 2224 -43 3/6 I thought problem C (the card problem) was harder than D, so I fully focused on D and spent 90 minutes without success. After that, I solved C but didn’t have time for anything else. When I analyzed this contest later, I realized I could have improved a lot if I had checked the standings and noticed that people were solving E more than D. Instead, I chose D over C or E, bruh. But I have feeling that checking the standings during a live contest could hurt me. Either I'll see myself ranked high and stop thinking as hard, or I'll tilt if I'm not doing well. Btw, for problem D, I also wrote some crazy stuff that is theoretically correct, but it would have been better if I had just taken 5 minutes to think more about my solution instead of diving into coding right away.
Codeforces Round 976 (Div. 2) link 428 +92 5/6 Finally, I’m seeing the performance I expect from myself. It's the first time I solved 5 problems. Ofc, I took advantage of problem E by writing O(1024^2) instead of O(n*logn^2), which a lot of others did too. It’s pretty funny knowing my solution could time out, yet I submitted it and got Passed (4s). I ended up spending 2 more attempts optimizing my code to be 100% sure it would pass the system tests. Being in the top 450 isn't "master" performance, but the potential is definitely there.
Result link Avg. 1095 +161 Avg. 4/6.5 Max solved in live: 2000. Just comparing this month with the previous one, and the difference in "contest success" is huge. I improved from avg of 3.2/6.8 to 4/6.5 solved problems, avg pos jumped from 3847 to 1095. My rating delta went from -72 to +161. For me, this statistics clearly show that I've become better. Even though I feel dumber. Practice makes perfect

Mini achievements

  • Fully upsolved 8 div2.
  • Carried the team solo to the round2 of icpc (and based on the results, I might even make it to the semifinals, though I might fall because only 3 teams from the same uni are allowed).
  • +161 rating (which is quite good, though I was a 1650 before).
  • Top230 in a Div3 contest (speed-solving is here).
  • Twice nearly completed live div3 (the first time I didn't know Mo's algorithm, and the second time I needed just 3 more minutes).
  • New topics: MO's (I love this one), color coding, DnQ.

Conclusion

Less time, less patience and desire, but I am still in the village and want to return to the city, because winter are going to be cold. So I have to continue)

What a disappointment, I didn't become CM and didn't have a "master" performance (top 200) at least once. Probably fate just wants to leave some content for future articles :|

Keep pushing.

Full text and comments »

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

By PaciukZvichainyi, 2 months ago, In English

Alternative name: "Road to Master when you don't have time".
Episode 1: August 2024

Preface

I used to be a competitive programmer since ~8th grade. When covid started and we all had more time to solve problems, I actually began to see some progress in cp. I have two bronzes in the UOI (1 place to silver x2, sad). That's not too bad, and I probably don't regret it (though if I could go back, I'd definitely change my attitude).

I always had one milestone: to become a Master (yellow) on Codeforces. As you can see, my max rating is 3 points below Master. Pretty sad. I need to fix that. But a few things happened compared to 2020:

  1. 4 years have passed.
  2. I'm in my last year of university.
  3. I have a swe job.

So, I definitely have much less free time than I did in 2020. This is probably the last period in my life when I have at least some time to improve in cp, and I need to use it mindfully and close all my competitive programming goals (that are still achievable). But it's not all bad; my general intelligence is higher than ever, and my mindset has changed a lot since school, so I believe I can achieve Master in this condition more easily than 4 years ago.

I decided to sacrifice some things to have at least some time. I moved to the village during this grind period, I try not to watch YouTube or surf social media (watch f1 is allowed), I stopped going to the gym, and my city hobbies are temporarily on hold. After all these adjustments, I can say that I spend even more time on competitive programming than I did when I was in school. I currently spend about 3 hours on weekdays and 6 hours on weekends, so that's about 25-30 hours a week (not bad).

But why am I actually wanted to grind/solve again? It’s because Codeforces and other online contest platforms give you some pretty unique emotions that I, personally, don't experience much as an adult. The emotion of competing with other live people is something special. Multiplayer games offer something similar, but to a much lesser extent. And with a side effect — you end up feeling like you’re wasting your life. It’s really an amazing concept: you spend some time progressing (usually about a week), then test yourself in a competition, with the chance to perform better than last time and feel great about it. But to have more positive emotions you of course need to progress in between otherwise it doesn't make much sense. But to have more positive emotions, of course, you need to progress between competitions, otherwise it doesn't make much sense to always lose.

Rust

Few notes about the language I picked. I used to code in C++ back in the day, but I actually returned to cp by accident. I just wanted to do something in Rust because I hadn't used it for a few months. So I decided to solve a few easy problems on codeforces. I liked it immediately and now having so much fun writing my own template.

Goals

  • [ ] Master (It is desirable to write a few more cfs after becoming a master, because stoping writing immediately is a loser mentality).
  • [ ] Full live Div2 contest.
  • [ ] Better then top33 (personal best) in a contest.
  • [ ] Solve 2500R during contest.
  • [ ] Solve 3000R problem.

I chose yellow over red for several reasons. The main thing: to become red, you need to sell your soul to the devil, forget about writing a thesis, quit your job and practice 5 times more. But we'll see how it goes. The max time I allocate for this is the end of this year. But I expect to achieve master already in October. After this I will be able to fully immerse myself in simracing without any regrets (I hope so).

Practice results

During August, I had about 23 days when I solved some problems. I'm pretty impressed with myself because I can now solve almost any problem if I spend a few hours on it and it doesn't require aho/hld. I remember that four years ago, I would read the editorial after 30 minutes and "copy-paste" the solution without deep understanding. However, my speed has definitely decreased. Like I have this condition: I can solve harder problems in few hours, but I'm slower on easier problems.

I've also changed my strategy a little. Now, I almost exclusively try to solve problems myself without using the editorial. If I can't solve it but understand that with a bit more knowledge in a topic I could, then I schedule this task for two weeks later. I only read the editorial after solving the problem myself because, in my experience, the editorial is hard to understand even if you've just solved the problem (idk why this happens). To workaround this, I solve the problem first :)

A few mini achievements:

  1. Solved 2800 w/o Editorial (but knew I need to use CRT).
  2. Solved 2900 w/o Editorial.
  3. New topics: CRT, tree diameter.
  4. Remembered many algs and techniques.
  5. Fully upsolved 3 Div2 contests. In comparison I only had 3 in all my previous years.

Solved problems:

R 1800 1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 Total
Count 5 5 3 4 5 1 5 0 2 1 0 1 30

Contest results

Unfortunately, live contests didn't go as well as my problem solving when I'm not hurry up. I knew I could perform well, I believed in myself. But something didn't go as I expected.

CF Standings Pos Delta Solved Few notes
Codeforces Round 963 (Div. 2) link 1517 +14 3/7 First cf after two years. Not bad start. Was able to solve F2 (2800) after contest. Realized that my speed is not that bad.
Educational Codeforces Round 169 link 8954 -119 3/7 +5 attempts. C was too hard for me (1100). I missed one edge case in the implementation, but decided to focus all my time on it. I read E, but I forgot how Sprague-Grundy works. A quick read on cp-algo didn't help because I skipped the part about mex (read only xor). As a result, I couldn't understand how the first pretest even worked. I upsolved up to Problem F.
Codeforces Round 967 (Div. 2) link 442 +122 4/6 First good results. Big delta because I was almost cyan before the contenst. I even knew how to solve E1, but didn't have enough time. Solved E2 after contest (2900).
Codeforces Round 968 (Div. 2) link 825 +46 4/8 Even though I had +delta, but I hated this contest. There were so much problems and you needed to decide to solve D2 or E1, etc. I am not satisfied with myself, because I have fcked up again with the implementation of D2. After this contest, I started to get a little frustrated that I couldn't show my full potential. But + is +.
Codeforces Round 969 (Div. 2) link 7497 -135 2/6 Haaha, I started to think about quiting cp again. Even though I spent 3 attempts to solve A, I solved B pretty fast and had plan to just solve more than others. But then this C come to my eyes. I spent 1 hours without almost ideas. So following tourist's logic I decided to skip D and solve E. I had correct idea but (again) during the contest I wasn't able to implement it correctly. The next day, I woke up and upsolved the full contest without any problems and editorial, I spent maybe 3-4 hours. I'm glad my thoughts of giving up are gone because that would mean I'm a clown.
Result link Avg. 3847 -72 Avg. 3.2/6.8 Max solved in live: 1900R x2. Yeah, bad start. But the less rating you have, the more rating you'll gain next time, stonks.

Conclusion

I spent a lot of time grinding cp in August. But it's better than watching videos all day. Even though my live contests aren't going well right now, I believe that contest performance improves after 2-3 months (that's what happened in 2020). "You just wait, sunshine, you just wait". I'm actually starting to see some changes in my mindset too. At work, I’ve begun thinking more about my solutions and what the root cause might be, instead of trying everything immediately. This has had good consequences. As I expected, one month isn't enough to become a master, but I'm surprised at how good I've become at solving problems right away (though it takes more time than the contest duration).

I will continue to practice in the same way: simply solve hard problems that I once could not do, or upsolve my live contests. Maybe I'll write a few virtual ones.

So my goal for the next month is to become a CM and start solving that one extra problem that I couldn't implement right when competing live during this month. See you in a month when I'm purple.

Keep pushing.

Full text and comments »

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

By PaciukZvichainyi, 2 years ago, In English

What's the reason to name edge like (u, v)? When they are printed letters they seem pretty distinct but with TeX or Latex it's almost impossible to see their difference (especially if you read problem fast). Look, they differ only by one tiny line:

It is really annoying to turn on my brain just to understand this is v or u (or mb v and v, who knows). I think it is especially hard for visually impaired.
Even if there is some "mathematical" idea behind it, just name x and y and all life becomes easier.

Spoiler

Full text and comments »

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

By PaciukZvichainyi, history, 2 years ago, In English

Why I got Runtime Error on first test w/o vector reserve and got Accepted with reserve?

Without

With

The only difference is line 77 (if you open it in text editor).

Also, it passes test on local machine even without reserve statement.

RE

ImplicitSegmentTree(int l, int r) {
	lb = l; rb = r;
	n = r-l+1;
	next = 0;
	// TODO Change
	// nodes.reserve(4831707);
	nodes.push_back(Node());
	root = &nodes[next++];
}

OK

ImplicitSegmentTree(int l, int r) {
	lb = l; rb = r;
	n = r-l+1;
	next = 0;
	// TODO Change
	nodes.reserve(4831707);
	nodes.push_back(Node());
	root = &nodes[next++];
}

And last: the memory limit isn't a problem with this solution, because even with reserve(1e7) it works fine.

Full text and comments »

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