### orz's blog

By orz, history, 7 hours ago,

Today there were two nice contests in a row: AtCoder Regular Contest 149 and Codeforces Round #824 (Div. 2). I participated in both of them.

1. My participation in AtCoder Regular Contest 149 was quite a failure, I neither speedforced nor solved any of the harder problems. The video is already on my channel: https://youtu.be/3D1IbPtrLWg

2. My participation in Codeforces Round #824 (Div. 2) wasn't a failure, I even finished second! (And this is my by far the most successful participation in an unrated round.) The video is uploaded but still processing, so soon you will be able to watch it. As always, a nice bonus is a detailed editorial in the end of the video: https://youtu.be/fbFAg1th5oM

Subscriptions, comments, likes, watches and other ways of expressing feedback are welcome!

UPD. Now both videos are watchable. Enjoy!

• +31

By orz, history, 2 days ago,

Dear everyone,

As always, my screencast and detailed analysis of problems A–G of Codeforces Global Round 22 is already uploaded (but still processing for high-quality viewing) on the channel. This time the video is huge — over five hours!

Please watch, enjoy, learn, comment — anything you want!

UPD. The video is ready for viewing.

• +89

By orz, history, 8 days ago, translation,

Honestly, I don't really like contests carried out by giants like Google and Meta. While participating I feel some sort of permanent malaise, it seems like giants simply ignore all experience of how contests are run by Codeforces and AtCoder. But today I went as far as I have never gone before — I took 201st place at the Meta Hacker Cup 2022 Round 2 and advanced to Round 3 (preceding the final one). I do not hope that I will go to the finals, but for me participating in Round 3 is already as cool as in a final one!

A recording of my participation can be viewed here.

• +41

By orz, history, 4 weeks ago,

Today I participated in Codeforces Round #819 (Div. 1 + Div. 2) and Grimoire of Code Annual Contest 2022. At first glance, this was really a nice contest, and even though some problems were a bit too technical, they did contain some certain ideas (and as to whether these ideas were cool and beautiful, I guess there's no accounting for taste). However, the tests in the harder problems weren't strong enough. For example,

Nevertheless, I screencast the solving process (with my struggling to solve 1726F - Late For Work (submissions are not allowed)) and explanation of problems A–F, and I am now uploading it to YouTube, the video should appear here in several hours. Please leave your feedback (and other cases of high- or low-quality testing in this contest) in the comments!

UPD: While I was sleeping, two news have happened:

2. The round became unrated because of the problem F, from which I suffered a lot during the contest. (By the way, the suffering had nothing to do with the quality of the tests in this problem or with this issue, I just made stupid bugs). You may read this and this blog to get to know the incident.

• +87

By orz, history, 7 weeks ago,

I got to the 41st place in Codeforces Round #814 (Div. 1), which quite surprised me because my last several contests were also pretty lucky, not to say in this contest I was extremely slow in solving the problem A. Still I followed the tenet from the never_giveup's handle and finished the contest, it happened to be not that bad. Moreover, I beat my personal best of rating. I screencast and explained 1718A2 - Burenka and Traditions (hard version), 1718B - Fibonacci Strings, 1718C - Tonya and Burenka-179 and partly 1718D - Permutation for Burenka from this contest here: https://youtu.be/6iaSJikYZ-o

Feel free to watch and leave your invaluable feedback!

• +23

By orz, history, 7 weeks ago,

Since there were not that many Div. 1 rounds last several days, I decided to compete in a Div. 2 round. This time my participation was quite poor, but still I solved and explained some of the problems in front of a camera, so I hope that my video will be useful for my adorable viewers: https://youtu.be/ZF42Y5cQhf4

As with my previous video, any sort of feedback is welcome in the comments.

• +36

By orz, history, 2 months ago,

Recently I started screencasting my contests, there are already several videos on my channel. They all are in Russian because I ponder in Russian.

Today, as an experiment, I decided to screencast CodeTON Round 2 and comment my actions in English. Yes, my reasoning is often fragmentary there (because under the pressure of time I cannot spend much time explaining a lot of things rather than start coding). Still, since I finished 24th I expect it to be rather entertaining content, thus I invite you to watch the process: https://youtu.be/ZK8vVVhoQXI

Since I am very new to exploring this niche, any sort of advice of improving the quality of my videos is highly welcome here in the comments, on the Youtube, or in my PM.

• +97

By orz, history, 3 months ago, translation,

Several days ago I published a table with first people to reach certain ratings. It featured only ratings above 1500, and adamant advised to do the same, but on achieving ratings below 1500. I found it quite interesting, and, after several days of collecting data about participations of 447911 Codeforces users, I finally made this table.

• +61

By orz, history, 3 months ago, translation,

Several days ago I published a table with first people to reach certain ratings. It was a bit raw because, firstly, it was based on top 20000 Codeforces users by rating, and, secondly, because it only gave information about ratings divisible by 50. Now I have prepared a table that is of more complex design, but both issues are resolved. Good luck understanding what is going on in it.

• +170

By orz, history, 3 months ago,

Hi there!

Recently after Codeforces Global Round 21 Um_nik noticed that he might be the ninth or tenth person to reach 3600 rating points, but still he did it earlier than Petr. I wondered whether Um_nik really was that attentive to know for sure how many people reached 3600 before him. As this is an objective truth or an objective misconception, I decided to simply check it.

• +364

By orz, history, 11 months ago, translation,

Consider the following problem: given three integers $x$, $y$ и $m$, $0 \leqslant x,y < m < 2^{32}$, calculate $xy\bmod m$. The easy way is just to multiply these numbers and apply the modulo operation:

uint32_t prod(const uint32_t x, const uint32_t y, const uint32_t m)
{
return x * y % m;
}

As you might have guessed, this solution is wrong. The thing is that an overflow is possible in such a procedure: the operation x * y is performed in the typeuint32_t, and in fact the intermediate result of this operation will not be $xy$, but $xy\bmod2^{32}$. If after that we take the result modulo $m$, it may differ from the correct one:

$\left(xy\bmod2^{32}\right)\bmod m\ne xy\bmod m.$

The way out is simple — you need to multiply in a larger type:

uint64_t prod_uint64(const uint64_t x, const uint64_t y, const uint64_t m)
{
return x * y % m;
}

If you do this, then, since $xy<2^{64}$, this product will definitely not overflow, and after taking the result modulo, you will get the correct answer.

The question is: what if $x$, $y$ and $m$ can be greater than $2^{32}$?

• +269

By orz, history, 14 months ago,

IMO 2021 closing ceremony is taking place now.

Top countries were:

1. People's Republic of China, 208 points
2. Russian Federation, 183 points
3. Republic of Korea, 172 points
4. United States of America, 165 points

• +84

By orz, history, 15 months ago,

### IMO 2021

IMO 2021 opening ceremony takes place right now. Join the chat!