Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

You can use several words in query to find by all of them at the same time. In addition, if you are lucky search understands word forms and some synonyms. It supports search by title and author. Examples:

  • 305 — search for 305, most probably it will find blogs about the Round 305
  • andrew stankevich contests — search for words "andrew", "stankevich" and "contests" at the same time
  • user:mikemirzayanov title:testlib — search containing "testlib" in title by MikeMirzayanov
  • "vk cup" — use quotes to find phrase as is
  • title:educational — search in title

Results

1.

reader

Last visit:  12 months ago
Registered:  4 years ago
2.
By MikeMirzayanov, 3 years ago, In English
Please, read this Hello, Codeforces. Friends. I apologize, but today I will be a bit chaotic and mix personal with public. It just happened that way, I'm sorry. Today, my mother passed away. It's hard for me to write this. Even just seeing it in text makes it feel like something from a nightmare. She was extraordinary. It's difficult for me to articulate it right now, but take my word for it. It felt like all the best qualities one could imagine in a mother converged in her. I don't know any other people so kind, sincere, non-judgmental, capable of love, listening, befriending, supporting, and taking joy in the world around them, and bringing joy to their loved ones. Mom, it's already hard without you, it feels empty. She had glioblastoma. It's an aggressive brain cancer that affects only a few people out of 100,000. I believe, I hope, that science will soon be able to tackle this disease. But for now, this diagnosis is a death sentence. Maybe some of you are or will be associated with medic...
Please, read this, materials that contain signs of such discussions, be prepared for read-only mode and other, **UPD 1:** Friends, thank you very much for your attention. I read all the comments and am grateful

Full text and comments »

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

3.
By YouKn0wWho, 5 years ago, In English
Codeforces Round #752 #### UPD: (28 April, 2022) <spoiler summary="Donated Finally"> Details: [here](https://codeforces.me/blog/entry/96333?#comment-907470) </spoiler> আবার চলে এসেছি! (That's Bengali for "I am back! (in Terminator mode)") I am super excited to invite you to participate in [contest:1603] and [contest:1604] which will be held on [contest_time:1604]. This round is rated for both divisions. You will be given $6$ problems in each division and $2$ hours to solve them. All the problems are authored and prepared by me. I would like to thank - - [user:antontrygubO_o,2021-10-26] for his breathtaking(<strike>literally</strike>) coordination of the round. <i style="color:White;"> no funny text this time</i> - [user:Alpha_Q,2021-10-26], [user:Anachor,2021-10-26] and [user:antontrygubO_o,2021-10-26] for putting up with my dumb ranting and helping with the problems. - [user:Um_nik,2021-10-26], [user:gamegame,2021-10-26], [user:kefaa2,2021-10-26], [user:dorijanlendvaj,2021-10-26], [u...
highly encourage you to read all the problems. **Solve problems and help the poor!** Yes, you heard, strong. I highly encourage you to read all the problems.

Full text and comments »

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

4.
By Monogon, history, 6 years ago, In English
Codeforces Round #712 omg hi! I am pleased to invite you to participate in [contest:1503] and [contest:1504]! You will be given **6 problems** and **2 hours 15 minutes** to solve them. I'm happy to announce the theme of this round is déjà vu! I would like to thank the following people: - <a class="rated-user user-red" href="https://images.emojiterra.com/twitter/512px/1f921.png" title="The Entire Circus">antontrygubO_o</a> for accepting all of my problems <span style="color:white;">at gunpoint</span> - <a class="rated-user user-orange" href="/profile/Nika_Tamliani" title="Useless Tester Nika_Tamliani">Nika_Tamliani</a>, <a class="rated-user user-violet" href="/profile/arvindr9" title="Useless Tester arvindr9">arvindr9</a>, <a class="rated-user user-red" href="/profile/dorijanlendvaj" title="Useful Tester dorijanlendvaj">dorijanlendvaj</a>, <a class="rated-user user-blue" href="/profile/I_Love_YrNameCouldBeHere" title="Useful Tester I_Love_YrNameCouldBeHere">I_Love_YrNameCouldBeHere</a>, <a class="r...
"/>--> Make sure you read all problems, and I'm happy to announce the theme of this round is déjà vu, Make sure you read all problems, and I'm happy to announce the theme of this round is déjà vu! Good

Full text and comments »

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

5.
By tourist, 5 years ago, translation, In English
Codeforces Round #733 (Div. 1 + Div. 2) Hello, Codeforces! Welcome to the [contest:1530] that will start on [contest_time:1530]. It will be a combined rated round for both divisions. This round is a mirror of VK Cup 2021 Elimination. VK Cup is an annual championship for Russian-speaking competitors organized by VK &mdash; a social networking service based in Saint Petersburg and the most popular website in Russia. VK Cup [started in 2012](https://codeforces.me/vkcup2012) and has grown to be a four-track competition in competitive programming, ML, design, and mobile development. All the problems were authored and prepared by me. Big thanks to everyone without whom this round would not be possible: [user:PavelKunyavskiy,2021-07-16], [user:KAN,2021-07-16], [user:lperovskaya,2021-07-16], [user:ksun48,2021-07-16], [user:Sert,2021-07-16], [user:Aleks5d,2021-07-16], [user:MikeMirzayanov,2021-07-16]. You will be given 8 problems and 3 hours to solve them. It is recommended to read all the problems. Good luck! **UPD*...
problems and 3 hours to solve them. It is recommended to read all the problems. Good luck! **UPD, You will be given 8 problems and 3 hours to solve them. It is recommended to read all the problems

Full text and comments »

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

6.
By Ari, 6 years ago, In English
Codeforces Global Round 9 <img src="/predownloaded/2e/e2/2ee2f0f95f05aae6ca6f47812dae2dc2aabf277b.png" style="width:200px; float:right; margin: 0 1em 1em 1em"/> Hi! On [contest_time:1375] we will host [contest:1375]. It is the third round of a 2020 series of [Codeforces Global Rounds](/blog/entry/65002). The rounds are open and rated for everybody. The prizes for this round: - 30 best participants get a t-shirt. - 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive. The prizes for the 6-round series in 2020: - In each round top-100 participants get points according to the table. - The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest. - The best 20 participants over all series get sweatshirts and place certificates. Thanks to XTX, which in 2020 supported the global rounds initiative! The problems of this round were prepared by a team of authors: [user:adamant,2020-07-01], [user:anto...
read all of them :)

Full text and comments »

Announcement of Codeforces Global Round 9
  • Vote: I like it
  • +2693
  • Vote: I do not like it

7.
By Una_Shem, 5 years ago, In English
AlphaCode (DeepMind) Solves Programming Problems on Codeforces <img src="/predownloaded/99/08/99083f12762004fb2f7278177262dd577e3f19cd.png" style="float:right; width:300px; margin:0;"/> Hello, community. Today DeepMind announced a new achievement of AI. And it is directly related to what we love &mdash; programming problems. They have developed AI capable of solving some competitive programming problems! The future has arrived. You should read solutions of [user:SelectorUnlimited,2022-02-02], [user:WaggleCollide,2022-02-02], and [user:AngularNumeric,2022-02-02] solutions. All solutions are written automatically. The only input for writing solutions is a problem statement in English. Details can be read at the link https://deepmind.com/blog/article/Competitive-programming-with-AlphaCode Apparently, if these accounts would take part in real competitions, then their rating would be about 1300. <center> <img src="https://i.blogs.es/a2119c/terminator-2/1366_2000.jpg" style="width:450px;"/><br> <small>Terminator is ready to take p...
capable of solving some competitive programming problems! The future has arrived. You shouldread, Details can be read at the link https://deepmind.com/blog/article/Competitive-programming-with, You should read solutions of [user:SelectorUnlimited,2022-02-02], [user:WaggleCollide,2022-02-02

Full text and comments »

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

8.
By MikeMirzayanov, 8 years ago, In English
Codeforces: Our Steps After DDOS Attack Hello. As I wrote into a comment, last round we are faced with a strong DDOS-attack which ruined the competition. I don't know who did it, I also don't know reasons to do it. I'm very upset about the situation and ready to make an effort to be prepared for such issues. I spend a lot of time to be ready for such incidents. Here are steps you need to do to be ready for unexpected failures: * Join our telegram channel by the link https://t.me/codeforces_official to read urgent news. * Be sure that you know the password of your Codeforces account. If you don't remember it, just use <a href="https://codeforces.me/passwordRecovery">the password recovery feature</a>. Please, do it right now. * I've implemented a minimalistic website for replacing the main site in case of emergencies. Now you can only read problems, view your submissions (without any details), submit codes. Probably, later I'll add some more features, but anyway, the minimalistic version will have only vital fea...
* Join our telegram channel by the link https://t.me/codeforces_official to read urgent news. * Be, : * Join our telegram channel by the link https://t.me/codeforces_official to read urgent news

Full text and comments »

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

9.
By tourist, 10 years ago, translation, In English
VK Cup 2017 Round 3 + Codeforces Round #412 (Div. 1 + Div. 2) Hi everyone! The last elimination round of VK Cup 2017, Round 3, will take place on May 7 at 18:35 MSK ([check your timezone here](https://www.timeanddate.com/worldclock/fixedtime.html?msg=VK+Cup+Round+3&iso=20170507T1835&p1=352&ah=3)), along with separate Codeforces Round #412 for both divisions. All three rounds will be three hours long, and all three rounds will be rated. The contest "VK Cup 2017 — Round 3" is for teams qualified from Round 2 or Wildcard Round 2. The top 20 teams will advance to the final which will be held in July 2017 in Saint Petersburg! Huge thanks to [user:KAN,2017-05-06], [user:qwerty787788,2017-05-06], [user:PavelKunyavskiy,2017-05-06], [user:AlexFetisov,2017-05-07], [user:MikeMirzayanov,2017-05-06], and VK company for making this round possible. Codeforces will be the main character of most problems. Don't forget that it's useful to read the statements of all the problems. Good luck! As we're in year 2017, the scoring will obviously be stat...
. Codeforces will be the main character of most problems. Don't forget that it's useful toread the, Codeforces will be the main character of most problems. Don't forget that it's useful toread the

Full text and comments »

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

10.
By maomao90, history, 3 years ago, In English
Hello 2024 Hello Codeforces, We are very glad to invite you to participate in [contest:1919], which will start on [contest_time:1919]. You will be given **8 problems** and **2.5 hours** to solve them. One of the problems will be divided into two subtasks. The round will be rated for everyone. There will be at most 2024 interactive problems, so please read the [guide for interactive problems](https://codeforces.me/blog/entry/45307) before the contest. All the problems are written and prepared by me. <spoiler summary="Spoiler"> The first tester tested on 10 October **2022**. </spoiler> We would like to give our sincere thanks to: - [user:errorgorn,2024-01-02] for his wonderful coordination! - [user:Alexdat2000,2024-01-02] for translating problem statements. - [user:dario2994,2024-01-02] for coming up with the solution to one of the problems. - [user:conqueror_of_tourist,2024-01-02], [user:iLoveIOI,2024-01-02], [user:Um_nik,2024-01-02], [user:oolimry,2024-01-02], [user:thenymphs...
at most 2024 interactive problems, so please read the [guide for interactive problems](https, interactive problems, so please read the [guide for interactive problems](https://codeforces.me/blog/entry

Full text and comments »

Announcement of Hello 2024
  • Vote: I like it
  • +2422
  • Vote: I do not like it

11.
By Monogon, history, 7 years ago, In English
Codeforces Round #639 Hello, Codeforces! I'm very glad to invite you to [contest:1344] and [contest:1345]. This contest will take place on [contest_time:1344]. In both divisions, you will have **2 hours 15 minutes** to solve **6 problems**. The score distribution will be announced closer to the start of the contest. Of course, this round would not be possible without the help of many people, who I'd like to thank: - [user:isaf27,2020-05-01], for coordinating this round, and helping with solution ideas. - My ICPC teammates [user:Kuroni,2020-05-01] and [user:strongoier,2020-05-01], and coach [user:cn355,2020-05-01], for encouraging me to pursue competitive programming. In particular, I'd like to thank [user:Kuroni,2020-05-01] for being so spectacularly bad that a barely-orange user like myself actually has a place on our team. - [user:300iq,2020-05-01], [user:antontrygubO_o,2020-05-01], [user:Ari,2020-05-01], [user:ffao,2020-05-01], [user:fpc_coder,2020-05-01], [user:gamegame,2020-05-01], [user:Kur...
my best to write clear problem statements and strong pretests. Don't forget to read all problems, I've done my best to write clear problem statements and strong pretests. Don't forget toread all

Full text and comments »

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

12.
By YouKn0wWho, 5 years ago, In English
Codeforces Round #735 (Div. 2) কি অবস্থা মামা? (That's Bengali for "What's up dude?") I am super excited to invite you to participate in [contest:1554] which will be held on [contest_time:1554]. This round is rated for future LGM participants whose current rating is $\le 2099$. You will be given $5$ problems and $2$ hours to solve them. All the problems are authored and prepared by me. I would like to thank - - [user:antontrygubO_o,2021-07-20] for his awe-inspiring coordination of the round <i style="color:White;"> and rejecting my problems, and thus hurting my feelings.</i> - [user:Um_nik,2021-07-20], [user:_Ash__,2021-07-25], [user:Anachor,2021-07-20], [user:Arg_007,2021-07-20], [user:Alpha_Q,2021-07-20], [user:DAleksa,2021-07-20], [user:steinum,2021-07-20], [user:tasdid,2021-07-20], [user:border,2021-07-20], [user:mk_Shahriar,2021-07-20], [user:t17,2021-07-20], [user:imAnik,2021-07-20], [user:Alfeh,2021-07-20], [user:Aritra741,2021-07-20], [user:FrozenBlood,2021-07-20], [user:SajidZakaria,2021-07-20]...
have tried to make the pretests strong. I encourage you to read all the problemsand solve, read all the problems and solve them all.

Full text and comments »

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

13.
By Radewoosh, history, 8 years ago, In English
Hello 2019 Hello coders! I hope that you are enjoying the New Year as much as me. To make its beginning even greater, Codeforces is going to host a contest and I will be an author of all tasks. Hello 2019 will take place on [Friday](https://www.timeanddate.com/worldclock/fixedtime.html?day=4&month=1&year=2019&hour=17&min=35&sec=0&p1=166). Using the opportunity, I want to thank to: - [user:lewin,2019-01-02] and [user:mnbvmar,2019-01-02] for testing the round. - [user:mnbvmar,2019-01-02] for indescribably helpful discussions about problems. - [user:_kun_,2019-01-02] and [user:KAN,2019-01-02] for round coordination and help with preparation. - [user:MikeMirzayanov,2019-01-02] for such great platforms (you know which ones :P). The round will consist of 8 problems and you will be given <s>two and a half</s> three hours to solve them. Yes, the round will be **rated**. There will be no interactive problems, but if you want you can read [this](https://codeforces.me/blog/entry/45307) docum...
interactive problems, but if you want you can read [this](https://codeforces.me/blog/entry/45307, There will be no interactive problems, but if you want you can read [this](https://codeforces.com

Full text and comments »

Announcement of Hello 2019
  • Vote: I like it
  • +1910
  • Vote: I do not like it

14.
By BledDest, 3 years ago, In English
I don't want this to get normalized I don't think comments like "you use X in model solution, author, are you an idiot?", "f**k you and your problems, they are shit" and such should be normal on Codeforces, especially when written by someone high-rated and/or respected in the community. I also don't think this kind of behavior should be normal towards regular users. I know that sometimes contests can be frustrating. Sometimes it is the participant's fault, sometimes it is the problemsetter's fault, sometimes it just happens without anyone being guilty of that. And I understand that in some cases, the criticism the author receives is fair and well-deserved. But there is a fine line between criticism, saying that you didn't like the problems, and hurling insults against the author. The former two are acceptable (and sometimes even needed, because authors have to improve and learn from their mistakes); the latter one, in my opinion, should not be acceptable. It's not like we can ever get rid of offense and hatred ...

Full text and comments »

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

15.
By Radewoosh, history, 5 years ago, In English
My opinion on how to practice competitive programming I'm not very often replying to questions about how to practice, but as I'm getting enough of them (and I've just seen another blog about practicing) let me tell you about it. Of course, every time when you ask someone good about how to practice, he/she will reply to you to "solve a lot of problems" and that's true, there's no other way. Anyway, I've thought about it and actually I'm able to tell a bit more. I know some people, I've seen many people practicing (including me) and I have an opinion. Many people practice in some organized way. High schools organize IOI/OI training contests every Saturday, universities organize ICPC training contests once a week, people try by their own to solve three problems each day, websites host rounds and so on. Here's a secret: it's a sh*t. Yep, that's true. If you want to be really good and to make it happen you compete in a training once a week, you do it only to be able to make excuses "but I'm training so hard" when you see no progress. ...
strong and you want to read (or even participate) the problems from div3, which is definitely below, you are already quite strong and you want to read (or even participate) the problems from div3, which, Do you want to skip a training organized by the university and meet your friends/read a book/play

Full text and comments »

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

16.
By kuviman, history, 18 months ago, In English
Codeforces: Comment section improvements Hello everyone! Since recently I have rejoined Codeforces dev team. I worked on it before but had a break for some years. There is always a lot of work happening behind the scenes, invisible to the users, but sometimes it is nice to have visible updates on the website. Today, we have a couple improvements for the comment section. ### Changing/cancelling votes It happens sometimes that you click a wrong button, which can be annoying when voting for comments. Now it is possible to change your vote, or cancel it (but only during the first minute). ![ ](/predownloaded/93/9f/939f0a0899abd9496b8187d1c47112c472bba3ed.png) ### Hiding comments When reading comments it is sometimes useful to hide the comments. Maybe you have already read them, or you don't care about replies to a particular comment. So now you can toggle comment tree visibility with a single click. ![ ](/predownloaded/88/b1/88b100c73562e2d8304805a270daa3456fabbb9b.png) If you have an idea of a small...
sometimes useful to hide the comments. Maybe you have already read them, or you don't care about replies, When reading comments it is sometimes useful to hide the comments. Maybe you have alreadyread them

Full text and comments »

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

17.
By maspy, history, 4 months ago, In English
0 Problems Remaining [日本語記事(For Japanese Speakers)](https://maspypy.com/codeforces-all-ac) ---- Previous post: https://codeforces.me/blog/entry/150057 Submission: [submission:384239819] 2026/07/26 03:13:42 JST (2026/07/25 18:13:42 UTC) I have solved every problem in the Codeforces PROBLEMSET except for those for which I determined that obtaining an accepted verdict is impossible. ![unsolved problem list](https://maspypy.com/wp-content/uploads/2026/07/problemset.png) # Scope I considered the problems listed in the [PROBLEMSET](https://codeforces.me/problemset). I have solved very few problems from the [GYM](https://codeforces.me/gyms). The only collection I worked through systematically was the PROBLEMSET. I determined that it is theoretically impossible to obtain an accepted verdict for the following 31 problems: [problem:775A], ([92101](https://codeforces.me/problemset/problem/921/01) ... [92114](https://codeforces.me/problemset/problem/921/14)), [problem:927A], [prob...
Even when I did not read an editorial directly, there were also problems whose solutions I learned, However, even when I read an editorial, I generally tried to understand most of the solution and, read an editorial directly, there were also problems whose solutions I learned indirectly through

Full text and comments »

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

18.
By Monogon, history, 6 years ago, In English
Codeforces Round #658 Hello, Codeforces! I'm very glad to invite you to [contest:1381] and [contest:1382]. This contest will take place on [contest_time:1381]. In both divisions, you will have **2 hours** to solve **5 problems** (and one subtask). The score distribution will be announced closer to the start of the round. Huge thanks to: - [user:isaf27,2020-07-19] for excellent coordination of this round - [user:Andreii,2020-07-19], [user:antontrygubO_o,2020-07-19], [user:Ari,2020-07-19], [user:DeadlyCritic,2020-07-19], [user:gamegame,2020-07-19], [user:growup974,2020-07-19], [user:hugopm,2020-07-19], [user:Kuroni,2020-07-19], [user:NooB_MB,2020-07-19], [user:Priyank,2020-07-19], [user:SecondThread,2020-07-19], [user:--Someone--,2020-07-19], [user:talibmohd,2020-07-19], [user:WNG,2020-07-19] for testing the problems and providing useful feedback. - [user:MikeMirzayanov,2020-07-19] for providing Codeforces and Polygon platforms. I've worked hard to ensure the pretests are short and the statement...
statements are strong. Remember to only read the problems that you can solve, and may you have the best of, read the problems that you can solve, and may you have the best of luck!

Full text and comments »

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

19.
By ahmed_aly, history, 7 years ago, In English
Goodbye A2 Online Judge :( I'm sadly announcing that [a2oj.com](https://a2oj.com/) ([A2 Online Judge](https://www.facebook.com/A2OnlineJudge/)) will be retiring by end of 2019, I'll shut it down at midnight on New Year's Eve. It was something I took care of for about 10 years. I'm really sorry, but I prefer not to explain my reasons, so please don't ask me why I'm doing this, it was hard enough for me to make this decision, and also please don't try to convince me to change my mind. I'd like to say thank you to everyone who used it, and please accept my sincere apologies for shutting it down. If you have something good to say about A2OJ (how you used it or how it helped you in any way), I'd love to read that, please send it to the following email (or in a comment here): [email protected] Also please feel free to take a copy of any data you can access, and if you need some data in a specific format, please send your request to the following email: [email protected] (if the data isn't public, make sure to send f...
love to read that, please send it to the following email (or in a comment here): [email protected], something good to say about A2OJ (how you used it or how it helped you in any way), I'd love toread that

Full text and comments »

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

20.
By YuukiS, 11 months ago, In English
Good Bye 2025 <div style="overflow:hidden;"> <img src="/predownloaded/a2/4f/a24f8db165991fb983fc766d223782cbf2785f7f.png" style="float:right; width:200px; height:auto; margin-left:50px; margin-right:50px; border-radius:0px;" /> <h2>Merry Christmas, Codeforces! &#127876; &#127876; &#127876;</h2> <p> We are glad to invite you to take part in [contest:2178], which will start on [contest_time:2178]. You will be given <b>9 problems</b> and <b>3 hours</b> to solve them. <b>At least one problem will be interactive</b>, so please make sure to read the <a href="https://codeforces.me/blog/entry/45307">guide for interactive problems</a> before the contest. This round is open and rated for everyone. </p> <p> Problems are authored by [user:conqueror_of_tourist,2025-12-25], [user:twosquares,2025-12-25], and [user:YuukiS,2025-12-25]. </p> <p> We would like to thank: </p> </div> <div style="clear:both;"></div> - [user:Error_Yuan,2025-12-...
problem will be interactive, so please make sure to read the

Full text and comments »

Announcement of Good Bye 2025
  • Vote: I like it
  • +1689
  • Vote: I do not like it

21.
By Bakry, 4 years ago, In English
Red Isn't Impossible _I waited for more than a year to write this blog._ I started CP in July 2017, I always dreamed about reaching red, and it finally happened. I didn't become red like talented contestants in 1-2 years, but it took me more than that. The start of my CP journey was average (you can see my graph); It took me more than six months to reach pupil, then another six months to get specialist, and it took me more time to achieve higher ranks. I didn't have any mentor or coach. So, I asked many stupid questions, which you can find if you read my old blogs. One of these questions is, "What's the importance of Dynamic Programming?" (I drafted this blog xD), But of course, I don't motivate people to ask these types of questions as they usually can be answered by just searching. I failed many times during my journey in CP, especially in important competitions (IOI21 and IOI22). I stopped CP many times because I was frustrated and believed I could never improve. For example, I stopped when I w...
stupid questions, which you can find if you read my old blogs. One of these questions is, "What's the, read my old blogs. One of these questions is, "What's the importance of Dynamic Programming?" (I

Full text and comments »

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

22.
By Proof_by_QED, history, 13 months ago, In English
Testing Round 20 [Communication Problems] Hello Codeforces. We are introducing a new type of problem which may appear in future Codeforces rounds, called Communication problems! In these problems, your program would be ran twice, with different input and output formats between the runs. All variables stored in the memory will be lost between runs. However, the information given to you on the first run may be important to you for completing the second run correctly. Therefore, one of the key challenges in these types of problems would be to find a way to use the limited amount of output you are given in the first run to communicate information to the second run. Below shows a flowchart. <center> <br/> <img src="https://i.ibb.co/JWMFpyfY/a-1.png" alt="2025-09-06-12-40-07" border="0" /> <br/> Flowchart for communication problems </center> In these problems, time and memory limits for both runs would be kept separately. For example, if a problem has a time limit of $2$ seconds, you will only get the Time Limit E...
either run of your program. For these types of problems, it is especially important toread the, to read the problem statement carefully to ensure you are getting the input and interaction format, read [the guide for interactive problems](https://codeforces.me/blog/entry/45307) if you are

Full text and comments »

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

23.
By MikeMirzayanov, 9 years ago, translation, In English
New: Diagnostics of Solutions in C++ <img src = "/predownloaded/b5/d2/b5d246ffc32dfe82c3cbac77d1898c5fcb62fa57.jpg" style = "float: right; margin: 0 1em 1em 1em;"/> Hello! I am pleased to report that two rounds of Codeforces have gone quite well in terms of the work of Codeforces, I am very glad about it. These <s>days</s> nights I spent in a profiler, fixing the code, researching the settings of MariaDB. In addition, I managed to allocate several hours on Sunday (to be honest, until Monday morning) to finish the long-planned innovation. Meet, diagnostics of solutions in C++! Many Codeforces visitors are already tired of the questions of less experienced participants: "Why does my solution not work on some test on the Codeforces servers, if I locally launch it and it works correctly? You have the wrong compiler/servers!" In 99% of cases this is an example of <a href ="https://en.wikipedia.org/wiki/Undefined_behavior">undefined behavior</a> in a program. In other words, the program contains mistakes that, du...
", "signed numbers overflow", "uninitialized variable", etc. Carefully read the diagnosis and do not

Full text and comments »

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

24.
By -is-this-fft-, history, 5 years ago, In English
Self-deception: maybe why you're still grey after practicing every day I generally don't like to give much advice on "how to practice", but recently I have been thinking a lot about this and I realized that there is something that I believe affects a lot of people (though it is admittedly hard to tell) that barely gets talked about: self-deception. Self-deception is a devious thing. It can be very hard to detect, yet can be fatal to improvement. This blog is mainly directed to greys, greens and cyans that can't get out of these categories. Most examples are given with that in mind. That being said, I believe others have something to think about as well. This is my first blog on such "psychological issues" and I don't know if I'll ever make another one. It's certainly a difficult topic to write about because for most of the blog, the message is "your practice is not as good as you think it is" or even "you aren't as good as you think you are" which can of course be a hard thing to hear. Thus, I have to somehow be very gentle while getting the poin...
**ever** read the editorial. Stop asking "how many minutes" and start asking "should Iread the, everything you do. Read this blog carefully. More than once I have explained these ideas and people just, haven't solved it after $n$ minutes (or $n$ minutes with no ideas), read the editorial., video from Steve Jobs or Elon Musk with a bunch of genericisms about success or read some motivational, you're not meant to actually read them — they are in fact made to be read. The title and, $ minutes, then read the editorial., > But if I don't read editorials, how will I learn new techniques?, Read this blog carefully. More than once I have explained these ideas and people just walk away

Full text and comments »

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

25.
By antontrygubO_o, 7 years ago, In English
Good Bye 2019 Hello again, Codeforces! We are glad to invite you to <s>Mathforces</s> <s>Thinkforces</s> [Good Bye 2019](https://codeforces.me/contests/1270), which will take place on [contest_time:1270]. Some information about the round: <ul> <li>Rated for all participants!</li> <li>3 hours!</li> <li> <strong> No subtasks! </strong> </li> <li>There will be an <strong> interactive problem </strong> in this round. You can read the guide for interactive problems [here](https://codeforces.me/blog/entry/45307)</li> <li> Editorial will be published right after the system testing </li> </ul> All problems in this round were prepared by us, [user:antontrygubO_o,2019-12-28] and [user:kefaa2,2019-12-28]. We worked on this round for a long time and tried to make all the problems very interesting. We hope that you will enjoy the round! We would like to thank: <ul> <li> [user:arsijo,2019-12-24] for coordination of the round </li> <li> [user:GandalfTheGrey,2019-12-24] fo...
in this round. You can read the guide for interactive problems [here](https

Full text and comments »

Announcement of Good Bye 2019
  • Vote: I like it
  • +1517
  • Vote: I do not like it

26.
By MikeMirzayanov, history, 7 years ago, In English
Problem Ratings are Recalculated [May, 2020] Hi! As many have noticed, sometimes problem ratings were assigned in a strange way that was not consistent with expectations. For example, ratings for complex problems of Div3 rounds were often overestimated. This was mainly due to the fact that high-ranking unofficial participants did not try such problems. It turned out that despite the high rating of a participant, a problem is not solved by the participant, and this fact raised the rating of the problem. It is not entirely correct to take into account only official participants since ratings for difficult problems are sometimes more accurately determined by unofficial participants. Somewhere in the comments, I've read that problem ratings are set manually. Of course, this is not so. The process is automated, but I start it manually (I will fix it somehow). I changed the formulas for calculating problem ratings, now they slightly better correspond to expectations. New problem ratings are already available on the website. I ...
accurately determined by unofficial participants. Somewhere in the comments, I'veread that problem, Somewhere in the comments, I've read that problem ratings are set manually. Of course, this is not

Full text and comments »

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

27.
By Um_nik, history, 4 years ago, In English
Pro Tips - get them while they are free More tips to use while studying under my tutoring [here](https://um-nik.notion.site/Pro-Tips-8b923b0dc7c94770824bdf4184afc43c). ## Stop caring about the rating Unless there are prizes involved, your position in the standings makes no difference. I can feel awful after winning a contest if I know that I could solve one more problem. Or I can feel OK losing a bunch of rating points knowing that I solved everything I could.  Because rating is just a number. It is highly volatile and it depends on other people, not only on your skill. But solving problems is totally up to you. And you should evaluate yourself not based on some random metric, but on your honest feeling whether you performed up to your expectations. Your sense of self should be under your control, don't get hung up on some imaginary value, you cannot reduce your progress to a single number. ## Don't use more than one account Rating is just a number. Do not be afraid to lose your colour. You’ll get it back in no t...

Full text and comments »

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

28.
By awoo, history, 5 years ago, translation, In English
Educational Codeforces Round 121 [Rated for Div. 2] Hello Codeforces! On [contest_time:1626] [contest:1626] will start. Series of Educational Rounds continue being held as [Harbour.Space University](https://harbour.space/) initiative! You can read the details about the cooperation between [Harbour.Space University](https://harbour.space/) and Codeforces in the <a href="http://codeforces.me/blog/entry/51208">blog post</a>. This round will be **rated for the participants with rating lower than 2100**. It will be held on extended ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally. You will be given **6 or 7 problems** and **2 hours** to solve them. The problems were invented and prepared by Adilbek [user:adedalic,2022-01-15] Dalabaev, Vladimir [user:vovuh,2022-01-15] Petrov, Ivan [user:BledDest,2022-01-15] Androsov, Mak...
://harbour.space/) initiative! You can read the details about the cooperation between [Harbour.Space University, read the details about the cooperation between [Harbour.Space University](https://harbour.space/) and

Full text and comments »

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

29.
By Um_nik, history, 5 years ago, In English
How to practice Competitive Programming [Um_nik version] CP is about solving problems fast. And as absurd as it may sound, I believe that <span style="color:blue">SOLVE</span> and <span style="color:red">FAST</span> are very different and almost independent parts, and you need to practice them separately. Let’s look at some <span style="color:red">contest</span>, like a CodeForces round. For the sake of simplicity let’s assume that every problem has some *difficulty*, which is a numerical value denoting how hard it is, bigger values correspond to harder problems (it is not true, but it is an ok-ish approximation, at least if we consider subjective difficulty for a fixed person). Contests are made for a wide range of participants, and problemsetters strive to make contests interesting for a wide range of participants, which means having a *smooth difficulty gradient*. Well... as smooth as it is possible with 5-6 problems. <spoiler summary="Graph 1"> ![ ](https://s3.us-west-2.amazonaws.com/secure.notion-static.com/677e0ae2-a8df-4874-aff...
archive before reading the editorial? Like, 30 minutes? A: You don’t read the editorial. The best, minutes? A: You don’t read the editorial. The best option is to choose an archive that doesn’t have, , read them carefully, think a bit, choose the one I want to try and solve now, try for some time. If I, Q: Ok, but how do I learn new techniques if I don’t read editorials? I’m not supposed to invent

Full text and comments »

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

30.
By Errichto, 11 years ago, In English
Good Bye 2015 Hi everybody. The last round of the 2015 will take place on the 30-th of December ([starting time](http://www.timeanddate.com/worldclock/fixedtime.html?day=30&month=12&year=2015&hour=18&min=5&sec=0&p1=166)). The contest will last 3 hours. It won't be a usual round. Both divisions will compete together. You will get 8 problems to solve in 3 hours. Points will decrease slower than usually &mdash; otherwise you would get eps for solving a problem at the end. Scoring will be announced just before a contest. So will the speed of the points/minute loss. My goal was to provide you a diverse problemset with interesting problems for all contestants. During a contest you should consider reading not only the next problem but the few next ones. You will get this round thanks to work of many people. I am a problem setter. [user:GlebsHP,2015-12-28] helps me with everything (a lot). [user:AlexFetisov,2015-12-29], [user:johnasselta,2015-12-29] and [user:Zlobober,2015-12-29] are t...
! **EDITORIAL** Instead of refreshing standings you can read an [editorial](http://codeforces.me/blog, Instead of refreshing standings you can read an [editorial](http://codeforces.me/blog/entry/22441

Full text and comments »

Announcement of Good Bye 2015
  • Vote: I like it
  • +1387
  • Vote: I do not like it

31.
By Kuroni, history, 6 years ago, In English
Codeforces Round #715 <p style="text-align: right;"> <i> "Love" is a violent word.<br> "I love that about you..." Doesn't that just mean "If that changed, I wouldn't love you anymore?"<br> "Love" is a word that binds you.<br> — Touko Nanami — </i> </p> Hi Codeforces! [user:Ari,2021-04-13] and I are pleased to invite you to participate in [contest:1508] and [contest:1509], which will be held at [contest_time:1508]. Each division will have **6 problems** and **2 hours and 15 minutes** to solve them. Big thanks to the following people: - Sir [user:antontrygubO_o,2021-04-13] for being an amazing coordinator; the round wouldn't happen without you ❤️ - [user:Scrubpai,2021-04-13], [user:1-gon,2021-04-13], [user:hugopm,2021-04-13], [user:tfg,2021-04-13], [user:dorijanlendvaj,2021-04-13], [user:xuanquang1999,2021-04-13], [user:300iq,2021-04-13], [user:Mike4235,2021-04-13], [user:Luminal,2021-04-13], [user:QuangBuiYT,2021-04-13], [user:jamienguyen,2021-04-13], [user:Pichu,2021-04-13], [user:ch...
;) Please do read all of the problems, stay hydrated during the round, and solve as many as you can, Please do read all of the problems, stay hydrated during the round, and solve as many as you can

Full text and comments »

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

32.
By rng_58, history, 6 years ago, In English
AtCoder Library Recently, the number of algorithms and data structures we use in competitive programming are rapidly growing. It's a nice thing: by using more algorithms, the variety of possible problems gets wider, and we can enjoy more problems. On the other hand, before reaching adhoc, thinking-oriented part of this competition, we have to spend more and more time to learn algorithms. Sometimes a problem asks matching on general graphs; you have to find a paper describing it, read it, and implement its really complicated algorithm. Or sometimes you have to spend time tuning your library by a constant factor. Or sometimes you use multiple pre-written codes together, the variable names collide, and get annoyed. Until now, I basically rejected all problems that require pre-written codes of complicated algorithms because I don't like these things. For example, we never used segment trees with lazy propagation in our contests. However this way we can't use otherwise interesting problems and it ...
asks matching on general graphs; you have to find a paper describing it, read it, and implement its, ; you have to find a paper describing it, read it, and implement its really complicated algorithm. Or

Full text and comments »

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

33.
By MikeMirzayanov, history, 20 months ago, In English
My Reply on "Mike, please stop ignoring your userbase" This is a response to [this post](https://codeforces.me/blog/entry/141442). Originally, I intended to leave it as a comment, but the text turned out to be quite long. So I decided to publish it as a separate post. Hi! Let me start with the main idea: I don't think I ignore too many issues (though I do ignore some). In most cases, I do work on them, but these days I just don't feel like writing about it. That kind of communication takes a lot of energy &mdash; which I currently don't have. Oh, it looks like you edited the beginning of the blog, and now it triggers less of an internal protest in me. Honestly, lately I've been in a difficult emotional state, and I just don't have the energy or desire to interact much. It's not just about Codeforces &mdash; it's generally harder for me to engage than it used to be. I won't go into details (health, relocation, family issues, changes in the nature of my work due to bots) &mdash; all of that affects my mental state and willingne...
explain things, but I do read what's being said and try to make things better, bit by bit. Thanks, the low number of complaints (which I do read and use to adjust settings) suggests that many, /blog/entry/133113), and the low number of complaints (which I do read and use to adjust settings

Full text and comments »

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

34.
By MikeMirzayanov, history, 7 years ago, In English
About Division 4 Rounds Hello Codeforces! Initially, here was an announcement of the first round for the fourth division. But currently, in comments there is the huge discussion of division 4 rounds in general. Honestly, I read all (almost all) comments. I decided to replace the text of this post to match the comments better. Also, I'll write one more post separately to discuss problems. And this post will be about division 4 rounds in general. About Div4 rounds: * I'm not afraid of a queue or servers overload: it is technical challenges and my task is to resolve them. The previous biggest rounds were not overshadowed by technical problems and judging delays, they went well. I see no reasons why something should work much worse in the rounds for Div. 4 (and if it does, then this should be fixed). * I don't think that Div. 3 rounds are too dificult. Actually, they are quite good for beginners. They are noticeably easier than Div. 2. Almost every round trusted participants solve all problems, ma...
comments there is the huge discussion of division 4 rounds in general. Honestly, Iread all (almost, , I read all (almost all) comments. I decided to replace the text of this post to match the

Full text and comments »

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

35.
By MikeMirzayanov, 10 years ago, translation, In English
Codeforces: summing up 2016 year <center> <img src="http://assets.codeforces.com/images/Happy-New-Year-HD-Wallpapers.jpg"/> </center> Somehow it turns out that for me, each coming the New Year means more and more. This is an excellent opportunity to take stock, to breathe fresh air and to go through a kind of catharsis. This is a rare opportunity to be with the family, dress up in Santa Claus and just have fun. Holidays give me a clear criterion that I do the right things. If during the holidays, I begin to think about it, to recall some deferred ideas, eager to implement something new. So I’m doing right things. My things. And now exactly the same as in several recent years: during New Year holidays I write code for Codeforces, trying new technology or simply I’m making minor changes in testlib. It is necessary to me: at this moment are no deadlines, do not press the obligation. Just now, at 3 am, I can not break away from being able to do something new. I would like to take a moment and realize that spun in ...
Year! But you, please read this post entirely. It is important to me. It draws the symbolic line to, But you, please read this post entirely. It is important to me. It draws the symbolic line to me, ], [user:fcspartakm,2016-12-31] design features, write code, debug, do profiling,read logs, test. In

Full text and comments »

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

36.
By Ari, history, 5 years ago, In English
On Problems vs. Questions in Competitive Programming: My solution _TL;DR: The most reasonable solution to the problems vs. questions debate is to use none of the currently accepted terms._ As we have seen many times, particularly over the past few days, the task of assigning a label to the activities we perform as competitive programmers is a bigger problem than one might think at first. Time and time again we have seen people questioning what we should call our activities, often to the point of eliciting some rather harsh responses. To give some context to this discussion, I will focus on two of the terms that members of the community have adopted over the years, _problems_ and _questions_. (Sorry task lovers! You have some fine points for sure, we frequently talk about subtasks rather than subproblems or subquestions after all :P). All quotations here are posted anonymously, but if you want to claim ownership of one of them or have one removed, just tell me. If you are familiar with the arguments, feel free to skip to the final section of the...

Full text and comments »

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

37.
By Monogon, history, 6 years ago, In English
Codeforces Global Round 12 <img src="/predownloaded/2e/e2/2ee2f0f95f05aae6ca6f47812dae2dc2aabf277b.png" style="width:200px; float:right; margin: 0 1em 1em 1em"/> ¡Buenos días! (That's Spanish for "what's up homies") On [contest_time:1450] we will host [contest:1450]. It is the sixth round of a 2020 series of [Codeforces Global Rounds](/blog/entry/65002). The rounds are open and rated for everybody. The prizes for this round: - 30 best participants get a t-shirt. - 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive. The prizes for the 6-round series in 2020: - In each round top-100 participants get points according to the table. - The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest. - The best 20 participants over all series get sweatshirts and place certificates. Thanks to XTX, which in 2020 supported the global rounds initiative! The problems were written and prepared by smart Cu...
encourage you not to read all the problems., you not to read all the problems. May rating be distributed from each according to his ability

Full text and comments »

Announcement of Codeforces Global Round 12
  • Vote: I like it
  • +1239
  • Vote: I do not like it

38.
By MikeMirzayanov, 3 years ago, In English
Polygon: AI-Powered Automatic Tips Hello, Codeforces! <i>For the new members of the community, I would like to remind you that Polygon (https://polygon.codeforces.com/) is a system developed and maintained by Codeforces for preparing programming problems. It is there that authors and coordinators develop all the problems for the rounds. Moreover, I believe a significant (large?) portion of the problems for other competitions is also developed there: various stages of ICPC, national competitions of different levels, educational problems for various courses, etc. <b>In 2023, more than 50000 problems were prepared in Polygon (only those for which a package was compiled are counted)!</b></i> Large language models are becoming an increasingly integral part of our lives, taking over routine and monotonous tasks. With their help, problems created in Polygon will now have fewer typos and incorrect language constructions. We have recently implemented three features in Polygon to ease routine tasks: * Translati...

Full text and comments »

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

39.
By AmShZ, history, 6 years ago, In English
Codeforces Round #722 Hi Codeforces! [user:Dio,2021-05-22], [user:Keshi,2021-05-22], [user:Tet,2021-05-22], [user:alireza_kaviani,2021-05-22], [user:-Zeus-,2021-05-22], [user:alishahali1382,2021-05-22] and I are delighted to invite you to participate in [contest:1528] and [contest:1529], which will be held at [contest_time:1528]. Each division will have **6 problems** and **2 hours and 15 minutes** to solve them. The curse has finally been lifted! We are proud to announce that [user:antontrygubO_o,2021-05-22] didn't reject even a single task from the Div. 1 part! Huge thanks to the following people: - [user:antontrygubO_o,2021-05-22] for being an outstanding coordinator; This round wouldn't have happened if it weren't for him. - Our ever-growing army of testers [user:gamegame,2021-05-22], [user:Amoo_Safar,2021-05-22], [user:Atreus,2021-05-22], [user:dorijanlendvaj,2021-05-22], [user:aarr,2021-05-22], [user:1-gon,2021-05-22], [user:EnEm,2021-05-22], [user:N.N_2004,2021-05-22], [user:AaParsa,20...
Please read all of the problems and their notes, enjoy your time and solve as many as you can! Good, ]). Please read all of the problems and their notes, enjoy your time and solve as many as you can

Full text and comments »

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

40.
By zscoder, history, 7 years ago, In English
[Tutorial] Generating Functions in Competitive Programming (Part 1) Hi everyone! Inspired by the recent [Codeforces Round 641](https://codeforces.me/contest/1349), I decided to write an introductory tutorial on generating functions here. I am by no means an expert in generating functions so I will write about what I currently know about them. [user:MiFaFaOvO,2020-05-15] has written a really interesting [blog](https://codeforces.me/blog/entry/76447) here on Codeforces about more advanced applications of generating functions, but I think there is no English tutorial on the basics of this topic yet (or at least on CP sites). Thus, I would like to share about this topic here. I plan to split this tutorial into two parts. The first part (this post) will be an introduction to generating functions for those who have never learned about them at all, and some standard examples and showcases of generating functions. The second part will be a collection of several applications of generating functions in CP-style problems. If you are already familiar with ge...
and read off the answer! In this 2-part article, I will omit explaining how to do certain well-known, -k)!x^{k}$ and $E(x) = \displaystyle\sum_{k \ge 0}r_{k}(n-k)!(x-1)^{k}$. Hence, we canread $e_{j

Full text and comments »

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

41.
By Um_nik, history, 4 years ago, In English
Unimportant Um_nik Update Hello Codeforces! I have some big news. I am trying to fight depression and live a fuller life. That includes some self-realization, maybe even (I don't even want to think about it) a job. I love cp, and I love teaching, and I know I already tried that, but I believe that this is the way. With the help of my wife, I started to work on some related projects, and today we want to share them with the world. All of them are in the early stages, but we set a hard deadline for March 1, so... Um ================== Um... I am starting a series of educational YouTube videos / selected problems. Every episode of Um is focused on one problem. I will explain how to solve this problem and talk about some related concepts. The idea is to show off some cool concepts using real problems. The kicker: the problem is made public at least a week before the episode airs. So you can use Um as a source of problems. I will try to choose nice problems that highlight some ideas, and problems ...
don't want to break CF rules more than I already did, so... If you are interested,read the [tutoring, I don't want to break CF rules more than I already did, so... If you are interested,read the

Full text and comments »

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

42.
By antontrygubO_o, 7 years ago, translation, In English
Codeforces Round #580 ![ ](https://i.imgflip.com/3843mx.jpg) Hello again, Codeforces! I am glad to invite you to [Codeforces Round 580](https://codeforces.me/contests/1205,1206), which will take place on [contest_time:1205]. Round will be rated for both divisions. All problems in this round were created and prepared by me, [user:antontrygubO_o,2019-08-16]. I tried to make them interesting and hope that you will enjoy them! A lot of thanks to [user:arsijo,2019-06-29] for the excellent coordination of the round, [user:kefaa2,2019-06-29], [user:gepardo,2019-06-29], [user:danya.smelskiy,2019-08-16], [user:re_eVVorld,2019-08-16], [user:Xellos,2019-08-16], [user:GandalfTheGrey,2019-06-29], [user:prof.PVH,2019-08-16], [user:KAN,2019-08-16] for the testing and valuable comments, and to Mike [user:MikeMirzayanov,2019-06-29] Mirzayanov for the amazing platforms Codeforces и Polygon. Participants in each division will be offered 6 problems and 2 hours 10 minutes to solve them. As usual, I **strongly** ...

Full text and comments »

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

43.
By mnbvmar, 8 years ago, In English
Codeforces Round #556 Hi Codeforces! I'm so happy to invite you to [contest:1149] and [contest:1150]! The rounds will be held on [contest_time:1149]. The round will be rated for both divisions. (At least that's what I've been told!) The problems were written and prepared by me. Thanks to [user:300iq,2019-04-27] for the round coordination, and to [user:Radewoosh,2019-04-27] for his invaluable help with choosing the problemset and testing the problems! Also, I want to give a shout-out to [user:MikeMirzayanov,2019-04-27] for his amazing Codeforces and Polygon platforms! ![ ](http://students.mimuw.edu.pl/~ms360974/stuff/tab-bar2.png) _My browser's tab bar, right now._ You'll work on **5** problems, and you will have **2** hours to solve them. The scoring distribution will be revealed closer to the round. ~~~~~ def get_end_remark(): return random.choice([ "Wish everyone high ratings!", "Good luck!", "Have fun!", "Please, read all the problems!"]) ~~~...
!", "Good luck!", "Have fun!", "Please, read all the problems!"]) ~~~~~

Full text and comments »

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

44.
By dario2994, 6 years ago, In English
About Problemsetting (for AtCoder and Codeforces) Since the amount of information available about the preparation of a competitive programming contest for AtCoder/Codeforces is very little, I decided to collect here what was my experience. I will try to both describe my experiences and give some general advice to wannabe problemsetters. I hope that this will be useful to future problemsetters who are "out of the loop". Moreover, participants might be curious to know what happens behind the scenes (and maybe the platforms may consider this as a form of constructive feedback). *Acronyms*: - AGC = Atcoder Grand Contest - GR = Codeforces Global Round ### Why I know something about problemsetting? I am in the competitive programming world since ~8 years: I have participated in IOI/ICPC/GCJ and a number of contests on AtCoder/Codeforces (and lately Codechef). I am not a top participant but, being in this world for so long, I know, more or less, all the standard tricks. Recently, I was the author of the *flagship conte...
Since I really care about this blog (mostly because I would have loved to read something, The editorial should be a pleasure to read, should give insight into the solution, should provide a

Full text and comments »

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

45.
By MikeMirzayanov, 6 years ago, In English
Codeforces: Results of 2020 [list some changes and improvements] Hello, Codeforces! I understand that 2021 has been going on for a long time, but here I have picked up a subset of some of the improvements that the Codeforces team made in 2020. Soon I will publish numbers (no, charts) with statistics for 2020. In the meantime, I bring to your attention a list of changes and improvements. By the way, this is a decent list. This is about half to a quarter of all changes. It's just that other changes are more often somewhere in the internals of the system and are not visible to users. Please read this list. Each item is the effort of someone from the team. Thanks to [user:geranazavr555,2021-03-14], [user:kuviman,2021-03-14] and [user:cannor147,2021-03-14] for their efforts. You've made our platform better! Well, by the way, I don't quit programming and many improvements were made by me. The items on the list are written in a concise and informal form, many of the items I just copied from commit messages from git. If you want more details &mdash...
and are not visible to users. Please read this list. Each item is the effort of someone from the, . Please read this list. Each item is the effort of someone from the team. Thanks to

Full text and comments »

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

46.
By MikeMirzayanov, 5 years ago, In English
C++20 Is Released Hello, Codeforces. Please, welcome c++20 support on Codeforces. Yes, it is 64-bit. Thanks to Brecht Sanders: I used his distribution GCC-11.2.0-64 from https://winlibs.com/. If you have installed [PBOX](http://pbox.me/packages), you can add this compiler with the line `pbox install gcc11-64-winlibs`. Probably, a good idea is to add `C:\Programs\gcc11-64-winlibs\bin` into the PATH. More about PBOX you can read [here](https://codeforces.me/blog/entry/18274). I use the compilation command line similar to other GCC installations: `g++ -Wall -Wextra -Wconversion -static -DONLINE_JUDGE -Wl,--stack=268435456 -O2 -std=c++20 <source>`. The only differences are `-std=c++20` and `-Wall -Wextra -Wconversion` (I plan to use somehow such warnings in Polygon to suggest fixes in uploaded files). Now you can use c++20 in your solutions. I'm not sure there are many features useful in competitive programming. Probably, I'm wrong. For example, now you can write `vector v{vector{1, 2}};` inste...
about PBOX you can read [here](https://codeforces.me/blog/entry/18274). I use the compilation, the PATH. More about PBOX you can read [here](https://codeforces.me/blog/entry/18274).

Full text and comments »

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

47.
By AquaMoon, history, 5 years ago, In English
Codeforces Round #732 Hello, Codeforces! I'm glad to invite you to [contest:1545] and [contest:1546], which will be held on [contest_time:1545]. **Note the unusual start time of the round.** The round will be rated for both divisions. Each division will have **6 problems** and **2.5 hours** to solve them. There may or may not be an interactive problem, so I suggest you should read the [guide for interactive problems](https://codeforces.me/blog/entry/45307). All problems were written and prepared by [user:CoupDeGrace,2021-07-02], [user:kuangbin,2021-07-02], [user:mejiamejia,2021-07-02], [user:Heltion,2021-07-02], [user:Melacau,2021-07-02], [user:Nanako,2021-07-02], [user:GOATWU,2021-07-02], [user:Cirno_9baka,2021-07-02], [user:Suiseiseki,2021-07-02], [user:ODT,2021-07-02], [user:box,2021-07-03], [user:Ynoi,2021-07-02], [user:syh0313,2021-07-02], [user:wh0816,2021-07-02] and me. And thanks to [user:QAQAutoMaton,2021-07-02], [user:gamegame,2021-07-02], [user:starusc,2021-07-02], [user:interesting...
** to solve them. There may or may not be an interactive problem, so I suggest you shouldread the

Full text and comments »

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

48.
By vovuh, history, 6 years ago, In English
My thoughts on clarifications and on the round #677. Alright, I'm done. I wanted to write a blog like that for a long time, but now I really don't have enough patience to ignore this issue anymore. I want to say that I get 100-200 clarifications each Div.3 round. It doesn't even matter how well the statements are, it doesn't matter if there are any issues with solutions or checkers, people always find what to ask. Before I start whining here, I really want to recommend anyone to read these two [user:Um_nik,2020-10-20] blogs: [this one](https://codeforces.me/blog/entry/62730) and [this one](https://codeforces.me/blog/entry/62744). Sorry, [user:Um_nik,2020-10-20], I unnecessarily tagged you, I will not do that anymore. Now some breaking news for most participants: _your local IDE compiler_ and _Codeforces compiler_ are **actually** different things! If your code works fine locally but gets WA/TL/RE/ML/etc on Codeforces, it (most probably) means you have a bug somewhere in your code. There are rare cases when the issue is with comp...
$50$ questions about this and just answered "read the global announcement". $50$ times. I wasted like, already partially prepared. I read the statement, wrote the solution and it matched my understanding of, really want to recommend anyone to read these two [user:Um_nik,2020-10-20] blogs: [this one](https, $. The thing I want to recommend here: read [user:Um_nik,2020-10-20] blogs. Whoops, unnecessary tag, And, in conclusion, I want to recommend you: read [user:Um_nik,2020-10-20] blogs (whoops). He did, Before I start whining here, I really want to recommend anyone to read these two [user:Um_nik,2020, I'm done. Thank you for reading if you had patience to read all my whining. Feel free to blame me

Full text and comments »

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

49.
By -is-this-fft-, history, 5 years ago, In English
[Tutorial] Collection of little techniques #### Introduction There are a number of "small" algorithms and facts that come up again and again in problems. I feel like there I have had to explain them many times, partly because there are no blogs about them. On the other hand, writing a blog about them is also weird because there is not that much to be said. To settle these things "once and for all", I decided to write my own list about about common "small tricks" that don't really warrant a full tutorial because they can be adequately explained in a paragraph or two and there often isn't really anything to add except for padding. This blog is partly inspired by [user:adamant,2022-03-15]'s [blog](48417) from a few years ago. At first, I wanted to mimic adamant's blog structure exactly, but I found myself wanting to write longer paragraphs and using just bolded sentences as section headers got messy. Still, each section is short enough that it would not make much sense to write separate blogs about each of these things. A...
An exercise to the reader: why is it sufficient to consider the maximum pair $\left< t, s \right>$?

Full text and comments »

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

50.
By Errichto, 3 months ago, In English
Petition to Display Color of Max Rating In Codeforces, the nickname color depends on the current rating. I propose to use the historical max rating instead. The nickname color is not only a bragging right, but also a good heuristic when choosing which blogs to open in "Recent actions", and which posts to read when scrolling through many comments. Here's why I think that we should use max rating: 1. It's less random. 2. Current rating is nowadays more affected by AI cheaters. 3. There will be less incentive to create a second account when you're afraid to drop below some threshold. 4. It will make recognizing others easier (because the color won't change often). 5. I don't want to be orange.
blogs to open in "Recent actions", and which posts to read when scrolling through many comments. Here's, when choosing which blogs to open in "Recent actions", and which posts to read when scrolling through

Full text and comments »

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

51.
By KAN, 6 years ago, In English
How to set a Div. 1 or a Div. 2 round on Codeforces As you probably know, most of the rounds on Codeforces are created by active community members. We are very grateful to our talented authors from all around the world for bringing their ideas to tens of thousands of competitors, providing fun and learning experience for contestants of every expertise, from beginners to the world's top programmers. This post will cover the steps you need to take propose a round and become a problem writer on Codeforces. ## Who can be a problem author Best problems usually come from the most experienced participants. We have limited resources for rounds reviewing, so to make the process flawless for writers, starting January 1st, 2021, the following requirements for problem authors will be applied: - rating: 2100 or above, or - was a writer in the past. The restrictions may be updated in the future, the post will be updated accordingly. If your round is already in the review status, don't worry, it will be reviewed regardless of the current...
working on problems, even if you have experience working with Polygon, you must read [these rules](/r, read [these rules](/r/authors-polygon-rules). All the work with checkers, validators, interactors, and

Full text and comments »

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

52.
By MikeMirzayanov, history, 7 years ago, In English
New: Diagnostics of Solutions in C++ (Better UI) Hello, Do you remember my post <a href="/blog/entry/55902">New: Diagnostics of Solutions in C++</a>? If not, please read it. Recently, I've implemented better UI to show you diagnostics. Now in on the status pages sometimes you can notice something like this: ![ ](/predownloaded/13/b9/13b9e43f515630be3a11de9a4f9141acc5df35fd.png) Click to the ![ ](https://sta.codeforces.com/s/95227/images/icons/attention-16x16.png) and you'll see the code with the highlighted problematic line and description with the possible reason of the mistake. ![ ](/predownloaded/52/7a/527ad11817af463f7c27c224e45c93f3ca306cb0.png) Do you like it?
not, please read it.

Full text and comments »

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

53.
By Mangooste, history, 5 years ago, translation, In English
Codeforces Global Round 19 Hello, Codeforces! (づ。◕‿‿◕。)づ ❤ On [contest_time:1637] we will host [contest:1637]. **<img src="/predownloaded/2e/e2/2ee2f0f95f05aae6ca6f47812dae2dc2aabf277b.png" style="width: 200.0px;float: right;margin: 0 1.0em 1.0em 1.0em;max-width: 100.0%;max-height: 100.0%;">** It is the first round of a 2022 series of [Codeforces Global Rounds](https://codeforces.me/blog/entry/65002) supported by XTX Markets. The rounds are open and rated for everybody. The presents for this round: - 30 best participants get a t-shirt. - 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive. The presents for the 6-round series in 2022: - In each round top-100 participants get points according to the [table](https://pastebin.com/QT5sXEaT). - The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest. - The best 20 participants over all series get sweatshirts and place certificates. The problems w...
You will have 2.5 hours to solve 8 problems. And we recommend you to read all the problems!

Full text and comments »

Announcement of Codeforces Global Round 19
  • Vote: I like it
  • +1029
  • Vote: I do not like it

54.
By EvenImage, history, 7 years ago, In English
A problem collection of ODE and differential technique ##A problem collection of ODE and differential technique *This problem might be well-known in some countries, but how do other countries learn about such problems if nobody poses them.* For those who are interested in well-known problems in China. Thank [user:Elegia,2020-04-23] and [user:djq_cpp,2020-04-23] for developing this technique. Thank [user:tEMMIE.w.,2020-04-23] for reviewing this article. ####[Chain Reaction](http://uoj.ac/problem/50) in UOJ Round 3 By [user:vfleaking,2020-04-23] **Statement** ​ You are given a set $A$, you need to compute $g_{i} = \frac{1}{2} \sum_{j,k}{i-1 \choose j}{i-1-j \choose k} g_jg_k$ where $i-1-j-k \in A$. **Solution** ​ Let the EGF of $g$ be $x(t)$ and EGF of $A$ be $a(t)$. Thus $x'(t)=\frac{1}{2} a(t) x^2(t)+1$. We can solve this equation by D&C and FFT in $O(n\log^2 n)$. But there is a <s>slower</s> solution in $O(n\log n)$. ​ For a polynomial equation $f(x(t))=0$, we can use the Newton's method to solve it. If we find ...
} \log n)$. You can also read the discussion and implementation of the Brent-Kung algorithm [here

Full text and comments »

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

55.
By Qingyu, 17 months ago, In English
About the Universal Cup, the Semifinals, and myself... Hey'all! This gonna be a long post, so let me put an important TLDR here first: we are going to host **The 3rd Universal Cup Semifinals**, which will take place on August 24, 2025 **online**, at [11:00 (UTC)](https://www.timeanddate.com/worldclock/fixedtime.html?msg=The+3rd+Universal+Cup+Semifinals&iso=20250824T19&p1=33&ah=5). This contest will be a part of our Finals Team Selection, which the detailed rules and announcements will be published later next week. --- Now for some extra context, if you're interested. Last week, we hosted the [last online stage](https://codeforces.me/blog/entry/143954) of The 3rd Universal Cup. After that, I posted a [feedback form](https://docs.google.com/forms/d/1g5Txhiirh_lRsvGfkYWRozu0WDDGK31IAXjB7VgeVoM/edit) on our discord server. I received lots of thoughtful responses (P.S — it's still open, so feel free to fill it out if you haven't yet!). I've read through all the feedback, and I'd like to share a few thoughts. ### On the Number...
paragraphs. You may want to read my relevant passage [here in short](https://www.zhihu.com/question, I've read through all the feedback, and I'd like to share a few thoughts.

Full text and comments »

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

56.
By star_xingchen_c, 6 years ago, In English
Codeforces Global Round 13 Hello Codeforces! On [contest_time:1491] we will host [contest:1491]. **<img src="/predownloaded/2e/e2/2ee2f0f95f05aae6ca6f47812dae2dc2aabf277b.png" style="width: 200.0px;float: right;margin: 0 1.0em 1.0em 1.0em;max-width: 100.0%;max-height: 100.0%;">** It is the first round of a 2021 series of [Codeforces Global Rounds](https://codeforces.me/blog/entry/65002). The rounds are open and rated for everybody. The prizes for this round: - 30 best participants get a t-shirt. - 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive. The prizes for the 6-round series in 2021: - In each round top-100 participants get points according to the [table](https://pastebin.com/QT5sXEaT). - The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest. - The best 20 participants over all series get sweatshirts and place certificates. Thanks to XTX, which in 2021 supported the global rounds ...
You will have 3 hours to solve 9 problems. We encourage you to read all the problemsand

Full text and comments »

Announcement of Codeforces Global Round 13
  • Vote: I like it
  • +1092
  • Vote: I do not like it

57.
By pllk, history, 10 years ago, In English
Competitive Programmer's Handbook — a new book on competitive programming Competitive Programmer's Handbook is a new book on competitive programming, written by me. The book is still in progress but almost ready, and I decided to release it now for a wider audience. You can download the book here: https://cses.fi/book.html The book consists of 30 chapters and is divided into three parts. The first part discusses basic topics such as programming style, data structures and algorithm design. The second part deals with graph algorithms, and the third part introduces some more advanced techniques. The book assumes that the reader knows the basics of programming, but no background on competitive programming is required. I think that the book is useful for future IOI participants, as the book covers most topics in the IOI syllabus. The final version of the book will be ready later this year. The PDF version of the book will be available for free also in the future, and in addition, there will be a printed version that will cost something. Before t...
introduces some more advanced techniques. The book assumes that the reader knows the basics of, The book assumes that the reader knows the basics of programming, but no background on competitive

Full text and comments »

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

58.
By Um_nik, 8 years ago, In English
How to read problem statements But [user:Um_nik,2018-10-26], we all know how to read, we have our whooping 2 month of experience! Oh, my sweet summer child, my experiments show that many people with kinda cool achievements like medals on ROI don't know how to read statements. But don't worry, I'll teach you. Well, probably you won't understand anything, because you didn't try to understand anything in your life, you expect all hard work to be done for you by someone else. Let's start! Basic rules ================== - The result of reading the statement is usually pure math model. If story helps to build correct understanding, you can keep it, but still try to discard as many unnecessary details as possible. - Imagine you want to tell the problem to someone else. What parts you want to tell? (According to my PM, this rule won't help you). - Shorter = better. - Simpler = better. - Limitations are part of problem statement. Especially small limitations, because for small data you can try all the possib...
How to read problem statements, corner. Assumed workflow: read the statement on Timus, try to understand and simplify it using the, who read the problem statement. , . WHAAAT. Did you even read the statement, [user:Um_nik,2018-10-26]? There is something about rings, But [user:Um_nik,2018-10-26], we all know how to read, we have our whooping 2 month of experience

Full text and comments »

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

59.
By tourist, 5 years ago, translation, In English
VK Cup 2021 — Final (Engine) and Codeforces Round #740 Hello again! [contest:1563] starts very soon: on [contest_time:1563]. Today, [32 best contestants of the elimination round](https://codeforces.me/contest/1544/standings) will be fighting for cash prizes and eternal glory. You can follow the course of the contest and root for your favorite contestants [via this link](https://codeforces.me/spectator/ranklist/2488e608fc1223994a45bca34b4a2c51). Everyone except for VK Cup 2021 finalists is invited to [contest:1558] and [contest:1561] that start a couple of days later: on [contest_time:1558]. The rounds will be rated for everyone. All the problems were authored and prepared by me. Big thanks to everyone without whom this round would not be possible: [user:KAN,2021-08-22], [user:PavelKunyavskiy,2021-08-22], [user:scott_wu,2021-08-22], [user:xiaowuc1,2021-08-22], [user:1-gon,2021-08-22], [user:Aleks5d,2021-08-22], [user:lperovskaya,2021-08-22], [user:MikeMirzayanov,2021-08-22]. Special thanks to [user:s-quark,2021-08-22] ([2nd pl...
recommended to read all the problems. Good luck!

Full text and comments »

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

60.
By lotusblume, 16 months ago, In English
Worst-Case Graphs for Maximum Flow Algorithms Maximum flow algorithms are known to perform significantly better in practice than their worst-case time complexities would suggest. So in this blog, I will present graphs on which the following maximum flow algorithms actually achieve their worst-case running time: | Algorithm | Time Complexity | | ----------------------- | ------------------------------ | | Ford-Fulkerson with DFS | $\mathcal{O}\big(m^2 \cdot U)$ | | Edmonds-Karp | $\mathcal{O}\big(n \cdot m^2\big)$ | | Dinic | $\mathcal{O}\big(n^2 \cdot m\big)$ | | DFS with Scaling | $\mathcal{O}\big(m^2 \cdot \log(U)\big)$ | | Dinic with Scaling | $\mathcal{O}\big(n \cdot m \cdot \log(U)\big)$ | | Most Improving Augmenting Paths | $\mathcal{O}\big(m \cdot \log(U) \cdot (m + n \cdot \log(n))\big)$ | | FIFO Preflow Push | $\mathcal{O}\big(n^3\big)$ | | Highest-Label Preflow Push | $\mathcal{O}\big(n^2 \cdot \sqrt{m}\big)$ | Here and in the rest of this blog: - $n =$ number of vertices, ...

Full text and comments »

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

61.
By dreamoon_love_AA, 12 years ago, In English
Codeforces Round #292 Hello, everyone! Codeforces Round #292 will be held at [Feb/17/2015 19:30 MSK](http://timeanddate.com/worldclock/fixedtime.html?day=17&month=2&year=2015&hour=19&min=30&sec=0&p1=166). We're looking forward to your participation! The problems are from [user:dreamoon,2015-02-16], and thanks [user:Shik,2015-02-16] for some discussion. Also we want to thank [user:Zlobober,2015-02-16] for helping me prepare the round, [user:AlexFetisov,2015-02-16] and [user:winger,2015-02-16] for testing this round , [user:delinur,2015-02-16] for translating the statement into Russian, and [user:MikeMirzayanov,2015-02-16] for Codeforces and Polygon. This is first time I provide all problems for a Codeforces round. I hope you'll find it interesting! Please read all problem statements and discover what the main character [user:drazil,2015-02-16] do in those problems for he's really cute =) Finally, I would like to ask [user:sorry_dreamoon,2015-02-16] to participate this round. I believe everyone have ...
round. I hope you'll find it interesting! Please read all problem statements and discover what the, ! Please read all problem statements and discover what the main character [user:drazil,2015-02-16

Full text and comments »

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

62.
By Golovanov399, 7 years ago, In English
C++ tips and tricks Hello, codeforces. I would like to tell you about some tricks and constructions I use in C++. They are not hidden or anything, moreover, most of them are from stl or maybe well known among software engineers, but I often see codes where something is done by hand in, say, 5 lines, while in stl there is a function which does the same. The things below are filtered by my personal sense of non-popularity (so no `__builtin` functions) and usage frequency (so there almost surely are similar things I don't know about) and are not really sorted in any reasonable order. Let's begin. [cut] <hr> - ### `all(x)` This may be an exception to the rule of non-popularity -- this is quite widely used, but some next items will depend on `all(x)`, so I define it here. So, I talk about ```[c++] #define all(x) (x).begin(), (x).end() ``` Now sorting a vector looks like `sort(all(vec))` instead of `sort(vec.begin(), vec.end())`. However, it's not all about this define. Imagine you nee...
++ paradigm where you can just read stuff or maybe because `val (n, k) = readLine()!!.split(' ').map, , `fill_n`, `iota_n` and `generate_n` take the size as the second argument. So if you want toread, say, However, be careful! If `pts` is a vector of points, then it's really better to read it in the, My favourite: to read $n$ followed by $n$ numbers you can write

Full text and comments »

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

63.
By tourist, 9 years ago, In English
My strategy at AtCoder & CS Academy There's been much controversy lately about the late submission strategy not penalized by scoring systems of AtCoder and CS Academy. Most of the relevant discussion happened earlier at http://codeforces.me/blog/entry/53431 and http://codeforces.me/blog/entry/53449. I have a lot of thoughts on the topic, so I've decided to share them in a separate blog post. I really like the strategic part of programming competitions. Of course, problem solving is more important. But every contest consists of multiple problems, so there has to be a way of comparing participants which performed better at different problems. There's a huge variety of scoring rules, and I find it truly amusing. The "submit after solving all problems" strategy looks widely attributed to me now, mostly due to [user:Petr,2017-07-24]'s remarks regarding my participation in AtCoder contests. In my opinion, it's wrong for multiple reasons. A closer five-word description of my strategy is "implement after solvin...
last few contests: 1. Read all the problems. Usually starting with the last one, but it's not, . Clicking on the "Read Problems" button making the round rated for oneself requires a higher level of, 1. Read all the problems. Usually starting with the last one, but it's not important. 2. While

Full text and comments »

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

64.
By okwedook, 6 years ago, In English
Codeforces Round #703 (Div. 2) Hi, Codeforces! I finally get to return something to this great community, so I am glad to invite you to take part in [Codeforces Round #703 (Div. 2)](https://codeforces.me/contest/1486), which will take place on [contest_time:1486]. The round will be **rated for the participants with rating lower than 2100**. Participants from the first division are also welcomed to take part out of competition. You will be given **2 hours 15 minutes** to solve **6 problems**. All the problems were created and prepared by me. One of the problems is interactive, please read [the guide of interactive problems](https://codeforces.me/blog/entry/45307) before the contest. I would also like to thank: <ul> <li> [user:antontrygubO_o,2021-02-16] for excellent coordination! </li> <li> [user:1-gon,2021-02-16], [user:3EVEHAR_KOAVA,2021-02-16], [user:Akulyat,2021-02-16], [user:Aleks5d,2021-02-16], [user:BRCode,2021-02-16], [user:Osama_Alkhodairy,2021-02-16], [user:PO3OBAR_Bblnb,2021-02-16], [user:...
prepared by me. One of the problems is interactive, please read [the guide of interactive problems, Don't forget to read ALL the problems. I wish you good luck and high ratings!

Full text and comments »

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

65.
By errorgorn, 5 years ago, In English
Codeforces Global Round 20 On [contest_time:1672], we will host [contest:1672]. **Note the unusual timing, it is 30 minutes earlier.** <strong><img src="/predownloaded/2e/e2/2ee2f0f95f05aae6ca6f47812dae2dc2aabf277b.png" style="width: 200.0px;float: right;margin: 0 1.0em 1.0em 1.0em;max-width: 100.0%;max-height: 100.0%;"></strong> This is the second round of the 2022 series of [Codeforces Global Rounds](https://codeforces.me/blog/entry/65002). The rounds are open and rated for everybody. The prizes for this round: - 30 best participants get a t-shirt. - 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive. The prizes for the 6-round series in 2022: - In each round top-100 participants get points according to the [table](https://pastebin.com/QT5sXEaT). - The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest. - The best 20 participants over all series get sweatshirts and place certificates. T...
problem, we encourage you to read the editorial as you might learn something new from it.

Full text and comments »

Announcement of Codeforces Global Round 20
  • Vote: I like it
  • +861
  • Vote: I do not like it

66.
By wangmarui, history, 11 months ago, In English
Hello 2026 Happy new year, Codeforces! We are glad to invite you to take part in [contest:2183], which will start on [contest_time:2183]. You will be given **9 problems** and **3 hours** to solve them. **At least one problem will be interactive**, so please make sure to read the [guide for interactive problems](https://codeforces.me/blog/entry/45307) before the contest. This round is open and rated for everyone. Problems are authored by [user:wangmarui,2025-12-23], [user:Gold14526,2025-12-23], [user:Hoks_,2025-12-23], [user:Neil_Qian,2025-12-23], [user:Network_Error,2025-12-23], [user:jiazhichen844,2025-12-23] and [user:xvchongyv,2025-12-23]. We would like to thank: - [user:Um_Nik,2025-12-23] for pre-reviewing the round. - [user:Proof_by_QED,2025-12-23] for his wonderful coordination. - [user:Alexdat2000,2025-12-23] for Russian translation. - [user:Geothermal,2025-12-23], [user:StarSilk,2025-12-23], and [user:Dominater069,2025-12-23] for nutella testing. - [user:Mindeve...
interactive**, so please make sure to read the [guide for interactive problems](https://codeforces.com

Full text and comments »

Announcement of Hello 2026
  • Vote: I like it
  • +1039
  • Vote: I do not like it

67.
By Lewin, history, 9 years ago, In English
Good Bye 2017 Hello everyone! Another year has gone by. The last Codeforces contest of this year will be tomorrow, [29 Dec, 15:35 UTC](https://www.timeanddate.com/worldclock/fixedtime.html?day=29&month=12&year=2017&hour=18&min=35&sec=0&p1=166). The round details: - combined div1+div2 - 8 problems - 2.5 hours - rated!!! I'd like to thank the following people for helping with the round: [user:KAN,2017-12-28], [user:winger,2017-12-28], [user:AlexFetisov,2017-12-28], [user:zemen,2017-12-28], [user:xiaowuc1,2017-12-28], [user:MikeMirzayanov,2017-12-28]. Without them, this round would not have been possible. Scoring distribution will be posted later. Make sure to read ahead on the problems, since there may be some later problems that are easier for you. I hope to see you all at the contest, and good luck on the last chance to increase your rating this year! **EDIT1:** The scoring distribution is **500-750-1000-1750-1750-2000-2750-3500** **EDIT2:** There will be a five minute delay ...
been possible. Scoring distribution will be posted later. Make sure to read ahead on the problems, Scoring distribution will be posted later. Make sure to read ahead on the problems, since there may

Full text and comments »

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

68.
By ATSTNG, history, 7 years ago, In English
[Tutorial] Matroid intersection in simple words **[This article is also available in [Russian](https://codeforces.me/blog/entry/69287?locale=ru)]** Hello, CodeForces. I think that matroids are beautiful and powerful concept, however, not really well known in competitive programming. I’ve discovered matroids at 2019 Petrozavodsk Winter Training Camp. There was a problem that clearly cannot be solved using usual techniques I knew, editorial for this problem was just these three words “just matroid intersection”. Back then it took me more than 2 days of upsolving to find all the information and details I need and implement solution that gets Accepted on this. And it took way longer to actually understand why does it work and exactly how does it work. (I still hesitate in some details.) Of course, it is not hard to google up all the definitions and some related articles, but in my opinion they all are focused more on mathematical part of theory, strict proofs in some not really obvious but short ways, and observing only ke...

Full text and comments »

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

69.
By PinkieRabbit_buster, 3 years ago, In English
PinkieRabbit Cheated in Div. 1 Contest on Apr 27 I am writing to report an incident of cheating by PinkieRabbit during the recent contest 1965 on Codeforces. **PinkieRabbit asked help about problem D from others during the contest,** which is definitely against the contest rules. I have attached the evidence of the cheating behavior in the appendix, please read it. This evidence clearly shows the communications PinkieRabbit had with another person during the contest. It is a contest recording video published after contest by himself. As a former fan of PinkieRabbit, after seeing this video, I was shocked by how dishonest PinkieRabbit was. I believe such actions undermine the integrity of the competition and the platform as a whole. [user:win114514,2024-05-05] cheated by grouping up in contest 1905, finally punished by skipping. Therefore, I respectfully request that Codeforces take appropriate action against PinkieRabbit to maintain the fairness of the contests on Codeforces. He only cheated in one problem this round, so I sugg...
I have attached the evidence of the cheating behavior in the appendix, please read it. This, P: (m=) n*(n-1)/2, then I need to read m-1 numbers.

Full text and comments »

70.
By SanguineChameleon, history, 13 months ago, In English
I've (also) completed Project Euler ###_I've been dreaming of writing this for so long._ --- About 2 years ago, [user:Radewoosh,2025-10-22] posted a [blog](https://codeforces.me/blog/entry/122793) celebrating that he had solved all 865 problems on Project Euler. As a (naively optimistic) high-schooler back then, I thought to myself: _"Surely it can't be that hard, right?"_ 2 years later, there are now 965 problems, and I've solved all of them!! ![ ](/predownloaded/79/01/79019d6682d1c09808c1a205d72c4f4f838eccd8.png) ![ ](/predownloaded/98/f6/98f6fbe17d73c4691ad803c2d0725569c47d0cfb.png) --- I can’t even begin to describe how happy I am, and how wonderful the journey has been. Maybe I’ll write about it in another blog sometime. For now, I’ll answer some questions you might be thinking... ####_Literally, who asked?_ No one, of course. But this achievement means a lot to me, and I hope that this post inspires someone out there. ####_How long did it take?_ Kind of a difficult question to ans...
has changed my life. - [user:Radewoosh,2025-10-22], for writing the initial blog. If I hadn'tread

Full text and comments »

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

71.
By Wind_Eagle, 5 years ago, translation, In English
Codeforces Round #741. How contest author is entertaining. Hello, Codeforces! Not too long ago there was my second round, Codeforces #741 (Div. 2). Before it started, I wondered: surely there will be a lot of cheating on my round, just like on any other? So I decided to do something unusual. As you know from [a blog about cheaters] (https://codeforces.me/blog/entry/93893), it's easy to find telegram/youtube channels with cheaters. So I decided to find a couple and join them... So, the first telegram group I found was [link not available yet]. There weren't too many cheaters in it but they were, here's an example: <spoiler summary="Picture"> <a href="https://imgbb.com/"><img src="https://i.ibb.co/kJqMzMS/pic1.png" alt="pic1" border="0"></a> </spoiler> I joined this telegram group, and there was a meaningful dialogue: <spoiler summary="Picture"> <a href="https://ibb.co/1mC2csG"><img src="https://i.ibb.co/VqFB6HY/pic2.png" alt="pic2" border="0"></a> </spoiler> This may seem unbelievable, but the admin of the group actuall...
P.S. Do you think I should leave links to cheater groups/channels? I'll read the comments, and if

Full text and comments »

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

72.
By adamant, history, 18 months ago, In English
Complex FFT is not as bad as you think ... Probably. Hi everyone! As some of you _might_ already know, I don't like NTT. Primary reasons for this are: - I don't like modular arithmetic optimizations (Montgomery, etc). - I don't like NTT mods, and prefer good, old $10^9+7$. - I do like algebra of complex numbers. But, to my regret, the overwhelming mainstream in modern competitive programming is NTT. Primary reasons are: - It's allegedly faster. - It needs less memory. - It has no precision issues. - People don't like algebra of complex numbers. There is nothing I can do about the last, but today I'll address the first 3. Optimizing complex FFT was on my mind for quite some time, but I didn't really work on it _that much_ until the [blog](https://codeforces.me/blog/entry/142063) by [user:Qwerty1232,2025-04-24] on optimizing NTT has dropped, which motivated me to actually put some serious effort into this. In this blog, we will primarily focus on optimizations that are specific to complex arithmetic...
If you actually have read even a few paragraphs from the text above, thank you very much, you're my

Full text and comments »

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

73.
By tourist, 6 years ago, In English
touristreams are back! 006: SNSS 2020 R1, and more It's this time of the year again! Tune in at [twitch.tv/the__tourist](https://twitch.tv/the__tourist) at around [21:45 MSK, 21 Aug 2020](https://www.timeanddate.com/worldclock/fixedtime.html?msg=touristream+006&iso=20200821T2145&p1=3396) to watch me solving [SnarkNews Summer Series 2020 Round 1](https://contest.yandex.com/snss2020/contest/19320/enter) live! First I will do the round competitively without much interaction, and I'll be up for discussing the problems on stream afterwards. SnarkNews Winter/Summer Series (SNWS/SNSS) is organized by [user:snarknews,2020-08-19] yearly and consists of 5 rounds. Each round is a virtual 6-problem 80-minute contest open for 10 days. The series is open to all, but problem statements are in Russian only. Unlike last series, I'll be reading problem statements automatically translated to English on stream. To make the stream more fun and for easier understanding of what will be going on, you're welcome to do the round yourself beforehand! If...
automatic translators. Alternatively, you may just read the problems without solving them. In any case, may just read the problems without solving them. In any case, **don't discuss the problems in, read the problems beforehand.

Full text and comments »

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

74.
By Zhtluo, history, 3 years ago, In English
The Reason You are Bad at Codeforces — You are Not Russian Enough If you are triggered by this clickbaity blog title, you are probably interested in improving your Codeforces skills. Now, I will share my point of view on the differences between Codeforces and ICPC contests, and how you can, in my humble opinion, maximize your Codeforces rating gain. I mostly consider that all conceivable competitive programming problems need three aspects of skill: 1. Observation &mdash; the ability to understand the problem and come up with non-trivial properties. 2. Technique &mdash; the ability to apply a well-known algorithm or data structure to the problem. 3. Implementation &mdash; the ability to code fast and debug fast. Collaterally, I refer to these three skills as Russian-ness, Chinese-ness and American-ness, respectively, for reasons you will soon see below. ## Observation (Russian-ness) Observation means that you stare at some problem for a sufficient amount of time and you are able to reduce it to some easier problem. One good proble...

Full text and comments »

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

75.
By pashka, 6 years ago, In English
EDU: Segment Tree, part 1 Hello everyone! I just published a [new lesson](https://codeforces.me/edu/course/2/lesson/4) in the EDU section. This is the first part of the lesson about the segment tree. <img src="/predownloaded/ad/f8/adf89a39c4a3c646e9b047bc1e24e894a01034d4.png"/> In this lesson, we will learn how to build a simple segment tree (without mass modifications), and how to perform basic operations on it. We will also discuss some tasks that can be solved using the segment tree. <center style="margin:2.5em;"> <a href="/edu/courses" style="text-decoration:none; font-size:18px; background-color:#01579B; color:white; font-weight:bold; padding:0.5em 1em;">Go to EDU &rarr;</a> </center> More about EDU section you can read in [this](/blog/entry/79530) post. Hope it will be helpful, enjoy!
about EDU section you can read in [this](/blog/entry/79530) post. Hope it will be helpful, enjoy!, More about EDU section you can read in [this](/blog/entry/79530) post.

Full text and comments »

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

76.
By -is-this-fft-, history, 6 years ago, In English
How to ask for help in PM There was a blog today with a similar title, and although it was (I think, not really sure as I didn't get a good look) some kind of satire/joke blog, I wanted to post some serious advice about things I (don't) like to see when people are PMing me. However I decided that this wouldn't be in the spirit of the blog and decided to make a separate blog. And now that blog is deleted anyway. While it's not a bad thing to write messages to more experienced users, most people who write me do things that make them very difficult to deal with. These are my opinions, but somewhy I feel that many reds will agree. Some things here feel silly to write because they are so obvious. But I'm only writing them because people regularly mess them up. [cut] $~$ ####Use punctuation and spelling. There are some [very simple rules](https://codeforces.me/blog/entry/82186#comment-689836) that make your messages infinitely more readable. I find it especially strange when many of these messagers call...
, complex algorithms use many simple algorithms as subroutines. And you should be able toread some quite, - you know what complexity is and - you read/print input efficiently (`sync_with_stdio` and

Full text and comments »

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

77.
By cjj490168650, history, 4 years ago, In English
[Repost] "Justice may be delayed, but it cannot be absent": New Evidence on NXIST's Cheating Scandal _Original post: [「正义可以迟来但不能缺席」:关于 NXIST 的一些新证据](https://zhuanlan.zhihu.com/p/620297880)_ _Translated by GPT-4 with some adjustment. Please inform me if there are any mistakes._ _All links to the invalid repository have been redirected to the backup repository._ **This article provides a logically complete set of evidence, which does not involve any non-public internet resources, regarding the "suspected cheating" incident involving the ICPC Yinchuan Station and ICPC Shenyang Station in 2021. By discovering the suspected GitHub account ([NaokiLH](https://github.com/NaokiLH), renamed to https://github.com/brokenTarget) of a team member from Ningxia Institute of Science and Technology (NXIST) TS 1 team, Lan Hao, two years ago, and by mining and analyzing the commit records of his algorithm competition repo, we have obtained direct evidence that at least 4 questions from the 2021 Yinchuan regional contest set and at least 6 questions (including scrapped questions) from the 2021 Sh...

Full text and comments »

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

78.
By MikeMirzayanov, history, 10 years ago, translation, In English
Codeforces: С++14 is supported I am glad to inform you that C++14 has been added to the list of supported languages ​​on Codeforces. The choice fell on the compiler MinGW-w64, version of GCC 6.2.0 (will be updated on new releases). If you have Windows, you can easlily install it using <a href="http://pbox.me">PBOX</a> with one command `pbox install mingw-w64`. Besides trendy features of C++14 (not sure there's a lot to the contests), there are some advantages: * this compiler is faster than mingw-tdm 5.1.0 on cin/cout &mdash; for example, reverse a sequence of $10^6$ integers from 1 to $10^6$ runs 1.5 seconds instead of 2.5 (0.3 vs. 1 if you use `std :: ios :: sync_with_stdio (false)`) * works correctly to print a double with the both specifiers %f and %lf (you should read using %lf) * works correctly to read-write long double with the specifier %Lf * works correctly to read-write long long both with %lld and %I64d It seems that lately we remove support of MinGW C++/C++11 (especially since it is diffic...
%lf (you should read using %lf) * works correctly to read-write long double with the specifier %Lf, double with the both specifiers %f and %lf (you should read using %lf) * works correctly toread

Full text and comments »

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

79.
By Balajiganapathi, history, 11 years ago, In English
ICPC Regionals — The Chennai flood and the Asia Director Background ---------- One of the regionals in India was scheduled to be held at [Hindustan University](http://icpc.hindustanuniv.ac.in/) at Chennai on December 17 &mdash; 18, 2015. Unfortunately Chennai was stuck by a [natural disaster](https://en.wikipedia.org/wiki/2015_South_Indian_floods). The entire south India received heavy rainfall and hence there was a lot of flooding at many places including Chennai around that time. Atleast 347 people died in the state of Tamil Nadu (where Chennai is located). The damage due to the floods overall in south India is estimated to be atleast USD 3 Billion. It is the costliest flood in 2015. Ofcourse, due to this the Chennai regionals was postponed. I think everyone here will agree that this was an unexpected, unprecedent situation and hence it was entirely understandable that the regionals was postponed. The Blog post ------------- Dr. C J Hwang is the ICPC Asia director. In response to the above postponement he posted a blog article...
postponement he posted a blog article on his blog. [You can read it here](http://blog.sina.com.cn/s, You can read the actual rule in the blog itself. Rules are generally passed by a vote. Here is the

Full text and comments »

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

80.
By ScarletS, 5 years ago, In English
Codeforces Round #742 (Div. 2) Hey there Codeforces! [user:flamestorm,2021-09-01] and I are glad to invite you to our first-ever Codeforces round, [contest:1567], which will be held on [contest_time:1567]. **This round will be rated for participants with rating lower than 2100**. Special shoutouts to: - [user:adedalic,2021-09-01], for his fantastic coordination and translation of the round! - [user:MikeMirzayanov,2021-09-01], for creating the amazing Codeforces and Polygon platforms! - [user:dorijanlendvaj,2021-09-01], [user:awoo,2021-09-01], [user:YouKn0wWho,2021-09-01], [user:PurpleCrayon,2021-09-01], [user:shxgun,2021-09-01], [user:ijxjdjd,2021-09-01], [user:stefdasca,2021-09-01], [user:epicxtroll,2021-09-01], [user:Aaeria,2021-09-01], [user:Eyed,2021-09-01], [user:rkm62,2021-09-01], [user:Shinchan01,2021-09-02], [user:BRCode,2021-09-02], [user:namanbansal013,2021-09-05], [user:Urvuk3,2021-09-01], [user:1_2_oatmeal,2021-09-01], [user:richy6,2021-09-01], and [user:tdpencil,2021-09-01] for testing th...
will be interactive.** Make sure to read [this blog](https://codeforces.me/blog/entry/45307) and

Full text and comments »

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

81.
By Geothermal, history, 6 years ago, In English
Remove Virtual Contestants from Contest Leaderboards As most of you are likely aware, cheating in virtual contests (typically by submitting prewritten or copied solutions in order to appear at the top of the leaderboard) is very common. Most recently, [user:wannabecandidatemaster,2020-05-28] submitted solutions to all problems in [this round](https://codeforces.me/contest/1358/standings) in order to take first place in the standings, and [user:bemandrei,2020-05-28] competed virtually in [this round](https://codeforces.me/contest/1360/standings) after competing in the round officially, and ended up in second place on the leaderboard. In response to the rise of VC cheating (as well as some other issues with the VC system I'll describe below), I'd like to make a simple proposal: **Remove all virtual participants from the contest leaderboards.** The one exception is that you should see your own name on leaderboards for contests you VCed (that is, virtual contestants should be visible only to themselves). Similarly, virtual participan...
posts discussing techniques that came up in recent rounds; competitors who read an article inspired

Full text and comments »

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

82.
By Radewoosh, 8 years ago, In English
Blogewoosh #3 Hello, codeforces! This time I've decided to choose a task from my own contest which took place last April and was known as the Grand Prix of Poland. If you want to write this contest virtually in the future, then consider not reading this blog. If you've participated in this contest and maybe even solved this task, then anyway I recommend reading it, cause this task has many very different solutions, each of them being very interesting (in my opinion). It's also a reason why this blog is longer than previous ones. I'll write about task C "cutting tree" (not uploaded to the ejudge yet :/). The statement goes as follows: You are given a tree with $n$ vertices ($1 \leq n \leq 2 \cdot 10^5$). The task is to calculate $f(k)$ for each integer $k$ from the range $[1, n]$ where $f(k)$ is defined as the maximum number of connected components of size $k$ which we can "cut off" from the tree. A connected component of size $k$ is a set of $k$ vertices such that it's possible to traverse ...

Full text and comments »

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

83.
By Um_nik, history, 8 years ago, In English
Codeforces Round #485 (div.1+div.2) Hello! I'm glad to invite you all to Round 485 which will take place on [Tuesday, May 29 at 18:35 UTC+3](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Codeforces+Round+%23485&iso=20180529T1835&p1=166&ah=2). There will be 6 problems in each division, 3 of them are shared between divisions. 2 of div.2 problems created by [user:KAN,2018-05-28], 7 others created by me. The contest duration is 2 hours. My problems were originally used in HSE Championship. I would like to thank [user:Merkurev,2018-05-28] and [user:GlebsHP,2018-05-28] with whom I discussed the problems, [user:I_love_Tanya_Romanova,2018-05-28] for testing, [user:KAN,2018-05-28] for round coordination and Codeforces and Polygon team for these beautiful platforms. I would also like to thank HSE for organizing the event. Oh, and [user:kb.,2018-05-28] for writing great legend for one of the problems (he will be surprised). For those who for some reason like to know score distribution in advance: div.2: 5...
Good fun, have problems, read all the luck. As usual.

Full text and comments »

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

84.
By andreyv, 12 years ago, translation, In English
Catching silly mistakes with GCC As you know, the C++ language assumes that the programmer is always correct. Therefore C++ compilers don't add additional checks to the program, such as checks for null pointer dereference or out-of-bounds array access. This is good, because C++ programs run as fast as possible, and this is bad, because sometimes we may spend a long time debugging some silly mistake. We would want that the compiler can find such mistakes automatically. And many compilers can! In this post I will show various GCC options that do this. Previously [user:zakharvoit,2015-01-02] already wrote about this [here](/blog/entry/13875). All options that will follow should be added to the GCC command line. In various IDEs you can do it in IDE or compiler settings. Many of the options can also be used with Clang (for example, in Xcode). For MSVC++, I think, there is nothing better than Debug mode and `/W4`. [cut]   GCC warnings ------------------ Of course, the first step to debugging is to enable compi...
can read more about GCC warnings here: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

Full text and comments »

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

85.
By Radewoosh, history, 7 years ago, In English
Blogewoosh #7 Hello, codeforces! Long time no see, right? So maybe it's a good idea to try to return to my blogs slowly. This time the blog will be about a trick, which usually isn't necessary to solve a task, but can be useful to make implementation much more comfortable. Let's look at [this](https://codeforces.me/contest/932/problem/F) problem. It is about some DP on a tree in which we have to use convex hull trick to improve the complexity. The task requires merging two convex hulls with "smaller to bigger" trick. I recommend you to read the statement before reading the rest of the blog (and the [editorial](https://codeforces.me/blog/entry/57796) if you don't know how to solve it). [cut] $ $ So, how to merge two convex hulls? If we keep them in something like the set from C++, then we can just take every element from the smaller one and try to add it to the bigger one. Unfortunately, adding one element in this way requires some ifology and care. It's hard to implement it, especiall...
merging two convex hulls with "smaller to bigger" trick. I recommend you to read the statement before

Full text and comments »

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

86.
By shiven, history, 2 years ago, In English
A summary of what passes for an Indian ICPC Contest, apparently The online round for the India’s ICPC was held on 23rd. And also a week before that. The first time around, the organisers tried debuting a self-hosted DOMjudge instance. That didn’t go too well, so a recontest was scheduled on CodeChef. If you’re not too familiar with the Indian ICPC system — this online prelims is used to select teams that can participate in the offline regionals. From a single university, usually approx. 2 teams (for the top unis) or 1 (for almost all unis that aren’t in top-15) qualify. As you could guess, it’s quite easy for good teams to miss a spot. Looking at the first contest’s rankings, teams from rank 2 to 100+ all had 4 solves. Owing to severe system issues in the first contest, the time penalties weren’t too reliable differentiators, leading to the recontest this Saturday. In hindsight, we forgot to be grateful for the problemset and reliable testcases the first time. I’m sure everyone agrees that the basic requirements (ignoring all other stuff...

Full text and comments »

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

87.
By kpw29, 6 years ago, In English
Codeforces Round #683 by Meet IT (Div1, Div2) <img align="right" src="/predownloaded/5f/bf/5fbf2c3aae79d4f0d7e32a344f9478fb5ae825c2.png"> Hello, Codeforces! On behalf of Meet IT, I'm glad to invite you to ([Codeforces Round #683 by Meet IT (Div1, Div2)](https://codeforces.me/contests/1446,1447) which will take place [this Sunday (15th November)](https://www.timeanddate.com/worldclock/fixedtime.html?day=15&month=11&year=2020&hour=17&min=35&sec=0&p1=166). The round lasts 2.5 hours and is **rated** for both divisions. ### What is Meet IT? We are a family of enthusiastic and motivated young people passionate about programming and mathematics. We build a community where people learn together, motivate and help each other. <spoiler summary="Please expand the spoiler to find out more about us."> ### Our values - We teamwork, not compete, - Active learning is more effective than passive, - We all work on the same goal: a better education for everyone, - We don’t teach people; we show them how to discover b...
We **strongly** recommend to read all the problems. You have been warned :)

Full text and comments »

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

88.
By Tony2_CF, history, 11 months ago, In English
The Time Complexity Lower Bound for Segment Tree Beats is log^2 Original Post: https://jiry-2.blog.uoj.ac/blog/1404 The following content is translated by Gemini 2.5 Pro. ## Part 1: Introduction to the Hacking Method ### How to Map the Hack Sequence to a Segment Tree First, we are given a Hack sequence of length $len$. After $O(1)$ range addition operations and $\Theta(\log len)$ global $\text{chkmax}$ operations, this sequence becomes a cyclic shift (rotation) of the original sequence. Since a cyclic shift does not affect our range addition and global $\text{chkmax}$ operations (we can simply shift the indices for the range addition accordingly), we can consider the sequence as unchanged. If we have such a sequence, let $len=n^{\frac{1}{3}}$, and place such a sequence at intervals of $n^{\frac{2}{3}}$. Each sequence corresponds exactly to a segment tree interval. A subtree of size $n^{\frac{2}{3}}$ contains exactly one such segment tree interval. For the Hack sequence, the range addition operations are performed one by one on eac...
If you don't want to read further, you can directly look at an example for $n=3$.

Full text and comments »

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

89.
By -is-this-fft-, history, 5 years ago, In English
[Tutorial] The command line: how to read input from file without #ifdef and much more #### Introduction Instead of algorithms and math, I'll be doing something completely different here. There is something that has bothered me for a long time: people not understanding the tools they use to participate in contests and thus failing to take real advantage of them. And it all goes back to not understanding the command line. Some of you might say, "well surely, the command line is something obsolete and you're only clinging to it because you [insert ridiculous amateur-psychology here]?" No! The command line is not obsolete, and unless competitive programming becomes so mainstream that software vendors start writing professional-grade tools aimed specifically at us, it won't be. [cut] $~$ What is the command line? Any of these: ![ ](/predownloaded/bd/b6/bdb6c157b9b3ce5ae046c9064e469e0081f8c0fe.png) As you can see, it comes in many background colors and fonts, but the basic idea is always the same. It's a box you can type commands in, which it will ...
[Tutorial] The command line: how to read input from file without #ifdef and much more, be to read the input from a file, but now what you submit will be different from what you test, gondolas in a line and read the children in this order, then that will be an order for the children, -prone and very time-consuming. A better way would be to read the input from a file, but now what you, The better approach is to read input from files, but now you have a new problem: how do I make my

Full text and comments »

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

90.
By scott_wu, history, 7 years ago, In English
New contest format?! Stream feat. tourist, Um_nik Hey all! We've created a new 1v1 programming contest format: **Lockout**. Like in most contests, each round has a set of problems and contestants work to solve them as quickly as they can. In Lockout, however, contestants compete head-to-head and only the first contestant to solve each problem gets the points. Contestants can work on problems in any order, so speed and strategy are crucial to avoid getting sniped! The head-to-head action also makes the contest much more exciting for viewers. We ran the first edition of Lockout at TCO Finals last month as a double-elimination bracket [tournament](https://challonge.com/lockout0). All of the finalists who were available competed (and even some of the problem writers) and we got to see a lot of exciting back-and-forth matches! As you can see though, there's still one set left to play. So we'll be streaming **Grand Finals of Lockout 0 featuring [user:tourist,2019-12-28] vs. [user:Um_nik,2019-12-28]** at [9:30 AM PST](https://www.timea...
E, and try to win outright with either C or D afterwards? Read all the problems first and then

Full text and comments »

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

91.
By prvocislo, history, 4 years ago, In English
I Reached GM after 5 years Hello Codeforces! I did it! My main goal for 2022 was to reach red and I succeeded in the last contest of the year by getting +1 delta and going from cursed 2399 to 2400! I was very happy but scared to celebrate because I was worried that my rating would go down to 2399 again after the cheater removal. But now it’s 2401, so I think I’m safe now. Why am I writing this blog? I'm very excited about this achievement, it means a lot to me and I want to share my happiness with Codeforces. Also people ask me in DM quite often about how I got onto this level or who I am in general, so I think it's time to summarize it all into one blog post. Oh, wait… You don’t even know me, so why should you keep reading this blog post? Let me introduce myself a little first. I’m a high schooler from a small European country where few people do Codeforces. I love competing in OI and MO, I always did. One day, my father found the Codeforces website and suggested that I should start practicing there. At ...
who encouraged me along the way. And thank you, reader, if you actually read this whole thing. You, 5. Never quit the contest too early. Always at least read and attempt the following problem

Full text and comments »

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

92.
By zscoder, history, 10 years ago, In English
[Tutorial] Non-trivial DP Tricks and Techniques Hi everyone! Today I want to share some DP tricks and techniques that I have seen from some problems. I think this will be helpful for those who just started doing DP. Sometimes the tutorials are very brief and assumes the reader already understand the technique so it will be hard for people who are new to the technique to understand it. Note : You should know how to do basic DP before reading the post DP + Bitmasks ------------------ This is actually a very well-known technique and most people should already know this. This trick is usually used when one of the variables have very small constraints that can allow exponential solutions. The classic example is applying it to solve the Travelling Salesman Problem in $O(n^{2} \cdot 2^{n})$ time. We let $dp[i][j]$ be the minimum time needed to visit the vertices in the set denoted by $i$ and ending at vertex $j$. Note that $i$ will iterate through all possible subsets of the vertices and thus the number of states is $O(2^{n} \cdo...
that yields maximum results. If you have trouble with the naive dp, you can read the original, very brief and assumes the reader already understand the technique so it will be hard for people who, How do we get read of the $N$ factor and replace it with $K$ instead? We will use the following

Full text and comments »

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

93.
By thanhchauns2, 4 years ago, In English
Codeforces Round #812 (Div.2) Hi Codeforces! ================== [user:_dlbm17,2022-06-25], [user:Demen100ns,2022-06-25], [user:Spyofgame,2022-06-25] and I are delighted to invite you to participate in [Codeforces Round #812 (Div. 2)](https://codeforces.me/contests/1713). - Start time: [contest_time:1713] - Duration: **120 minutes**. - Number of tasks: **6**, including at least **one interactive** problem. Make sure to read [this blog](https://codeforces.me/blog/entry/45307) and familiarize yourself with these types of problem before the round! <spoiler summary="This contest is brought to you by:"> - <a href = "https://www.facebook.com/HocvienPTIT">PTIT</a>, my university. - <a href = "https://discord.gg/vKjE9xan">Code Mely</a>, a Vietnamese fanpage for Computer Science. </spoiler> <img align="right" src="https://i.ibb.co/VLCYnxH/received-1102672770650793-1.png" width="60%" height="60%"> Special thanks to: - <span>[user:errorgorn,2022-08-02] for wonderful coordination</span><span style="col...
**, including at least **one interactive** problem. Make sure to read [this blog](https://codeforces.me/blog

Full text and comments »

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

94.
By Um_nik, history, 5 years ago, In English
Changes in CodeChef Problemsetting Hello Codeforces! For the last half a year I have been working on CodeChef and was proposing ideas on how to change the problemsetting practices (hopefully, for the best). For some time the changes were in brainstorming phase, but as of now many of them are implemented. Today we are ready to share the information with you. But first I would like to approach people who are going to close this blog without reading: If you are not interested in CodeChef contests at all, I think you should change your mind. Monthly short contests (Cook-Off and Lunchtime) have interesting quality problems, on par with Codeforces in my opinion (not AtCoder level yet, but who are?). Long and Starters are more targeted to newbie participants, with more classical educational problems. If you are interested in setting problems for regular contests, you might want to do it on CodeChef. Some reasons: - You don't have to set the whole round, as we work on per problem basis. - This may be especially...
](https://www.codechef.com/problemsetting/new-ideas). But please read [this](https

Full text and comments »

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

95.
By Errichto, 6 years ago, In English
Matrix Exponentiation tutorial + training contest tl;dr &mdash; video tutorial https://www.youtube.com/watch?v=eMXNWcbw75E and codeforces GYM training https://codeforces.me/gym/102644 (register by finding this contest in GYM instead of using the link directly) video editorial: [part 1 (ABCDEF)](https://www.youtube.com/watch?v=kQuCOFzWoa0) and [part 2 (GHI)](https://www.youtube.com/watch?v=RA_SpxP2t54) codes to all 9 problems: https://github.com/Errichto/youtube/tree/master/matrix-exponentiation Prerequisites: binary exponentiation and iterative dp (you don't need to know matrices) The youtube tutorial ([link](https://www.youtube.com/watch?v=eMXNWcbw75E)) focuses on intuition and graph-like visualization . Or, if you prefer, below is a shorter (less detailed) text tutorial instead. You can practice by solving a set of 9 educational problems in GYM https://codeforces.me/gym/102644. ABCD are easy, EF medium, GHI are hard. If you are stuck, see hints below or watch the full solution analysis &mdash; [part 1 (ABCDEF)](https:...

Full text and comments »

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

96.
By -is-this-fft-, history, 2 years ago, In English
PSA on Meta Hacker Cup (must read if its your first time!) Meta Hacker Cup is upon us again. Along with it comes the unique format where we have to run our code on large test cases ourselves. Unfortunately, past experience shows that not everyone knows how to do this reliably. Usually, after the first round, many people lose points as a result of an unreliable workflow. This time, let's try to prevent that from happening. Sorry for the somewhat self-important title, but I really do wish that everyone understood this and that no one will fail the contest because of this. ### Don't EVER copy-paste huge files A lot of people's workflow to run a solution is the following: - Click some green button in the IDE - A box comes up, copy-paste the input into that box - The output shows up somewhere This may work well for running your solution on small sample test cases. It is **terrible** for running your solution on the huge test cases in Meta Hacker Cup. In last year's Round 1, the full test case for [problem C](https://www.facebook.com...
PSA on Meta Hacker Cup (must read if its your first time!), **Option 1.** Use pipes to read the input from a file and write the output to a file. For example, **Option 2.** Read the input from files directly. In your program, you can write, .** Use pipes to read the input from a file and write the output to a file. For example, `./program, Now, you can read from `fin` (e.g. `fin >> n >> m`) and write to `fout` (e.g. `fout << "Case

Full text and comments »

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

97.
By jeroenodb, history, 4 years ago, In English
Copied problem in Codeforces Round #819 (Div. 1 + Div. 2) and Grimoire of Code Annual Contest 2022 While solving random problems on DMOJ I found this problem: [Problem](https://dmoj.ca/problem/tle16c8p6), [Contest the problem appeared in](https://dmoj.ca/contest/tle16c8). I only read the statement and decided it was not for me, so I moved on. Today after the round I remembered this problem because it seemed similar to [problem:1726F]. Not only are the problems exactly the same, they even share the same sample and the explanation of the sample is also the same: ![ ](/predownloaded/0a/59/0a59ad1ce82dcc7d5193443b4801df327fb9aaf3.png) ![ ](/predownloaded/47/94/4794d5ba35c2ac6a04c57f5e5dd4e6a26477d93d.png) Together with the fact that [user:little_angel,2022-09-06] has solved this problem on DMOJ: ![ ](/predownloaded/83/c2/83c2381b0b945e59d4dc00138636999d8df6ea3d.png) I am convinced that the authors of [contest:1726] have purposefully copied the problem and didn't even try to hide it. I don't think the contest should be unrated, because the impact was not that big. But ...
/tle16c8p6), [Contest the problem appeared in](https://dmoj.ca/contest/tle16c8). I onlyread the statement

Full text and comments »

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

98.
By YouKn0wWho, 4 years ago, In English
[Tutorial] Common Mistakes in Competitive Programming and How to Avoid Them One thing is for sure. You do make mistakes. I also make miskates and that's what makes us human. But what we can surely do is &mdash; to try to minimize the errors that we make throughout our life. I have compiled some of the mistakes that I made in my early Competitive Programming phase. I also mentioned how to avoid them. Also, in most cases, I will give you a chance to find out what the bug is before I reveal the culprit as I tried to make this blog interactive. The codes that I have used in this blog have been written in C++ as it is the most used language for CP. **So, if you are new to CP, stick with me as you might don't wanna repeat the mistakes that I made when I was a beginner.** #### Mistake 1 Check out the following code: <spoiler summary="Code"> ~~~~~ #include<bits/stdc++.h> using namespace std; int main() { int a = 1000'000'000,b = 1000'000'000; long long product = a * b; cout << product << '\n'; return 0; } ~~~~~ </spoiler> The outp...

Full text and comments »

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

99.
By Bazoka13, history, 5 years ago, In English
Codeforces Round #738 (Div. 2) Hi Codeforces! We are glad to invite you to our first Codeforces Round [contest:1559] which will be held on [contest_time:1559]. This round will be **rated for participants with rating less than 2100**. We will be glad to see participants from the first division to join out of competition as well! In this round, as the best friend of Mocha's, you are going to help her to solve the problems she meets. The problems are prepared by [user:2sozx,2021-08-12], [user:JJLeo,2021-08-12], [user:Serval,2021-08-12], [user:CalvinJin,2021-08-12] and me. We hope you will enjoy the round. :P We would like to thank: - [user:1-gon,2021-08-12] for awesome coordination of this round and helping us improve our problems. - [user:Toxel,2021-08-12] for excellent testing and discussion of this round. - [user:cppascalinux,2021-08-12], [user:PurpleCrayon,2021-08-12], [user:ijxjdjd,2021-08-12], [user:m371,2021-08-12], [user:qxforever,2021-08-12], [user:fixed_lxy,2021-08-12], [user:HKvv,2021...
We recommend you to read the statements of all problems. Good luck & Have fun! :D

Full text and comments »

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

100.
By BlueSmoke, 7 years ago, In English
Codeforces Round #641 Hello, Codeforces! We are excited to invite you to [contest:1349] and [contest:1350]. This round will take place on [contest_time:1349]. In both divisions, you will have **2.5 hours** to solve **6 problems**. **Please notice the unusual time.** Problems of this round were prepared by [user:Fulisike,2020-05-04], [user:A.K.E.E.,2020-05-04], [user:mydiplomacy,2020-05-04] and me [user:ProgSlacking,2020-05-04]. We would like to express our sincere gratitude to: - [user:300iq,2020-05-04], for responsible and interesting coordination; - [user:WZYYN,2020-05-04], [user:Elegia,2020-05-04], [user:skip2004,2020-05-11], [user:vintage_Vlad_Makeev,2020-05-11], [user:fpdqwq,2020-05-04], [user:wangziji,2020-05-04], [user:Suika_predator,2020-05-04], [user:wrg0ababd,2020-05-04], [user:AcF-_-FcA,2020-05-04], [user:Kirill_from_Kazan,2020-05-04], [user:dysyn1314,2020-05-04], [user:xiaolou0411,2020-05-04], [user:LiM_256,2020-05-04], [user:HazyKnight,2020-05-04], [user:Sad_reacts_only,2020-05-0...

Full text and comments »

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

101.
By satyam343, 3 years ago, In English
think-cell Round 1 Hello, Codeforces! Welcome to the [contest:1930] supported by think-cell, which will start on [contest_time:1930]. It will be a combined rated round for both divisions. All problems were authored and prepared by [user:Elegia,2024-02-13] and [user:satyam343,2024-02-07]. We would like to thank: - [user:errorgorn,2024-02-13] for round coordination and help with preparation - [user:KAN,2024-02-17] for helping with the preparation of problems - [user:Alexdat2000,2024-02-13] for Russian translation - [user:GoatTamer,2024-02-17] and [user:Non-origination,2024-02-17] for discussing problems with us while our proposal was in review and testing the round. - [user:Kaitokid,2024-02-13], [user:antekb,2024-02-13], [user:vgtcross,2024-02-13], [user:riano_,2024-02-13], [user:mtw,2024-02-13], [user:AboAbdoMC,2024-02-13], [user:Vladithur,2024-02-13], [user:BERNARD,2024-02-13], [user:milind0110,2024-02-13], [user:conqueror_of_tourist,2024-02-13], [user:Um_nik,2024-02-13], [user:gamegame...
divided into two subtasks. One of the problems will be **interactive**. Make sure toread [this blog

Full text and comments »

Announcement of think-cell Round 1
  • Vote: I like it
  • +798
  • Vote: I do not like it

102.
By Um_nik, 8 years ago, In English
How not to read problem statements I wanted to write super-harsh blog but then I decided to split it into educational part and whining part. This is whining part. To read some cool stuff go [here](https://codeforces.me/blog/entry/62730). This one will also be educational on a slightly different topic. And there will be A LOT of harsh stuff. I'm not saying that I'm perfect. That round had some really bad problemsetting issues. Problem E was googleable, problem D had very weak tests against very stupid solution (so stupid that none of the authors and testers come up with it, moreover, it is so counter-intuitive that I don't know how so many people independently did it). In two constructive problems participants could look at jury's output, the feature of which I didn't know. And I'm sorry for these issues. BUT. [This comment](https://codeforces.me/blog/entry/62614#comment-466588) has very negative rating despite being so true. And no one are here to back me up. So I want to speak my truth as I always do. Let me ac...
How not to read problem statements, can answer "Read the problem statement", that should be the answer. If I can answer "No comments, part. This is whining part. To read some cool stuff go [here](https://codeforces.me/blog/entry, statement. This is a skill, you have to improve it. Read [my blog](https://codeforces.me/blog/entry, . The thing called "statement". Read it. Carefully. Why do you think that we will come up with better, read your questions? I like that "I can't solve the problem with operations in statement, can you

Full text and comments »

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

103.
By SecondThread, history, 7 years ago, In English
Why problem writers should stop saying “It is guaranteed that” Please Stop Guaranteeing Things ================== There are two common meanings for something being “guaranteed”, and often it is up to the reader to guess the author’s intended meaning. This is annoying and creates unnecessary barriers to entry. **Meaning #1:** The thing we are guaranteeing is provably true for the given input. The thing we are guaranteeing is simply true. We don’t want to provide a proof since it would be long, unnecessary, and annoying to read, and might spoil the solution, but you have our word that an answer always exists. Example: We give you two positive integers A and B (1 <= A, B <= 100). Find some positive integer C (1 <= C <= 200) such that C < A + B. **It is guaranteed that some C exists.** **Meaning #2:** The only input that is legal is input for which this is true. The thing we are guaranteeing might not always be true without this guarantee. Thankfully, we are providing this guarantee so that you only need to concern yourself with solving t...
, and annoying to read, and might spoil the solution, but you have our word that an answer always, There are two common meanings for something being “guaranteed”, and often it is up to thereader to

Full text and comments »

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

104.
By Errichto, 8 years ago, In English
Lecture #3 — Exchange arguments (sorting with dp) Hi. I'm back from USA! I will do a new lecture tomorrow (Thursday) at 2pm CEST on my Youtube channel: [https://www.youtube.com/watch?v=7hFWrKa6yRM](https://www.youtube.com/watch?v=7hFWrKa6yRM). Watch me live (and ask questions), or just watch the video later. This will be part 1, and I will do part 2 in a few days (maybe Tuesday). **UPDATE** &mdash; part 2 is coming on Thursday, same time. Link: [https://www.youtube.com/watch?v=gXxu-Cr4b4c](https://www.youtube.com/watch?v=gXxu-Cr4b4c). There are no prerequisites this time. I recommend reading the materials below in advance, and trying to solve problems 1 and 5. If you are strong, just read problems and see if you can't solve something (maybe problem 8?). ### Technique "Exchange Arguments" If we're given $n$ items and we should choose some of them and choose their order, we should sort them with some strange/tricky comparator, and then do $O(N^2)$ dynamic programming. The dp should be $dp[pref][used]$ &mdash; best po...
trying to solve problems 1 and 5. If you are strong, just read problems and see if you can't solve

Full text and comments »

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

105.
By Hemose, history, 5 years ago, In English
Codeforces Round #746 (Div. 2) صباحو (Good Morning), Codeforces! I'm glad to invite you to [contest:1592], which will be held on [contest_time:1592]. This round is rated for the participants with rating lower than 2100. You will be given **6 problems** and **2 hours** to solve them. All problems were prepared by me and [user:Bakry_,2021-10-01]. One of the problems will be interactive. So, it is recommended to read the [guide on interactive problems](https://codeforces.me/blog/entry/45307) before the round. I would like to thank: - [user:antontrygubO_o,2021-10-01], for a lot of things (awesome coordination, suggestion for one of the tasks, helping in preparation, rejecting only not interesting tasks, a lot of useful discussions). - [user:KostasKostil,2021-10-01] for one of the tasks and [user:antontrygubO_o,2021-10-01] for preparing it. - [user:YahiaSherif,2021-10-01], [user:ZeyadKhattab,2021-10-01], [user:mahmoudbadawy,2021-10-01], [user:Uzumaki_Narutoo,2021-10-01], [user:_zaher_,2021-10-01]...
One of the problems will be interactive. So, it is recommended to read the [guide on interactive, The statements are short and we have tried to make the pretests strong. I encourage you toread all

Full text and comments »

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

106.
By sevlll777, 4 years ago, translation, In English
Codeforces Round 860 (Div. 2) Hello Codeforces! I am happy to invite you to [contest:1798], which will be held on [contest_time:1798]. This round will be **rated for participants with rating lower than 2100**. Participants with a higher rating are invited to participate in the round unofficially. You will be given **6 problems** and **120 minutes** to solve them. All problems were authored and prepared by me. The traditional thanks-list to everyone who took part in the creation of the round: &#129332; [user:DishonoredRighteous,2023-03-19] for coordinating the round &#128030; [user:gyh20,2023-03-19] for black-red testing of the round &#128520; [user:feecIe6418,2023-03-19], [user:iakovlev.zakhar,2023-03-19], [user:Dart-Xeyter,2023-03-19], [user:Adam_GS,2023-03-19], [user:felys,2023-03-19], [user:golikovnik,2023-03-19], [user:Gary2005,2023-03-19] for red testing of the round &#128043; [user:NemanjaSo2005,2023-03-19], [user:Alexdat2000,2023-03-19], [user:Kon567889,2023-03-19], [user:tem_shett,20...
="spoiler-content" style="display: none;"> * ✅ Read all problems * ✅ Don't

Full text and comments »

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

107.
By maroonrk, history, 6 years ago, In English
TL Issue in the #659 (Div. 1) Problem F I've hacked all AC solutions of [this](https://codeforces.me/contest/1383/problem/F) problem, which were submitted during the contest, and I believe I can hack most of upsolving solutions. Currently, I only checked that they time out on my local machine, because "Unexpected Verdict" prevents me from uphacking. I even hacked model implementation in the editorial. [Here](https://ideone.com/cHvjkp)'s my latest generator. Feel free to challenge it. Side Note: [user:yosupo,2020-07-26] wrote a [solution](https://codeforces.me/contest/1383/submission/88036534), which passes the above case, but I failed it with another [generator](https://ideone.com/LKx3FP). What I want to argue is that TL of this problem is too tight, and it affected some of the competitors. For example, I got almost the same idea as the model solution during the contest. Still, I was too scared to write it because I suspected it would time out without full optimization and possibly some tweaks like shuffling ve...
.** I wish future CF writes and coordinators read this, and that's the reason why I posted it as a

Full text and comments »

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

108.
By dario2994, 5 years ago, In English
Codeforces Global Round 15 <img src="/predownloaded/2e/e2/2ee2f0f95f05aae6ca6f47812dae2dc2aabf277b.png" style="width:200px; float:right; margin: 0 1em 1em 1em"/> Hi! On [contest_time:1552] we will host [contest:1552]. This is the third round of the 2021 series of [Codeforces Global Rounds](https://codeforces.me/blog/entry/65002). The rounds are open and rated for everybody. The prizes for this round are as follows: - 30 best participants get a t-shirt. - 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive. The prizes for the 6-round series in 2021: - In each round top-100 participants get points according to the [table](https://pastebin.com/QT5sXEaT). - The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest. - The best 20 participants over all series get sweatshirts and place certificates. Thanks to XTX, which in 2021 supported the global rounds initiative! Problems for this round ar...

Full text and comments »

Announcement of Codeforces Global Round 15
  • Vote: I like it
  • +823
  • Vote: I do not like it

109.
By antontrygubO_o, history, 7 years ago, In English
On problemsetting 2 [Previous part](https://codeforces.me/blog/entry/70178) Hi there again! Previous part with opinions of some amazing problemsetters turned out to be interesting for you, so I decided to gather some more opinions :D. I really hope that this post will help someone in their problemsetting future! #### When and how did you start problemsetting? [user:300iq,2020-01-11]: April, 2017 [user:maroonrk,2020-01-11]: In 2015 Summer, I hold the first contest with friends at high school club. It was a local Japanese contest. [user:Radewoosh,2020-01-11]: In high school, so probably for 5 years. I was creating problems for other people from my school as my teacher told me that it's a completely different point of view. [user:voidmax,2020-01-11]: It was 3 years ago. I was on plane and I didn't have a clue what to do in my free time. Then I realized that I can try myself in problemsetting. Later I created first and one of my favorite problem ([problem:963B]). I was full of inspiration a...
[user:Radewoosh,2020-01-11]: No problemsetter is perfect. Even if they aren't nice I try toread

Full text and comments »

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

110.
By MikeMirzayanov, history, 11 years ago, translation, In English
How to come up with the solutions: techniques As I work with students I often face the situation when if a problem doesn't seem clear to a student at the first sight, it makes them unable to solve it. Indeed, you always hear about specific methods and techniques. But you don't hear about how to think in order to apply them. In this note I'll try to sum up my experience of solving programming contest problems. However, some pieces of advice will also be applicable for olympiads in mathematics and your first steps in academic research. So you've read a problem and you don't know how to solve it. Try the following techniques, some of them can often come handy. ##### Technique 1: "Total Recall" Try to remember some similar problems that you had to solve. Quite many problems do not have a brand new idea. So probably, you can use your experience of solving a similar problem to solve this one. ##### Technique 2: "From Specific to General" Let's say that you've found the solution for the problem (hurray!). Let's consider ...
So you've read a problem and you don't know how to solve it. Try the following techniques, some of

Full text and comments »

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

111.
By MikeMirzayanov, 10 years ago, translation, In English
For contest writers: proposal tracking system <i>In 2021, some details (including requirements for problem writers) were changed. Read <a href="https://codeforces.me/blog/entry/85259">the link</a> for details.</i> Hello, Codeforces! New year brings changes to the Codeforces team. <a href="/blog/entry/49466">As you probably know</a> [user:GlebsHP,2017-01-04] completed his work as the chief coordinator of Codeforces. Gleb, thanks a lot! You did an excellent job and coordinated a lot of interesting rounds. You're a professional, an interesting person, you have impeccable taste to problems, and you proved to be brilliant and talented writer. Thank you that you were with us! Hope to see your tasks on Codeforces many times again! Nikolay [user:KAN,2017-01-04] Kalinin came to Gleb's place. He is also an experienced participant, Nikolay has already held several rounds as a coordinator. [user:KAN,2017-01-04] seriously engaged in programming contests since he was 12 years old. His major achievements: he won twice All-Russian Scho...
, add problems to it. Read all instructions carefully. Carefully prepare and submit your proposal for a, /">Polygon, the pre-read the examples of well-prepared problems, read all articles about using, In 2021, some details (including requirements for problem writers) were changed. Read

Full text and comments »

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

112.
By Alexdat2000, 5 years ago, translation, In English
Codeforces Round #770 (Div. 2) Greetings to all humans and robots on this site! [user:sevlll,2022-01-23], [user:crazyilian,2022-02-03], [user:Mangooste,2022-02-03], [user:imachug,2022-02-03] and me ([user:Alexdat2000,2022-02-03]) invite everyone to participate in the [Codeforces Round #770 (Div. 2)](https://codeforces.me/contests/1634), which will take place this [contest_time:1634]. **This round will be rated for all participants with a rating of strictly less than 2100.** You will have **2 hours and 30 minutes** to solve 6 problems. There will be an interactive problem in the round, so we recommend all new participants to read [Interactive Problems Guide](https://codeforces.me/blog/entry/45307). The traditional thank-you list: - Thanks to [user:antontrygubO_o,2022-02-03] for coordinating us for a very long time and helping to improve one of the tasks - Thanks to [user:alexxela12345,2022-02-03] for tasks that did not survive till the final version of the round - Thanks to [user:Pechalka,2022-02-03], [u...
in the round, so we recommend all new participants to read [Interactive Problems Guide](https

Full text and comments »

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

113.
By Dominater069, 3 years ago, In English
Codeforces Round #934 (Div1, Div2) Hello Codech....err i mean Codeforces! I invite you to participate in [contest:1943] and [contest:1944] which will start on [contest_time:1943]. You will be given 6 problems and 2 hours 15 minutes to solve them in both divisions. Division 1 has $\textbf{2 subtasks}$, and Division 2 has $\textbf{1 subtask}$. Joining us on the problem setting panel are: - Coordinator: Ashley [user:errorgorn,2024-03-14] Khoo. - Authors: Satyam [user:satyam343,2024-03-14] Kumar Roy, Aditya [user:everule,2024-03-14] Jain, Shreyan [user:Dominater069,2024-03-14] Ray. - Russian Translation: Alexey [user:Alexdat2000,2024-03-14] Datskovskiy. - Red Testers: Kostia [user:kostia244,2024-03-14] Savchuk, Jeroen [user:jeroenodb,2024-03-14] Op De Beek, Andrei [user:andrei_boaca,2024-03-14] Boaca, Luan [user:LipArcanjo,2024-03-14] Arcanjo, Fernando [user:ffao,2024-03-14] Fonseca, Alexander [user:teraqqq,2024-03-14] Babin, Aleksei [user:Vercingetorix,2024-03-14] Esin, Zixuan [user:RDDCCD,2024-03...
Please do read a few problems in advance at the very least. Especially with all the subtasks, it is

Full text and comments »

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

114.
By errorgorn, history, 5 years ago, In English
Codeforces Round #723 (Rated for Div 2) Hello again Codeforces! [user:Errorgorn,2021-05-25], [user:Oolimry,2021-05-25] and [user:ILoveIOI,2021-05-25] are glad to invite you to participate in [contest:1526] which will be held at [contest_time:1526]. The round will be **rated for the participants with a rating lower than 2100**. Participants from the first division are also welcomed to take part in the competition but it will be unrated for them. You will be given **2 hours and 30 minutes** to solve **6 questions**. One of the puzzles is interactive, please read [the guide of interactive](https://codeforces.me/blog/entry/45307) [problems](https://en.wikipedia.org/wiki/Binary_search_algorithm) before the contest. We would like to thank: - Our lord and saviour [user:AntontrygubO_o,2021-05-25] for amazing coordination and rejecting our poopoo tasks - [user:dantoh000,2021-05-25] and [user:tqbfjotld,2021-05-25] for roasting our enigmas and testing them before they were prepared - our many testers [user:balbit,2021-05...
interactive, please read [the guide of interactive](https://codeforces.me/blog/entry/45307) [problems

Full text and comments »

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

115.
By Lewin, 11 years ago, In English
Wunder Fund Round 2016 Hello Codeforces! I invite all of you to participate in a **special** Codeforces round. It will take place on [29 Jan, 17:05 UTC](http://www.timeanddate.com/worldclock/fixedtime.html?day=29&month=1&year=2016&hour=20&min=5&sec=0&p1=166). It will not be a usual round. Thanks to Wunder Fund, the best participants will win prizes and souvenirs. Here are some words from <a href="http://wunderfund.io/">Wunder Fund</a>: <img src="http://assets.codeforces.com/images/optimization.jpg" style="float:right; margin: 0 1em;"/> > Our company is situated in the center of Moscow. We are engaged in high-frequency trading &mdash; developing high-performance systems and algorithms for automated trading in financial markets. In this area algorithms and data structures (that you love to invent and implement) are vital. Our systems should process transactions in milliseconds! High-frequency trading is a continuous competition of the best programmers and mathematicians around the world. By joining us...
you, so I encourage you to read all problems.

Full text and comments »

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

116.
By MikeMirzayanov, 8 years ago, translation, In English
Codeforces: Results of 2018 Hi Codeforces! February 2019 is already on the calendar, which means that I was late with the report for 2018. Better late than never! Let's remember last year. In 2018, [user:_kun_,2019-02-05], [user:300iq,2019-02-05] and [user:arsijo,2019-02-05] joined the team of coordinators. The work of the coordinators is headed (and is the coordinator of the coordinators) [user:KAN,2019-02-05]. I really hope that a more measured schedule of preparing rounds by a large team of coordinators will give a better insight into the contests. The main innovations in the platform are implemented by me and the developers [user:kuviman,2019-02-05], [user:fcspartakm,2019-02-05], [user:MaximShipko,2019-02-05]. Great work on the organization of events and prizes mailing was done by [user:gKseni,2019-02-05]. Special thanks to the writers of the problems and testers. It is your content that charges the community with life and unites all of us. Thank you for the problems! And now let's summarize...
you read the post about the XTX Markets initiative <>?

Full text and comments »

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

117.
By PrinceOfPersia, 12 years ago, In English
Algorithm Gym :: Data structures Today I want to introduce you some very very useful data structures. In this lecture, we are trying to improve your data structures skills, stay with us and click on **read more**. [cut] Important data structures : Trees ----- Trees are one of the most useful data structures.A tree is a connected-acyclic graph.There are too many types of trees, like : rooted trees, weighted trees, directed trees, tries, etc. Partial sum ----------- There are two types of problems solvable by partial sum. 1.Problems which you are asked to answer some queries about the sum of a part of elements (without modify queries). Solution of all of this problems are the same. You just need to know how to solve one of them. Example : You are asked some queries on an array $a_1,a_2,...a,_n$. Each query give you numbers $l$ and $r$ and you should print $a_l + a_{l+1} + ... + a_r$ . Solution : You need to build another array $s_1, s_2, ..., s_n$ which $s_i = a_1 + a_2 + ... + a_i$ ...
**read more**., You can read about them in C++ references., You can read more about it, just google `sgi STL`.

Full text and comments »

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

118.
By galen_colin, 3 years ago, In English
WF23 Luxor _(Long blog ahead. Reader discretion advised.)_ I feel we have a rather interesting WF story (note: we did the 47th finals, as the University of Maryland, <b><i>as 2 people</i></b>... explained below), so I figured I'd tell it. Exposition ---------- It actually starts way before WF, too. Our teams were decided on (some form of) merit based on an internal qualifier. My team for the regional and NAC (North America superregional) ended up as {me, [user:Navick,2024-04-24], [user:mr.banana,2024-04-24]}. We did [fairly](https://nasouth22d1.kattis.com/contests/nasouth22d1/standings) [well](https://nac.icpc.global/wp-content/uploads/2023/06/NAC23-scoreboard.pdf) in those. However, for WF, my two teammates only had single-entry visas for the US, meaning that if they left, they couldn't come back into our country. So they couldn't really go with me... Luckily, in such situations, ICPC lets you just replace your teammates. So we held another internal qualifier, and ended up with two ...
_(Long blog ahead. Reader discretion advised.)_

Full text and comments »

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

119.
By ilyakrasnovv, 4 years ago, translation, In English
Codeforces Round #816 (Div. 2) Thanks a lot! ================== for Your participation Hello, Codeforces! We are glad to invite everyone to participate in [contest:1715], which will be held on [contest_time:1715]. The round will be rated only for the second division. You will have **6 tasks** and **2 hours** to solve them. _We recommend you read all the problems_. Round is completely set by winter SIS (Summer Informatics School) students. During the camp we did our best to prepare interesting and creative problems. You can check previous rounds prepared by SIS students: [contest:1720], [Codeforces Round #694](https://codeforces.me/contests/1471,1470), [Codeforces Round #612](https://codeforces.me/contests/1286,1287), [Codeforces Round #530](https://codeforces.me/contests/1098,1099) We are very thankful to - task authors and developers: Vasilyev [user:Allvik06,2022-08-17] Alexey, Denis [user:Kapt,2022-08-17] Mustafin, Ivan [user:__silaedr__,2022-08-17] Podvorniy, Ilya [user:ilyakrasnovv,2022-08-1...
hours** to solve them. _We recommend you read all the problems_., **The contest may contain interactive problems!** Make sure to read this [post](https

Full text and comments »

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

120.
By chromate00, 22 months ago, In English
Codeforces Round 1000 (Div. 2) — Anti-LLM Evaluation Report As the main problemsetter of [contest:2063], I know that a lot of you were somewhat disappointed to see that it was not a Div.1 contest. Though I am not the one who caused a lack of Div.1 contests, I understand your feeling. So I present to you the great surprise: The **Anti-LLM Evaluation Report** for [contest:2063], the first of its kind on a Div.2! In this blog we discuss about how the round combats against LLMs (especially focusing on OpenAI o1, the greatest of its kind while we prepared and tested the problemset), by looking at the timeline of how the problemset changed. --- So, let us begin with the initial problemset we had when the testing began. (The task names are anonymized, unless they are released to the public before or in the round) In the beginning, we had a problemset that looks like this: - **A' &mdash; B &mdash; C0 &mdash; D' &mdash; E' &mdash; F0** (If you are confused with the meanings, (letter)' means it was not used in the final problemset but exis...

Full text and comments »

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

121.
By Geothermal, history, 3 years ago, In English
Four Proposals Regarding FSTs While I very much enjoy Codeforces rounds overall, FSTs are by far my least favorite part of the Codeforces contest format. There are two reasons I dislike contests with weak pretests. The first is stylistic: I don't care very much about penalizing people who don't rigorously prove their solutions before submitting (which is the main justification for having weak pretests) and I think it's essentially impossible to FST these solutions without more frequently FSTing contestants who make minor mistakes in their code. (The vast majority of my FSTs are due to this sort of minor glitch rather than an error in the underlying idea). The second is that FSTs introduce an element of hidden information to Codeforces rounds. During a contest, you have no way of knowing whether the authors have written strong pretests. If you act as though the pretests are weak, you will be at a disadvantage if pretests are actually strong (because if you knew pretests are strong, you could have e.g. submit...

Full text and comments »

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

122.
By antontrygubO_o, 7 years ago, translation, In English
Codeforces Round #572 Hello, Codeforces! We are glad to invite you to the [Codeforces Round #572](https://codeforces.me/contests/1188,1189), which will be held [on Friday, 5 July at 18:05](https://www.timeanddate.com/worldclock/fixedtime.html?iso=20190705T1805&p1=166&ah=2). The round will be rated for both divisions (as this time we thanked [user:MikeMirzayanov,2019-06-29]). Round was prepared by us, [user:antontrygubO_o,2019-06-29] and [user:kefaa2,2019-06-29]. This is our first round, and, as we hope, not the last one! A lot of thanks to [user:arsijo,2019-06-29] for the excellent coordination of the round, [user:gepardo,2019-06-29], [user:GandalfTheGrey,2019-06-29], [user:progmatic2,2019-06-29], [user:zoomswk,2019-06-29], [user:ecnerwala,2019-06-29], [user:AllCatsAreBeautiful,2019-06-29], [user:DmitryGrigorev,2019-06-29], [user:Markellonchik,2019-06-29], [user:dasfex,2019-06-29], [user:Taran_1407,2019-07-01], [user:slicedclementines,2019-07-01], [user:DenisPushkin,2019-06-30], [user:austrian_...

Full text and comments »

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

123.
By Xellos, history, 11 years ago, In English
Codeforces Round #333 — editorial ### Hints: [div2A](#div2A): Try conversions between bases. [div2B](#div2B): Solve a simpler version of the problem where $A_{i+1} \neq A_i$ for all $i$. [div1A](#div1A): What are the shortest paths of the vehicles? what's the shorter of those paths? [div1B](#div1B): Forget about the ceiling function. Draw points $(i,A[i])$ and lines between them &mdash; what's the Lipschitz constant geometrically? [div1C](#div1C): Some dynamic programming. Definitely not for the exp. score of one person &mdash; look at fixed scores instead. [div1D](#div1D): Compute $dif(v)$ in $O(N)$ (without hashing) and then solve the problem in $O(N^2)$. You need some smart merges. [div1E](#div1E): Can you solve the problem without events of type 1 or 2? Also, how about solving it offline &mdash; as queries on subsets. ![ ](https://i.imgur.com/bnWmD60.png) ### <a name="div2A"></a>Div. 2 A: Two Bases ------------------------------------ It's easy to compare two numbers if the same bas...
Comic strip name: [Indy](http://www.vgcats.com/super/?strip_id=56). Go read the whole thing, it's

Full text and comments »

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

124.
By ko_osaga, history, 14 months ago, In English
Squarepoint Challenge (Codeforces Round 1055, Div. 1 + Div. 2) Annyeonghaseyo, Codeforces! We invite you to participate in [contest:2152], which will be held on [contest_time:2152]. The round will be **rated for everyone**. You will be given **8 problems**, one of which is divided into two subtasks, and **3 hours** to solve them. One of the problems will be interactive, so make sure to read the [guide for interactive problems](https://codeforces.me/blog/entry/45307) before the contest. The problems are authored and prepared by [user:as_dfsdf,2025-09-29], [user:djm03178,2025-09-29], [user:ko_osaga,2025-09-29], and [user:qwerasdfzxcl,2025-09-29]. We would like to thank: - [user:errorgorn,2025-09-29] for great coordination. - [user:Alexdat2000,2025-09-29] for great Russian translation. - [user:Adam_GS,2025-09-29], [user:ainta,2025-09-29], [user:bangan,2025-09-29], [user:BuzzyBeez,2025-09-29], [user:cookiedoth,2025-09-29], [user:Dragos,2025-09-29], [user:gamegame,2025-09-29], [user:garam1732,2025-09-29], [user:Geothermal,2025-09-29],...
sure to read the [guide for interactive problems](https://codeforces.me/blog/entry/45307) before

Full text and comments »

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

125.
By geranazavr555, 7 years ago, translation, In English
Обновления Polygon (июнь-октябрь 2019) Hello, Codeforces! Я и [user:cannor147,2019-11-07], будучи студентами Университета ИТМО, в июне присоединились к разработке Codeforces. С июня по октябрь мы преимущественно занимались развитием платформы Polygon. В этом посте нам бы хотелось представить вам список того, что мы сделали за это время. В этот список не включены мелкие баг-фиксы или какие-то незаметные пользователям улучшения. #### Пин-коды для контестов и задач Иногда в Polygon разрабатываются особо важные контесты и задачи. В таком случае председатель жюри может быть обеспокоен возможностью утечки, например из-за слабого пароля другого члена жюри. Пин-код &mdash; дополнительный фактор подтверждения доступа к задаче или контесту, его может установить или изменить только владелец задачи или контеста. Предполагается, что пин-код будет передан каким-то отдельным надежным каналом связи. Теперь в интерфейсе контеста для владельцев появилась ссылка Create Pin: ![Create Pin в интерфейсе](https://i.ibb.co/bgcg8Cq/p...
Now Polygon checks that variable names are passed in read*s (readInts, readDoubles, ...) testlib, Теперь Polygon проверяет, что в валидаторе в read*s (readInts, readDoubles, ...) методы testlib

Full text and comments »

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

126.
By platelet, 3 years ago, In English
CodeTON Round 5 Editorial ### [problem:1842A] <spoiler summary="Tutorial"> Let's view it as when monsters $x$ and $y$ fight, their health changes into $\max(x-y,0)$ and $\max(y-x,0)$ respectively. So any monster with $0$ health is considered dead. Therefore, a player loses when the health of his monsters are all $0$. Notice that $\max(x-y,0)=x-\min(x,y)$ and $\max(y-x,0)=y-\min(x,y)$. Therefore, after each step, the sum of the health of monsters decrease by the same amount for both players. Therefore, we only need to know $\sum a_i$ and $\sum b_i$ to determine who wins. If $\sum a_i > \sum b_i$, Tsondu wins. Else if $\sum a_i < \sum b_i$, Tenzing wins. Else, it is a draw. </spoiler> <spoiler summary="Code"> ~~~~~ #include <iostream> using namespace std; int main() { ios::sync_with_stdio(false), cin.tie(nullptr); int T; cin >> T; while (T--) { int n, m, a[50], b[50]; long long sumA = 0, sumB = 0; cin >> n >> m; for (int i = 0; i < n;...
__attribute((always_inline)) int read() { if(__builtin_expect(in1 > inBuf + inSZ - 32, 0, It tells us, if a book has difficulty rating $y$, and $x|y \neq x$, Tenzing will neverread this, int main() { n = read(), k = read(), A = read(); for (int i = 0; i < n; i

Full text and comments »

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

127.
By MOUFLESS, 18 months ago, In English
Codeforces Round 1025 (Div. 2) ## Ready to Duel? If yes, [user:fzark, 2025-05-09], [user:Intellegent, 2025-05-09], and I are glad to invite you to [Codeforces Round 1025 (Div. 2)](https://codeforces.me/contests/2109), which will be held on [contest_time:2109]. This round will be **rated for participants with rating lower than 2100**. We will also be glad to see the participants with a higher rating to participate in our round unofficially! You will be given **6** problems (with at least one interactive problem and one problem that has 3 versions) and **2 hours and 15 minutes** to solve them. Also you can read about interactive problems [here](https://codeforces.me/blog/entry/45307). **Please take a look at the score distribution; it may help you during the contest. Additionally, make sure to read all the problems.** We would like to thank: - [user:satyam343,2025-05-09], our great beloved coordinator. - [user:Kaitokid,2025-05-09], [user:rui_er,2025-05-09], [user:TripleM5da,2025-05-09], [user:N...
versions) and **2 hours and 15 minutes** to solve them. Also you can read about interactive problems, , make sure to read all the problems.**

Full text and comments »

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

128.
By sammyuri, 15 months ago, In English
Codeforces Round 1044 (Div. 2) Hello, Codeforces! I'm thrilled to invite you to take part in [contest:2133], which starts on [contest_time:2133]. You will help Steve solve $6$ of his most dastardly problems in $2$ hours. The score distribution is as follows: <p style="text-align:center"> <img src="/predownloaded/07/57/0757452a070cd6b25d62fdcacfb781235241620f.png" width="4%"> $\,\,\,\,$ <img src="/predownloaded/40/b3/40b3439f782304be4b4c62054c6af9bbf991bf65.png" width="4%"> $\,\,\,\,$ <img src="/predownloaded/7b/6a/7b6a2b83683ab53ea95a40cfa4210cf4650da214.png" width="4%"> $\,\,\,\,$ <img src="/predownloaded/b7/14/b7143b79f660a73dbc5f5a0ff70cf213bb2f90f5.png" width="4%"> $\,\,\,\,$ <img src="/predownloaded/61/2b/612bf35ad4c6bb16c71a229e619a0399a1718951.png" width="4%"> $\,\,\,\,$ <img src="/predownloaded/70/3b/703b6ba7b857221cb8198c51a0fd0c2960493782.png" width="4%"> </p> $$\,500\,-1000-1750-2250-2750-3250$$ One of the problems may be interactive, so make sure to read the [guide for interactive problems](h...
One of the problems may be interactive, so make sure to read the [guide for interactive problems

Full text and comments »

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

129.
By Devil, 6 years ago, In English
Codeforces Round #659 Hello, Codeforces! I'm very glad to invite you to the first **Cuban round** [contest:1383] and [contest:1384] which will take place on [contest_time:1383]. All problems in this round were created and prepared by [user:marX,2020-07-21], [user:gilcu3,2020-07-21], [user:dcordb,2020-07-21], [user:jcg,2020-07-21] and me. We tried to make them interesting and diverse and hope that you will enjoy them! You will be given **2 hours** to solve **6 problems** in both divisions, and we **highly** encourage you to read all of them :) We would like to thank: - [user:antontrygubO_o,2020-07-21] for amazing coordination of this round. - [user:Um_nik,2020-07-21], [user:gamegame,2020-07-21], [user:ffao,2020-07-21], [user:eatmore,2020-07-21], [user:isaf27,2020-07-21], [user:balbit,2020-07-21], [user:Tlatoani,2020-07-21], [user:Prabowo,2020-07-21], [user:Kuroni,2020-07-21], [user:hugopm,2020-07-21], [user:MagentaCobra,2020-07-21], [user:qlf9,2020-07-21], [user:faremy,2020-07-21], [use...
** encourage you to read all of them :)

Full text and comments »

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

130.
By DanAlex, history, 11 years ago, In English
How to sweep like a Sir ### Cutting to the chase Clearly you don't need a PhD in Computing to sweep in the yard , but one might be useful in order to know linear and radial sweep algorithms. So , what's all about ? It's just what it sounds it is , sweeping linear ( up to down , for example ) or radial ( making a 360 degrees loop ). How this can help? [cut] Well... ### Linear sweep Suppose you a set of objects in an Euclidean plane. We need to extract information about some objects. The method of linear sweeping takes a line and moves it on a fixed direction. Usually the line taken would be vertical and the direction would be left to right or up to down. ![ ](https://upload.wikimedia.org/wikipedia/commons/2/25/Fortunes-algorithm.gif) Quite abstract for the moment , huh ? Let's go to a more specific example. #### Rectangle union area This example is well known. You have a set of rectangles with edges parallel to the OX and OY axes. What is their union area. Well , first of all , let'...
leave this to the reader as we do it similarly to the in-out segment procession described above

Full text and comments »

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

131.
By E869120, 8 years ago, In English
[Tutorial] A way to Practice Competitive Programming : From Rating 1000 to 2400+ Dear Codeforces community.<br /> Finally red :)<br /> <br /> Today, I want to share about some ways to practice competitive and gain your rating. I hope that this is helpful for those who is practicing competitive programming harder but rating is sluggish. There are 54,000+ people who participated in Codeforces contests actively, but sadly only a few people reach a red-ranked coders. For people who can't reach red, I will introduce my way to gain rating in some steps.<br /> <br /> This blog is an extended and more detailed version of [my previous tutorial blog](http://codeforces.me/blog/entry/53341), but 2 years and now are different. So there are many points that are different from blog which has written 2 years ago. Note: Some people who already read my previous tutorial blog may doubt, but do not doubt &mdash; I should say that the "from rating 1000 to 2000" part of this blog is not the copy of my previous blog and it's very different.<br /> <br /> Since the size is very big...
different from blog which has written 2 years ago. Note: Some people who alreadyread my previous tutorial

Full text and comments »

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

132.
By ace5, history, 3 years ago, translation, In English
Codeforces Round #922 (Div. 2) Hello, Codeforces! I and [user:ooaa,2024-01-29] are excited to invite you to participate in [Codeforces Round 922 (Div. 2)](https://codeforces.me/contest/1918), which will take place on [contest_time:1918]. This round will be **rated** for participants, whose **rating is below 2100**. Participants with higher rating can participate unofficially. You will be given 7-8 problems and 2 hours to solve them. We recommend you to read all the problems. **1 or more interactive problems may occur in the round**, so we suggest to read this [post](https://codeforces.me/blog/entry/45307). We would like to thank: - [user:Akulyat,2024-01-29] for the excellent coordination of our round. - [user:wuhudsm,2024-01-29] for finding that the previous C has already occured in one of the rounds. - [user:A_G,2024-01-29], [user:bashkort,2024-01-29], [user:orz,2024-01-29], [user:Andreasyan,2024-01-29], [user:green_gold_dog,2024-01-29], [user:zwezdinv,2024-01-29], [user:EJIC_B_KEDAX,2024-01-2...
You will be given 7-8 problems and 2 hours to solve them. We recommend you to read all the problems

Full text and comments »

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

133.
By PrinceOfPersia, history, 11 years ago, In English
Codeforces Round #326 Hello Codeforces. I'm honored to announce you, that Codeforces round #326 is gonna take place [soon](http://timeanddate.com/worldclock/fixedtime.html?day=15&month=10&year=2015&hour=19&min=30&sec=0&p1=166) on Codeforces. Writers are AmirMohammad Dehghan([user:PrinceOfPersia,2015-10-01]) and Ali Haghani([user:Haghani,2015-10-08]). There will be 6 problems in each division(4 problems are common) and you'll have 2 and a half hour to solve them. I hope you enjoy the problems. I wanna thank Maxim Akhmedov([user:Zlobober,2015-10-01]) for his great helps in preparing this round, [user:MikeMirzayanov,2015-10-01] for wonderful platforms of Codeforce and Polygon, [user:Delinur,2015-10-08] for translating problem statements into Russian and MohammadReza Maleki([user:mruxim,2015-10-13]) and Ali Bahjati([user:AliB,2015-10-13]) for their great advices (and [user:AliB,2015-10-13] again for some graphics). This is my third round on Codeforces and not the last one, I hope. This is the las...
Problems are sorted by the expected difficulty, but we strictly recommend you to **read all the

Full text and comments »

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

134.
By MikeMirzayanov, 3 years ago, In English
Polygon: Warnings for Packages — Incomplete Tests + Statement/Validator Mismatches Hello, Codeforces! If you're developing problems in Polygon, you might like this image to attract attention. <center> <img src="/predownloaded/b4/b6/b4b6e46dd5811c89440ee98bce405e54e3b905c6.png"/> </center> <i>For the new members of the community, I would like to remind you that Polygon (https://polygon.codeforces.com/) is a system developed and maintained by Codeforces for preparing programming problems. It is there that authors and coordinators develop all the problems for the rounds. Moreover, I believe a significant (large?) portion of the problems for other competitions is also developed there: various stages of ICPC, national competitions of different levels, educational problems for various courses, etc. <b>In 2023, more than 50000 problems were prepared in Polygon (only those for which a package was compiled are counted)!</b></i> We often implement such improvements in Polygon that make the process of preparing a problem more reliable. These often include var...
constraints through the arguments of read functions, not with custom code afterward., of the test but also helps to analyze and process the test. Here, read https://codeforces.me/blog, read either as `int t = inf.readInt(1, 10'000, "t");` (a single number) or as `vector a

Full text and comments »

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

135.
By ToxicPie9, 3 years ago, In English
You won't believe how this simple trick defeated the unexplained bug destroying every top LGM ### TL;DR Currently people are discussing a slowdown bug on Codeforces that seems to happen randomly, and can cause code to run 100x slower and get TLE. More details in [user:pajenegod,2024-03-03]'s [blog post](https://codeforces.me/blog/entry/126654). In this article, I present a mitigation: add the following to your code. ~~~~ #include <windows.h> void *operator new(size_t size) { if (void *ptr = HeapAlloc(GetProcessHeap(), 0, size ? size : 1)) return ptr; throw std::bad_alloc{}; } void operator delete(void *ptr) { HeapFree(GetProcessHeap(), 0, ptr); } ~~~~ <spoiler summary="If you use malloc/free in C++ (you shouldn't), also change them."> ~~~~ void *my_malloc(size_t size) { if (void *ptr = HeapAlloc(GetProcessHeap(), 0, size ? size : 1)) return ptr; throw std::bad_alloc{}; } void my_free(void *ptr) { HeapFree(GetProcessHeap(), 0, ptr); } ~~~~ </spoiler> <spoiler summary="If you use aligned new/delete in C++, also change the...
free chunks. I did not have enough time or energy to read the implementation, but it is possible that

Full text and comments »

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

136.
By -is-this-fft-, history, 4 years ago, In English
[Tutorial] FFT If I was a YouTuber, this would be the place where I fill the entire screen with screenshots of people asking me to make this. Anyway, not so long ago I gave a lecture on FFT and now [user:peltorator,2023-01-11] is giving away [free money](https://codeforces.me/blog/entry/110840), so let's bring this meme to completion. In this blog, I am going to cover the basic theory and (competitive programming related) applications of FFT. There is a long list of generalizations and weird applications and implementation details that make it faster. Maybe at some point I'll write about them. For now, let's stick to the basics. **The problem.** Given two arrays $a$ and $b$, both of length $n$. You want to quickly and efficiently calculate another array $c$ (of length $2n - 1$), defined by the following formula. $$c_k = \displaystyle \sum_{i + j = k} a_i \cdot b_j.$$ Solve it in $O(n \log n)$. First of all, why should you care? Because this kind of expression comes up in combinatorics a...

Full text and comments »

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

137.
By pwned, 2 years ago, In English
Train Better with ThemeCPs (+ Website)! Hello Codeforces! I am excited to share with you my competitive programming innovation which successfully propelled me to master (2100+)! This is the **<span style="color:black;">Theme</span><span style="color:red;">CP</span>** training method, which stands for **Themed <span style="color:red;">C</span>odeforces <span style="color:red;">P</span>rogressions**. Use at your discretion -- your Codeforces practice may get too effective and addictive! ![ ](/predownloaded/b5/33/b533201227bd15e23e4d344e38cf7f454e27e08a.png) **Want to read this blog in document form (with images)? Check out the following Google Doc!** https://tinyurl.com/themecp #### What is **<span style="color:black;">Theme</span><span style="color:red;">CP</span>**? **<span style="color:black;">Theme</span><span style="color:red;">CP</span>** is an experimental training system wherein users train on a perpetual ladder for ratings in **[<span style="color:gray;">900</span>, <span style="color:black;">3</span><...
**Want to read this blog in document form (with images)? Check out the following Google Doc

Full text and comments »

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

138.
By antontrygubO_o, 7 years ago, In English
On setting D2A and D2B problems Disclaimer: as always, everything in this blog is just my opinion. Some problemsetters don't take easy problems seriously. One very popular opinion is that the D2A-B problems are just stupid implementation exercises intended for beginners to learn how to code. ![ ](https://i.imgur.com/ioTMeKL.png) ![ ](https://i.imgur.com/TJ2IPzb.png) It's true that D2A-B problems are mostly like this on most platforms. This is one of the reasons why a lot of people don't like combined rounds: they think that solving D2A-B problems can't be interesting and just takes time which could be spent on solving fascinating problems of higher level. From point of view of most participants, easy problems just can't be good, because if problem requires some thinking than it's not easy enough for D2A-B level. Easy problems can't be interesting, they say! ![ ](https://i.imgur.com/aRe2p6l.png) ![ ](https://i.imgur.com/wLKlixu.png) This situation really upsets me. This kind of attitude from the ...

Full text and comments »

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

139.
By TheScrasse, history, 3 years ago, In English
[Tutorial] How to read editorials Hello everyone, in this blog I'm trying to convince you that editorials are useful, especially if you read them "correctly". #### "Algorithm $1$" vs "Algorithm $2$" This is what many users do when reading the editorial for one problem (let's call it "algorithm $1$"): - Read it. - Repeat until able to implement the solution. - Implement the solution; possibly forget about any previous attempt to solve that problem without editorial, and any detail in the editorial that seems unrelated to the implementation of the solution. - Possibly, read the comments trying to find out how it is possible to come up with the solution in the editorial. This is what you should do in my opinion (let's call it "algorithm $2$"): - Keep the editorial open until you are able to implement the solution, using both your ideas and editorial's ideas: sometimes, this just means opening the editorial for $1$ second, because you had already found most of the ideas on your own. - Implement the so...
[Tutorial] How to read editorials, already found most of the ideas on your own. - Implement the solution. - Re- read the editorial, if you read them "correctly". #### "Algorithm $1$" vs "Algorithm $2$" This is what many users, on, understand the solution. - Implement the solution. - Re-read the editorial carefully. Ask, on, understand the solution. - Implement the solution. - Re-read the editorial carefully.Read the, - Read it. - Repeat until able to implement the solution. - Implement the solution; possibly, - Read the comments; find out that many people tried to sort $l$ and $r$ in ascending order, - Read the editorial. - Understand that, for some unintuitive reason (i.e., some math formulas, - Read the editorial. - Understand that, for some unintuitive reason (i.e., a proof which seems, in this blog I'm trying to convince you that editorials are useful, especially if youread them

Full text and comments »

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

140.
By antontrygubO_o, 5 years ago, In English
AtCoder Grand Contest 055 Announcement I am glad to invite you to [AtCoder Grand Contest 055](https://atcoder.jp/contests/agc055). This contest counts for GP30 scores. <ul> <li> Contest URL: <a href="https://atcoder.jp/contests/agc055">https://atcoder.jp/contests/agc055</a> </li> <li> Start time: <a href="https://www.timeanddate.com/worldclock/fixedtime.html?msg=AtCoder+Grand+Contest+055&iso=20211031T21&p1=248&ah=3">Sunday, October 31, 12:00 UTC</a> </li> <li> Duration: 180 minutes </li> <li> Number of Tasks: 6 </li> <li> Writer: [user:antontrygubO_o,2021-10-28] </li> <li> Rated range: 1200+ </li> </ul> The point values will be **400** &mdash; **700** &mdash; **900** &mdash; **1200** &mdash; **1500** &mdash; **1800** I would like to thank: <ul> <li> [user:maroonrk,2021-10-28] for an amazing coordination of this round, and for allowing me to host a contest on AtCoder for the second time </li> <li> [user:AmShZ,2021-10-28] and [user:maroonrk,2021-10-28] for a few great suggestions to improve some ...
it, or to read editorial, I think that it's the best problem I ever invented.

Full text and comments »

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

141.
By IgorI, 5 years ago, In English
Hello 2022 Hi, Codeforces! Happy New Year! I'm glad to invite you to [contest:1621], which will take place on [contest_time:1621]. You will have **$2$ hours $15$ minutes** to solve the problems. **This round is rated for everyone.** All problems are authored by me. I would like to thank [user:74TrAkToR,2022-01-01] for excellent round coordination and [user:MikeMirzayanov,2022-01-01] for great Codeforces and Polygon. - Thanks to [user:isaf27,2022-01-01], [user:Nebuchadnezzar,2022-01-01], [user:MichsSS,2022-01-01], [user:TadijaSebez,2022-01-01], [user:ijxjdjd,2022-01-01], [user:Um_nik,2022-01-01], [user:flamestorm,2022-01-01], [user:I_Remember_Olya_ashmelev,2022-01-01], [user:Monogon,2022-01-01], [user:errorgorn,2022-01-01], [user:Mr.Robot_28,2022-01-01], [user:AlexLuchianov,2022-01-01], [user:Kirill22,2022-01-01], [user:Prokhor08,2022-01-01], [user:romanasa,2022-01-01], [user:Dragonado,2022-01-01], [user:arseny.__.,2022-01-01], [user:magnus.hegdahl,2022-01-01], [user:Olly_Z,2022-01-01], [...
There can be an interactive problem in this round. Don't forget to read the [guide on interactive

Full text and comments »

Announcement of Hello 2022
  • Vote: I like it
  • +643
  • Vote: I do not like it

142.
By zscoder, history, 7 years ago, In English
[Tutorial] Generating Functions in Competitive Programming (Part 2) Welcome to Part 2 of my tutorial on generating functions. The [first part](https://codeforces.me/blog/entry/77468) focused on introducing generating functions to those without any background in generating functions. In this post, I will demonstrate a few applications of generating functions in CP problems. Let us start with some relatively straightforward examples. Note: Unless stated otherwise, all computations are done modulo a convenient prime (usually $998244353$). Also, $[n]$ denotes the set $\\{1,2,...,n\\}$. ### Blatant Applications in Counting Problems **Problem.** [AGC 005 Problem F](https://atcoder.jp/contests/agc005/tasks/agc005_f) You have a tree $T$ with $n$ vertices. For a subset $S$ of vertices, let $f(S)$ denote the minimum number of vertices in a subtree of $T$ which contains all vertices in $S$. For all $1 \le k \le n$, find the sum of $f(S)$ over all subsets $S$ with $|S| = k$. Constraints: $n \le 2 \cdot 10^{5}$. <spoiler summary="Solution"> First, ...
we want to find the answer as a polynomial in $y$, which we can read the answer from., )$, we read off the coefficient of $x^{k+M}$. , Our goal is to rewrite our sum in a clear manner so that we can "read off" the coefficients of $u

Full text and comments »

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

143.
By Bazoka13, 2 years ago, In English
Codeforces Round #947 (Div. 1 + Div. 2) Hello, Codeforces! Or, as we like to say in Servalish (created by [user:Serval,2024-05-24]): High-low, Cold-for-seize! We are glad to invite you to participate in [contest:1975], which will start on [contest_time:1975]. The round is a combined round and will be rated for everyone. The problems are prepared by [user:Atomic-Jellyfish,2024-05-24], [user:Nerovix,2024-05-24], [user:SanweiTreap,2024-05-24], [user:Serval,2024-05-24], [user:Toxel,2024-05-24], [user:jhdonghj112,2024-05-24] and me. You will be given **9 problems** to solve in **3 hours**. Scoring distribution will be announced later. We would like to thank everyone that makes this round possible: - [user:errorgorn,2024-05-24] for his &#128056;, &#128561;, &#128077; and &#129398; coordination. - [user:Alexdat2000,2024-05-24] for Russian translation. - [user:BFLSTiger,2024-05-24] and [user:wzy2001wzy,2024-05-24] for providing some <s>rejected</s> problem proposals and discussing problems with us. - [user:2sozx,2024-...
We recommend you to read the statements of all problems. Good luck & Have fun! (=・ω・=)

Full text and comments »

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

144.
By Noam527, 6 years ago, In English
[Tutorial] Supporting Queue-like Undoing on DS In many data structures, the operation of "undo" on the last update can be implemented easily: we can (usually) maintain a stack of the updates, where each update on the stack holds the memory cells it changed, and their original values. To undo an operation, just revert all changes from the top update on the stack. To maintain good complexity, we require the updates to operate in non-amortized time. I've seen this being used multiple times on DSU (without path compression). If we imagine the updates as a sequence, then we can push an update to the end, and pop an update from the end by undo. Then, this sequence is a stack of updates. Here we discuss the idea of having a queue of updates: we can add a new update, or undo the oldest update still active. Specifically, this blogpost attempts to solve the following problem: Given a data structure that can support some updates, some queries and an "undo" operation (each with their own time complexity), how can we create a data structu...

Full text and comments »

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

145.
By Sharon, history, 8 years ago, In English
I am removing my contest proposal from Codeforces I am removing my contest proposal from Codeforces. Note: This is a serious blog post. Also, the opinions presented in this blog are my own and not of my friend [user:BiIIy,2018-12-26] who wrote the contest with me. Today I have removed my contest proposal from Codeforces. I should probably have done this a long time ago. The proposal was made in February, but the problems were written and finished by March, and that is when I opened the contest proposal for review and messaged [user:KAN,2018-12-26]. It is currently December and no progress or development has been made regarding my contest proposal since, so I will be removing it. I have multiple reasons for removing my contest proposal: - I have no motivation to host an online contest anymore. - I am involved in problem setting with two other high school programming contests in my university, and I write, host, and judge another contest for local high schools. - I have forgotten that I “was in the queue” for writing a...

Full text and comments »

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

146.
By shishyando, 5 years ago, In English
Codeforces Global Round 16 **Hello, Codeforces!** On [contest_time:1566] we will host [contest:1566]. **<img src="/predownloaded/2e/e2/2ee2f0f95f05aae6ca6f47812dae2dc2aabf277b.png" style="width: 200.0px;float: right;margin: 0 1.0em 1.0em 1.0em;max-width: 100.0%;max-height: 100.0%;">** It is the fourth round of a 2021 series of [Codeforces Global Rounds](https://codeforces.me/blog/entry/65002). The rounds are open and rated for everybody. The prizes for this round: - 30 best participants get a t-shirt. - 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive. The prizes for the 6-round series in 2021: - In each round top-100 participants get points according to the [table](https://pastebin.com/QT5sXEaT). - The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest. - The best 20 participants over all series get sweatshirts and place certificates. Thanks to XTX, which in 2021 supported the gl...

Full text and comments »

Announcement of Codeforces Global Round 16
  • Vote: I like it
  • +692
  • Vote: I do not like it

147.
By CoderAnshu, 5 years ago, In English
Codeforces Round #793 (Div. 2) Hi Codeforces! I am pleased to invite you to [Codeforces Round #793 (Div. 2)](https://codeforces.me/contest/1682 "Adhocforces Round"), which will take place on [contest_time:1682]. You will be given **6 problems** and **2 hours** to solve them. The round will be rated for participants of Division 2 with a rating lower than 2100. Division 1 participants can participate unofficially in the round. All problems in this round were prepared by me and [user:rivalq,2022-05-19]. We have worked on this round for a long time and hope you find every problem interesting. I would like to thank: - [user:antontrygubO_o,2022-05-19] for marvellous coordination of the round. - [user:errorgorn,2022-05-19], [user:kclee2172,2022-05-19], [user:AmShZ,2022-05-19], [user:nvmdava,2022-05-19], [user:TheScrasse,2022-05-19], [user:aryanc403,2022-05-19], [user:koderkushy,2022-05-19], [user:PurpleCrayon,2022-05-19], [user:nor,2022-05-19], [user:AlperenT,2022-05-19], [user:towrist,2022-05-19], [user:...
Good luck and have fun! See you in the standings. Make sure to read the statements very carefully.

Full text and comments »

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

148.
By pajenegod, history, 6 years ago, In English
(Request) Update PyPy's Version on CF I've always liked using Python (PyPy) for solving problems in competitive programming. And most problems are very doable, even in Python. What I've found is that the most difficult problems to solve in Python are those requiring 64 bit integers. The reason why 64 bit integers are problematic is because CF runs Windows, and PyPy only supports 32 bit on Windows. So whenever a problem involves integers that cannot fit inside of a signed 32 bit int, PyPy switches to big integers (which runs insanely slow, sometimes a factor of 20 times slower). <spoiler summary="What I currently have to do to get around big integers"> ### 1. Switching to floats What I usually try is switching from using integers to floats. This works if all integers are $\leq 2^{52}$: [submission:53441394] (Fat TLE and almost MLE) vs [submission:53456822] (AC by a mile) ### 2. Calculating `a * b % MOD` Many problems on CF involve doing multiplication modulo $10^9 + 7$. This is super slow because of big integ...

Full text and comments »

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

149.
By errorgorn, 2 years ago, In English
Solving Problems with Min Cut Max Flow Duality Thanks to [user:kingmessi,2024-12-19] for pointing out several typos in this blog. This blog is adapted from a previous blog I wrote in my [personal blog](https://errorgorn.github.io/2024/11/24/Flow-Matching.html). I thought it would be good to share the relevant parts here. If you want to read my personal blog, go ahead, but I will warn you that it is a shitpost blog. The problems discussed in this blog is: - [ARC085C](https://atcoder.jp/contests/arc085/tasks/arc085_c) - [ABC225G](https://atcoder.jp/contests/abc225/tasks/abc225_g) - [ABC259G](https://atcoder.jp/contests/abc259/tasks/abc259_g) - [ABC193F](https://atcoder.jp/contests/abc193/tasks/abc193_f) - [ARC142E](https://atcoder.jp/contests/arc142/tasks/arc142_e) You can attempt these problems to see if you can figure out how to wrangle them into min-cut formulation knowing that they are min-cut. I have been told by a lot of old people that in the heydays of Topcoder it was flow meta. Those old people will obviou...
the reader to turn it into the proper min-cut version.

Full text and comments »

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

150.
By peltorator, 7 months ago, In English
So Do You Really Understand Fast Matrix Multiplication? Most of you have probably heard of $\omega$, the matrix multiplication exponent. Are you sure you fully understand its definition, though? I thought so too, until I started asking myself some uncomfortable questions and realized that I had some subtle misconceptions. To answer these questions, I read a bunch of papers and book chapters, and now I have some peace of mind. Let me try to scare you a bit first and then hopefully rebuild your understanding of fast matrix multiplication. Let's start with four questions. Try to answer them before reading further. Q1: Does there exist an $O(n^{\omega})$-time matrix multiplication algorithm? Q2: Does there exist an $o(n^{\omega})$-time matrix multiplication algorithm? Q3: Does there exist an $O(n^{\omega + 0.1})$-time algorithm for integer matrix multiplication? Q4: Does there exist an $O(n^{\omega - 0.1})$-time algorithm for integer matrix multiplication? <spoiler summary="Answers"> A1: Maybe. We don't know. A2: ...

Full text and comments »

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

151.
By Um_nik, history, 10 years ago, In English
F.A.Q. (in PM) Q1: I'm a newbie. What should I do to become great coder? A1: <s>Stop doing competetive programming</s> Solve problems. Q2: I'm doing CP for two months and I'm still <s>not red</s> green. What should I do? A2: <s>You are lazy and impatient</s> Solve more problems. Q3: You became a red in less than two years, it is unbelievable! A3: No, it isn't. <s>You can do it too if you will solve fucking problems.</s> Q4: You became a red blah-blah-blah such a huge fan blah-blah. Oh, and what should I do to become as great as you? A4: ... right. You already know the answer. Solve problems. <s>I hate you.</s> Q5: I'm not good at DP [or something]. What can you suggest? A5. Maybe you should try to <s>stop asking stupid questions and</s> solve some problems on DP? Or read some blogs and editorials. Q6: I can't solve a problem / understand your code. Can you help me? (Well, it is not a bad question in general. It is a good (if you really want me to explain something not...
asking stupid questions and solve some problems on DP? Or read some blogs and editorials.

Full text and comments »

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

152.
By PurpleCrayon, 5 years ago, In English
[Tutorial] Simulated Annealing in Competitive Programming Hi Codeforces! I've recently noticed a lack of simulated annealing tutorials, so I decided to make one. It all started when I was trying to "cheese" [problem:1556H] after the contest. In general, simulated annealing is a pretty niche topic, but it can sometimes lend you unintended solutions for very hard problems. It's also very useful in contests like Google Hashcode, where you can add simulated annealing to an already good solution to make it a lot better. Simulated annealing's name and terms are derived from physical annealing, the process of letting metals or glass cool down and harden while removing internal stresses. An Overview ------------------ Simulated Annealing is an approximation algorithm. It's generally useful in problems with low constraints (i.e. $n \leq 50$ or $n \leq 100$) where you need to find the minimum/maximum of something over all possible states (and there are usually way too many of them to check). In general, it's good at finding the global maximum...

Full text and comments »

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

153.
By purplesyringa, 5 years ago, In English
This is not an exit. ![This is not an exit.](https://i.ibb.co/N9zrDNp/cf.png) I am looking at the post called [*Is Mike Mirzayanov dictator?*](https://codeforces.me/blog/entry/94033) at the moment. I'm reading through the comments, I'm looking at people's reactions, I'm reading Mike's replies, and... I am utterly disappointed. I demand progress. For context, I do believe Codeforces is the best website for competitive programming contests at the moment. I sincerely give credit to Mike for creating Codeforces and providing participants and contest authors a platform for interaction completely for free. I am confident that Codeforces is the most appropriate website for being *the* platform for sharing knowledge, exchanging tricks and methods, and collaboration between both contest participants, their authors, and coordinators. **Please consider this an open letter**, for this is a will not of a single person, but of many individuals. Please consider signing it by stating so in a comment under the...
We're no investors. We can and do read and process the information we are given. We do notice

Full text and comments »

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

154.
By Kuroni, 7 years ago, In English
Slope trick explained _Special thanks to [user:Ari,2020-05-13] for helping me proof-reading this blog :D_ Hi everyone! Some years ago I read [user:zscoder,2020-05-12]'s tutorial on slope trick. Initially, I found the blog a bit difficult to understand, so I came up with a different explanation and system for my personal use. Today, I finally have the courage to share it with you guys. So without further ado, let's get started! #### Formulation and properties Slope trick is a way to represent a function. Here, I denote that a function is **slope-trick-able** (sorry for the lack of creativity) if the function satisfies 3 conditions: 1. It is continuous. 2. It can be divided into multiple sections, where each section is a linear function with an integer slope. 3. It is a convex/concave function. In other words, the slope of each section is non-decreasing or non-increasing when scanning the function from left to right. For example, the function $y = f(x) = |x|$ is a slope-trick-able function ...

Full text and comments »

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

155.
By Monogon, history, 6 years ago, In English
Efficient 3D Convex Hull Tutorial _Warning: The following contains graphic depictions of geometry, precision errors, and degenerate cases. Viewer discretion is advised._ ### Prerequisites I assume the reader is familiar with: - 2D Convex Hulls - 3D Vector Operations (dot and cross products) ### Introduction Recall that in the 2D convex hull problem, you are given a set of 2D points, and you must compute the smallest convex polygon containing all the given points. By convex, we mean that for any two points $A$ and $B$ inside the polygon, the entire line segment $AB$ is also inside the polygon. The problem in 3D is completely analogous. You are given $n$ 3D points, and you must compute the smallest convex polyhedron containing all the given points. Similarly, a polyhedron is convex if for any two points $A$ and $B$ inside the polyhedron, the line segment $AB$ is also inside the polyhedron. In the 2D case, it is more obvious what the output is. We can simply output a circular list of vertices on the ...
I assume the reader is familiar with:

Full text and comments »

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

156.
By kpw29, 6 years ago, In English
Meet IT Codeforces Round Editorial Thank you very much for taking part in the contest! <spoiler summary="Contest timeline"> - -0:05. Starting the chat with the Questions Answering team: [user:tnowak,2020-11-15] and our beloved coordinator [user:antontrygubO_o,2020-11-15]. We hope that there won't be that many questions :) - -0:01. One minute to go! I hope that everything goes smoothly. I'm so afraid of posting the editorial accidentally that I moved this timeline into another blog... - 0:01. First blood in Div2! Congratulations to [user:majorro,2020-11-15]!. - 0:03. First blood in Div1 as well! Congratulations to [user:Errichto,2020-11-15], your knapsack is ready for a journey to win! - 0:04. [user:Sho10,2020-11-15] first to solve Div2B. Well done! - 0:05. We also have the first question. So far so good... - 0:06. [user:Um_nik,2020-11-15] gets the first pretests pass in Div1B. The cheaters are caught! - 0:09. [user:bandiaoz,2020-11-15] packs the first Knapsack in Div2! A difficulty spike is coming... - 0:12....
An inquisitive reader may wonder why it doesn't hurt to always apply case $2$ in calculations, so

Full text and comments »

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

157.
By Errichto, 10 years ago, In English
Good Bye 2016 sponsored by Barcelona ACM-ICPC Camp Hello everybody! On December 30 at 14:05 UTC/17:05 MSK ([check your time zone here](http://timeanddate.com/worldclock/fixedtime.html?day=30&month=12&year=2016&hour=17&min=5&sec=0&p1=166)) Codeforces will host the New Year's contest Good Bye 2016. The contest is combined for both divisions, lasts 2.5 hours and contains 8 problems. Thanks to <a href="http://harbour.space/">Harbour.Space</a> and <a href="http://in.harbour.space/icpc/"> Barcelona ACM-ICPC Programming Bootcamp 2017</a> sponsoring the contest, winners can expect really cool prizes: - 5 best participants (not ACM ICPC veterans) will win free participation in Hello Barcelona programming bootcamp. - 30 best participants (not ACM ICPC veterans) will receive a 30% discount for participation in Hello Barcelona programming bootcamp. - 100 best participants will receive t-shrits by organizers and Codeforces. <center> <img src="http://codeforces.me/predownloaded/dd/0f/dd0fbc52ada73fb48011ce52adee739a248fa804.png"/> </...
themselves. I tried to keep statements shorter than usually so it may be a good idea for you toread more

Full text and comments »

Announcement of Good Bye 2016
  • Vote: I like it
  • +556
  • Vote: I do not like it

158.
By EvenImage, history, 8 years ago, In English
A problem collection (Spoiler Alert) SPOILER ALERT : If you didn't solve the problems in NEERC and you want to enjoy the problems, please don't read. <spoiler summary="Spoiler"> It looks there are few problems about general graph matching in the community. And there are a few teams who solved problem B in NEERC both online and onsite. However, the reduction from maximum cost perfection matching to this problem is simple to me. So I want to share some problems for practice. You can find the template [here](http://uoj.ac/problem/81/statistics) and [here](http://uoj.ac/problem/79/statistics). The [shortest code](http://uoj.ac/submission/282287) of the maximum cost matching problem is about 5.7k. There is a simple way to find the cardinality of the maximum matching, which is half of the rank of the Tutte matrix. We can use Gaussian elimination to compute the rank of a matrix. By the way, if the maximum cost is no more than $W$, we can also find the maximum cost matching by Tutte matrix and polynomial interp...
, please don't read.

Full text and comments »

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

159.
By MikeMirzayanov, 6 years ago, In English
Codeforces: Results of 2020 [Annual Report] Hi Codeforces! Yes, I know it's already April. Time flies so fast lately! Exactly a year ago we were just learning all the "delights" of lockdown. So let's remember this 2020! What was it like? I don't know about you, but we had a hell of a lot of work. I will now show you some graphs and you will be very surprised. Lockdown effect? Of course, but we did our best too. Many thanks to everyone who did not stand aside! In 2020, we celebrated our 10th anniversary and crowdfunding money helps us grow and move forward. You helped us and each other. Thank you. <a href="https://codeforces.me/10years/supporters">Thank you for your contribution!</a> We've been working hard all year to make this community a better place. Did it work out? It's up to you to judge. Many thanks to everyone who invested time and effort: * [user:geranazavr555,2021-04-09], [user:kuviman,2021-04-09], [user:cannor147,2021-04-09] helped a lot with development and new features; * [user:Una_Shem,2021-...
://codeforces.com/blog/entry/88691">the post with a list of major innovations. Did youread it? If

Full text and comments »

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

160.
By TLE, 8 years ago, In English
Avito Cool Challenge 2018 Hi! I'm glad to invite you to participate in [contest:1081] which starts on [contest_time:1081]. The round will be rated to participants of both divisons. ![img](/predownloaded/3a/30/3a3056d60465d83be2f0aed62ed27de1ea989beb.jpg) The problem setters are [user:fjzzq2002,2018-12-15], [user:yjq_naive,2018-12-15], [user:fateice,2018-12-15], [user:yanQval,2018-12-15] and [user:quailty,2018-12-15]. We would like to thank: - [user:_kun_,2018-12-15] and [user:300iq,2018-12-15] for coordinating and helping us with the round. - [user:lewin,2018-12-15], [user:Ashishgup,2018-12-15], [user:winger,2018-12-15], [user:AlexFetisov,2018-12-15], [user:gritukan,2018-12-15] and [user:isaf27,2018-12-15] for testing the round and giving advice. - [user:choutii,2018-12-15] for playing a crucial role in the contest. (you'll see.) - [user:MikeMirzayanov,2018-12-15] for awesome Codeforces and Polygon. - Avito for generously sponsoring this round. This round is conducted on the initiative a...
before, please read [this](https://codeforces.me/blog/entry/45307).

Full text and comments »

Announcement of Avito Cool Challenge 2018
  • Vote: I like it
  • +557
  • Vote: I do not like it

161.
By bashkort, 19 months ago, In English
FAQ, Advice & AMA This post assumes you're super ambitious. But don't take any advice too seriously -- we're all different. This is simply what worked for me and might work for you. Choose your own path. #### Useful Links - [LI2 Contests](https://codeforces.me/blog/entry/131164) -- used this course when I was starting out. - [usaco.guide](usaco.guide) -- a collection of great articles & problems on almost all topics. - [OI Checklist](https://docs.google.com/spreadsheets/d/15b1ZaP1owTfTcA4vQ69A5S_wUd_vJmM8Slwu6FiWgP4/edit?usp=sharing) -- my OI Checklist. - [Pavel Mavrin's youtube channel](https://www.youtube.com/channel/UC9WDkCyUlNTncq1Y-mFSgLQ) -- watched his great lectures when I was younger :) - [qoj.ac](qoj.ac), [loj.ac](loj.ac), [dmoj.ca](dmoj.ca), [oj.uz](dmoj.ca), ... #### How do I start? **Advice:** join a great community (school, club, ...), try solving problems, and find someone who can answer your silly questions. I wouldn't have started CP if not for my school. Of c...
starting again, I'd just read the whole Codeforces Catalog. [Here's the funniest trick I've found :)](https, #### Read blogs, #### When to read editorials?, ://paulgraham.com/articles.html). In particular, if you want to do great things, make sure toread, Now I try to read the editorials for the problems I know I won't be coming back to.

Full text and comments »

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

162.
By SlavicG, 3 years ago, In English
Codeforces Round 918 (Div. 4) Happy Holidays Codeforces! &#127877; [user:mesanu,2023-12-27], [user:flamestorm,2024-04-22] and I are very excited to invite you to [contest:1915]! It starts on [contest_time:1915]. The format of the event will be identical to Div. 3 rounds: - 5-8 tasks; - ICPC rules with a penalty of 10 minutes for an incorrect submission; - 12-hour phase of open hacks after the end of the round (hacks do not give additional points) - after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated - by default, only "trusted" participants are shown in the results table (but the rating will be recalculated for all with initial ratings less than 1400 or you are an unrated participant/newcomer). We urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism but to take part unofficially. Please do not spoil the contest for the official participants. Only _trusted participants of the f...

Full text and comments »

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

163.
By antontrygubO_o, 4 years ago, In English
Problems that I authored so far **UPD 1 [May 17 2025]:** I added my problems from Ukrainian Olympiad in Informatics (among others). They are available here: [contest:105820] Hi everyone! I wanted to write such a blog for a long time, motivated by similar blogs [by](https://codeforces.me/blog/entry/108940) [user:adamant,2023-02-20] and [by](https://codeforces.me/blog/entry/108595) [user:tibinyte,2023-02-20]; I finally decided to do it after my Universal Cup contest. This is not a super-comprehensive list, I also set some problems for some local contests, but that's most of it. I want to encourage other setters to write such blogs. For me, it's very interesting to read about the backstories of some problems and also to see all the problems by some author gathered in one place (as most authors give problems to several platforms). One important point. As you will see from the comments, many of my problems were improved by other people, and I myself improved some problems by other people. I think that it's cruc...
I want to encourage other setters to write such blogs. For me, it's very interesting toread about

Full text and comments »

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

164.
By ko_osaga, history, 7 years ago, In English
Story about edge coloring of graph You are given a graph $G$, and for each vertex $v$ you have to assign a positive integer **color** such that every adjacent pair of vertices (vertices directly connected by edge) have different color assigned. You have to minimize the maximum color assigned: In other words, you have to minimize the number of distinct assigned colors. But that's [graph coloring](https://en.wikipedia.org/wiki/Graph_coloring) (vertex coloring). It's hard. Ok, one more time: You are given a graph $G$, and for each **edge** $e$ you have to assign a positive integer **color** such that every adjacent pair of edges (edges sharing same endpoints) have different color assigned. You have to minimize the maximum color assigned: In other words, you have to minimize the number of distinct assigned colors. This is the edge coloring of graph, and I will talk about this now. *Note that this can be interpreted as "graph coloring (vertex coloring) of line graphs". In that sense, you can consider in a similar...

Full text and comments »

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

165.
By IgorI, history, 6 years ago, translation, In English
Codeforces Round #694 (Div.1, Div.2) Hello Codeforces! Now the winter SIS (Summer Informatics School) is taking place, and parallel A+A0 and its teachers have prepared a complete Codeforces Round. You can check previous rounds, prepared by SIS students: [Codeforces Round #612](https://codeforces.me/contests/1286,1287), [Codeforces Round #530](https://codeforces.me/contests/1098,1099). [Codeforces Round #694](https://codeforces.me/contests/1470,1471) begins on [contest_time:1470]. In both redactions, there will be $6$ problems for $2$ hours. The round is rated for both divisions. Problems are authored and prepared by [user:AliceG,2019-03-03], [user:Pakhomovee,2020-05-01], [user:MadProgrammer,2020-07-30], [user:ArtNext,2019-12-14], [user:fastmath,2019-09-28], [user:IgorI,2017-12-28], [user:Kapt,2018-10-11], [user:KhB,2019-10-26], [user:Helloo_zk,2020-03-01], [user:ipamaro,2018-12-30], [user:Arbuzniy_kekich,2020-02-17], [user:Mangooste,2020-02-17], [user:pelmenner,2019-10-13], [user:Allvik06,2020-04-08] under the...
We recommend you to read the statements of all problems. Scoring will be announced later.

Full text and comments »

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

166.
By Marslai24, 5 years ago, In English
The Miracle 8 Minutes Hello, this is the first time I write a blog. I want to share an inspiring story with you. In the last [contest:1569] was unforgettable to me. After pA got AC quickly, I move onto pB. And stuck in the greedy method, this made me feel kind of nervous. So I skipped pB and read pC. Soon, I got some thought on it. So I started to work on that one. However, things didn't go so well, I stuck in the problem and cannot come up with the correct implementation. I started to feel distraught, submitted five times still not changed anything. I'm really depressed, so I went to pD, and came up with the solution quickly. Although everything seemed being messed up by myself, I still wanted to give it a try. I kept telling me that i can do this, if I don't try, then the contest would really over. Ten minutes remaining, but I still not got it done, I started to feel frustrating, but at the same time, I passed the sample input. I submitted it right away. To my surprise, it got accepted immediately, and...

Full text and comments »

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

167.
By Geothermal, history, 4 years ago, In English
Returning to In-Person GCJ/Hacker Cup Finals In the past, most elite programming competitions (e.g. IOI, ICPC, TopCoder Open, AtCoder World Tour, GCJ, Hacker Cup) have held their final stages in person. In 2020 and 2021, however, most of these contests were moved online. This was unfortunate, but understandable given the circumstances: in 2020, the state of the pandemic clearly did not allow for extensive travel, and while the dangers decreased by late 2021 as a result of rising vaccination rates around the world, there was still sufficient uncertainty to justify holding events online in 2021. This year, however, both Google Code Jam and Meta Hacker Cup have committed to hosting online finals. [**UPD:** Meta has retracted its commitment to a virtual finals, so it seems that the plans for MHC are still up in the air.] I believe that this is a highly unnecessary precaution--there is plenty of evidence showing that it is possible to successfully run an in-person event in 2022. Notably, TopCoder has committed to hosting the...

Full text and comments »

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

168.
By Errichto, 7 years ago, In English
Bitwise operations 2 — popcount & bitsets Part 1 ([link](https://codeforces.me/blog/entry/73490)) introduces basic bitwise operations. This is part 2 and it's mainly about (in)famous bitsets and example problems. Also, see links to very useful advanced stuff at the bottom. EDIT: here's [video version](https://www.youtube.com/watch?v=jqJ5s077OKo&list=PLl0KD3g-oDOHpWRyyGBUJ9jmul0lUOD80) of this blog (on my Youtube channel). ### Built-in functions In C++, `__builtin_popcount(x)` returns popcount of a number &mdash; the number of ones in the binary representation of $x$. Use `__builtin_popcountll(x)` for long longs. There are also `__builtin_clz` and `__builtin_ctz` (and their long long versions) for counting the number of leading or trailing zeros in a **positive** number. Read more [here](https://www.geeksforgeeks.org/builtin-functions-gcc-compiler/). Now, try to solve these two simple tasks in $O(1)$, then open the spoiler to check the solution: <spoiler summary="Compute the biggest power of 2 that is a divisor o...
convenient. You can read and print binary numbers, construct a bitset from int or string `bitset<100> a, Note that the size of the bitset must be a constant number. You can't read $n$ and then declare

Full text and comments »

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

169.
By AmShZ, 4 years ago, In English
Codeforces Round #800 Hi Codeforces! [user:Keshi,2022-06-13], [user:alireza_kaviani,2022-06-13] and I are delighted to invite you to participate in [contest:1693] and [contest:1694]. - Start time: [contest_time:1693] - Duration: $120$ minutes - Number of Tasks: $6$ for both divisions - Rated range: ($-\infty$,$1899$] for Div2, [$1900$, $\infty$) for Div1 We are honored to have set the 800th Codeforces round. We wish this wonderful platform all the best along with many other exciting rounds. Huge thanks to the following people: - [user:antontrygubO_o,2022-06-13] for his breath-taking coordination. - Our testers [user:um_nik,2022-06-13], [user:errorgorn,2022-06-13], [user:koosha_mv,2022-06-13], [user:irkstepanov,2022-06-13], [user:ArchUser84,2022-06-13], [user:sohsoh,2022-06-13], [user:fatemetmhr,2022-06-13], [user:Dorost,2022-06-13], [user:nor,2022-06-13], [user:pooya-shams,2022-06-13], [user:Arnch,2022-06-13], [user:Kahou,2022-06-13] and [user:mosaev,2022-06-13] for testing the round an...
Please read all of the problems and their notes, enjoy your time and solve as many as you can! Good

Full text and comments »

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

170.
By pajenegod, 3 years ago, In English
The Ultimate Reroot Template Hi Codeforces! Have you ever had this issue before? ![ ](https://cdn.discordapp.com/attachments/572613134020247562/1191774699110285392/image.png?ex=65a6a9ae&is=659434ae&hm=aeb62b0d97a84c226709b88bc3db7647f4509eef7c3a757a798ffe37e7e91c2b&) If yes, then you have come to the right place! This is a blog about my super easy to use template for (reroot) DP on trees. I really believe that this template is kind of revolutionary for solving reroot DP problems. I've implemented it both in [Python](https://codeforces.me/contest/1324/submission/240129139) and in [C++](https://codeforces.me/contest/1324/submission/240131453) (the template supports `Python2`, `Python3` and `>= C++14`). Using this template, you will be able to easily solve > 2000 rated reroot problems in a couple of minutes, with a couple of lines of code. A big thanks goes out to everyone that has helped me by giving feedback on blog and/or discussing reroot with me, [user:nor,2024-01-03], [user:meooow,2024-01-03], [u...
you just want to use `rerooter` as a black box, then you don't have to read or understand the rest

Full text and comments »

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

171.
By Vladithur, 2 years ago, In English
EPIC Institute of Technology Round Summer 2024 (Div. 1 + Div. 2) <a href="https://epic-institute.io/"><img alt="EPIC" src="https://assets.codeforces.com/images/deltix/2_logo.gif" style="float:right; height: 154px; padding-left: 35px; padding-right: 73px; padding-top: 41px; padding-bottom: 33px;"/></a> Hi, Codeforces! We are pleased to invite you to [contest:1987], which will be held on [contest_time:1987]. You will be given **8 problems**, two of which are divided into two subtasks, and you will have **3 hours** to solve them. The round will be rated for **everyone**. At least one of the problems will be interactive, so please read the [guide for interactive problems](https://codeforces.me/blog/entry/45307) if you are not familiar with it. We would like to thank: - [user:errorgorn,2024-06-27] for coordinating the round. - [user:Geothermal,2024-06-27], [user:turmax,2024-06-27], [user:noimi,2024-06-27], [user:SomethingNew,2024-06-27], [user:feecIe6418,2024-06-27], [user:Endagorion,2024-06-27], [user:glebustim,2024-06-27], [user:zelibo...
At least one of the problems will be interactive, so please read the [guide for interactive

Full text and comments »

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

172.
By viktork, 12 years ago, translation, In English
ZeptoLab Code Rush 2015 Hello, Codeforces! <b><i>The problems were suggested by users [user:roosephu,2015-04-04] and [user:sunayuki,2015-04-04]. The great help in preparing was provided by [user:Aksenov239,2015-04-04], [user:GlebsHP,2015-04-04] and Codeforces team. ZeptoLab Team did its best while working on statements.</i></b> <b><i>The round will use smoother dynamic problem scores with 250 points steps.</i></b> In 2014 we hosted our [first programming contest](/zeptolab2014) together with Codeforces, and we liked it! Let me shortly remind you how it was. The contest consisted of 6 problems, 2.5 hours were given to solve (you can have a look at the problems of the previous year and try to solve them [here](/contest/436)). Of course, even on a purely coding event we stayed true to ourselves, so all problems were designed based on our games, and, of course, we illustrated them with care: <center> <img src="http://assets.codeforces.com/images/zepto2015/pics2014.jpg"/> </center> Zepto C...
our company by a simplified scheme. You can read about ZeptoLab on [our official website](http

Full text and comments »

Announcement of ZeptoLab Code Rush 2015
  • Vote: I like it
  • +886
  • Vote: I do not like it

173.
By Aris, 5 years ago, In English
Codeforces Round #764 (Div. 3) Hello! [contest:1624] will start at [contest_time:1624]. You will be offered 7-8 problems with expected difficulties to compose an interesting competition for participants with ratings up to 1600. However, all of you who wish to take part and have a rating of 1600 or higher, can 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**. You will be given **7-8 problems** and **2 hours and 15 minutes** to solve them. One of the problems in this round is **interactive**. Don't forget to read the [guide on interactive problems](https://codeforces.me/blog/entry/45307). Note that the **penalty** for the wrong submission in this round is **10 minutes**. [Remember](https://codeforces.me/blog/entry/59228) that only the trusted participants of the third division will be included in the official s...
problems in this round is **interactive**. Don't forget to read the [guide on interactive problems](https

Full text and comments »

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

174.
By sszcdjr, history, 2 years ago, In English
Refact.ai Match 1 (Codeforces Round 985, Div. 1 + Div. 2) Hello, Codeforces! We (KDOI Team) are glad to invite you to take part in [contest:2029], which is the 8th CP contest held by us! You can view the previous rounds by us [here](/blog/entry/135847). - Number of problems: $9$ ($0$ interactive); - Start time: [contest_time:2029]; - Contest duration: $180$ minutes; - Score distribution: $750-1250-1750-2250-2500-3000-3500-5000-5500$. The problems were authored and prepared by [user:Error_Yuan,2024-11-05], [user:wyrqwq,2024-11-05], [user:Otomachi_Una,2024-11-05] and me [user:sszcdjr,2024-11-05]. --- <img src="/predownloaded/73/e1/73e1593107761ee6b925164110aa7307488b2215.png" style="float:right; margin: 0 0 2em 2em; width:300px;"/> A few words from our sponsor: We’re [Refact.ai](https://refact.ai/?utm_source=codeforces&utm_medium=post&utm_campaign=round_09112024&utm_content=cf_short_09112024), an open-source AI Coding Assistant, and on November 9th, we’ll be hosting our first round on Codeforces! Winners will receive ...
testing and deployment. You can read more about us in [this announcement](/blog/entry/135908).

Full text and comments »

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

175.
By catgirl, 12 months ago, In English
I have solved problems on Codeforces for 500 days in a row It's been a while since I started my journey into competitive programming and in this year and (almost) a half I would say that I learned a bit not only about problem solving but also about myself, so I wanted to share my reflections on some mental aspects of practicing competitive programming hoping they can help someone else. Please note that these reflections are merely personal and mostly stem from personal experience, if you disagree with something I would like to know your point of view! I would also like to thank [user:Intellegent,2025-12-08], [user:turska,2025-12-08] and [user:LMeyling,2025-12-08] for proofreading. ![ ](/predownloaded/07/0b/070b72002cfad69b15bb24a5a086d9b8466bcb96.png) #### Some background I used to do math olympiads for 8 years before starting university, in hindsight I did not really like it that much since I never practiced on my own and would've rather played League of Legends / Minecraft / VALORANT or whatever game I was obsessed at the time. ...
1. [The Codeforces catalog](https://codeforces.me/catalog) (please read it, it's very good)

Full text and comments »

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

176.
By awoo, history, 6 years ago, translation, In English
Educational Codeforces Round 90 [Rated for Div. 2] Hello Codeforces! On [contest_time:1373] [contest:1373] will start. Series of Educational Rounds continue being held as [Harbour.Space University](https://harbour.space/) initiative! You can read the details about the cooperation between [Harbour.Space University](https://harbour.space/) and Codeforces in the <a href="http://codeforces.me/blog/entry/51208">blog post</a>. This round will be **rated for the participants with rating lower than 2100**. It will be held on extended ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally. You will be given **6 or 7 problems** and **2 hours** to solve them. The problems were invented and prepared by Roman [user:Roms,2020-06-24] Glazov, Adilbek [user:adedalic,2020-06-24] Dalabaev, Vladimir [user:vovuh,2020-06-24] Petrov, Ivan [us...
://harbour.space/) initiative! You can read the details about the cooperation between [Harbour.Space University

Full text and comments »

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

177.
By peltorator, 4 years ago, In English
Codeforces Month of Blog Posts (win $300) **TL;DR:** Write an interesting CodeForces blog post until February 15th and win $300. **UPD: Second place will receive $50.** **UPD2: Competition is over, The results are available [here](https://codeforces.me/blog/entry/113041).** I am a huge fan of CodeForces and specifically CodeForces blog posts! There are tens and hundreds of gems posted on this platform throughout the years. Thankfully, recently there was added the [catalog](https://codeforces.me/catalog) page where a lot of cool articles can be found. Personally, if I want to remember some classical algorithm, I would go to websites like [cp-algorithms](https://cp-algorithms.com/), but CodeForces is the place where new or rare stuff is born, where new points of view emerge. I think it is one of the most valuable functions of this website, and I would like to facilitate its growth. I know that many people have cool ideas in their minds that they came up with or maybe something that is known only in their community on ...

Full text and comments »

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

178.
By okwedook, 6 years ago, translation, In English
Codeforces Round #703 (Div. 2) Editorial [problem:1486A] <spoiler summary="Hint1"> What's the lower bound for the amount of blocks for the answer to be $\texttt{YES}$? </spoiler> <spoiler summary="Hint2"> Check the predicate for every prefix. </spoiler> <spoiler summary="Solution"> Let's consider the smallest amount of blocks we need to make the first $i$ heights ascending. As heights are non-negative and ascending the heights should look like $0, 1, 2, 3, ..., i - 1$, so the minimum sum is $\frac{(i - 1) \cdot i}{2}$. It turns out that this is the only requirement. If it's not the case for every prefix the answer is $\texttt{NO}$ because we can't make some prefix ascending. Otherwise the answer is $\texttt{YES}$ because you can move the blocks right till there is at least $i$ blocks in the $i$-th stack and this would make the heights ascending. </spoiler> Solution using C++: [submission:107892022]<br> Solution using Python: [submission:107892053] [problem:1486B] <spoiler summary="Hint1"> Is proble...
Did you read that $w$ is at most $50$?

Full text and comments »

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

179.
By Dormi, 5 years ago, In English
Codeforces LATOKEN Round 1 (Div. 1 + Div. 2) Hello, Codeforces! Welcome to the [contest:1534] supported by LATOKEN, that will start on [contest_time:1534]. It will be a combined rated round for both divisions (and div 3). **Please, note the unusual start time.** All problems were created by [user:Aaeria,2021-06-09], [user:crackersamdjam,2021-06-12], [user:Dormi,2021-06-09], [user:Ninjaclasher,2021-06-09], and [user:Plasmatic,2021-06-09]. We would like to thank: - Valentin Preobrazhenskiy from LATOKEN supporting the round. - [user:300iq,2021-06-10] and [user:kan,2021-06-10] for coordinating the round and answering our relentless questions. - [user:arvindr9,2021-06-09], [user:delmos,2021-06-09], [user:duality,2021-06-09], [user:growup974,2021-06-09], [user:m371,2021-06-09], [user:purplecrayon,2021-06-09], [user:rkm62,2021-06-09], [user:socho,2021-06-09], [user:wleung_bvg,2021-06-09], and [user:zeyu,2021-06-09] for their invaluable advice and suggestions. - [user:MikeMirzayanov,2021-06-09] for great systems Codeforces...

Full text and comments »

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

180.
By gepardo, history, 8 years ago, In English
An alternative sorting order for Mo's algorithm Hello, Codeforces! I think many of you know about Mo's algorithm. For those, who don't know, please read this [blog](https://codeforces.me/blog/entry/7383). Here, I consider an alternative (and faster) approach of sorting queries in Mo's algorithm. # Table of contents * [Canonical version of the algorithm](#s1) * [Achieving a better time complexity](#s2) * [Relation to TSP](#s2-1) * [Hilbert curve](#s2-2) * [Benchmarks](#s3) * [Applicability](#s4) <div style="font-size: 1pt"> &nbsp; [cut] &nbsp; </div> <a name="s1"></a> # Canonical version of the algorithm The canonical version of this algorithm has $O((n + q)\cdot\sqrt{n})$ time complexity if insertions and deletions work in $O(1)$. Usually, the two comparators for query sorting are used. The slowest one: ~~~~~ struct Query { int l, r, idx; inline pair<int, int> toPair() const { return make_pair(l / block, r); } }; inline bool operator<(const Query &a, const Query &b) { re...
I think many of you know about Mo's algorithm. For those, who don't know, please read this [blog, Thanks to everyone who read this article! I hope it will be useful for someone.

Full text and comments »

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

181.
By dreamoon_love_AA, 12 years ago, In English
If you ask me how to improve your algorithm competition skill, I will give you the link of this blog. In recent one year, I don't know why but there are many people sending messages to me for asking similar problems. So I decide to create this blog. In the beginning, I must say, you may feel disappointed after reading this blog. Because I don't have any special tips. My study method has wasted me many many time. There are some basic points I think you have known. 1. **Practice, practice, and practice.** I take so many time to think and solve problems. I think I do it 5 hours a day on average. 2. **Make friends with many awesome people.** I know many awesome people. For example, [user:arosusti,2015-02-24], [user:kelvin,2015-02-24], peter50216([user:0O0o00OO0Oo0o0Oo,2015-02-24]), [user:seanwu,2015-02-24], [user:Shik,2015-02-24], [user:takaramono,2015-02-24], [user:tmt514,2015-02-24], ... If I have some problems that I can't solve in few weeks, I can almost get solution from my friends. Then I say what I do for training myself. When I do problems. There are two possi...
I usually read AC code of other people even I can solve it. Sometimes we can found a totally

Full text and comments »

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

182.
By cip999, 5 years ago, In English
Editorial of Global Round 15 We hope you liked the problems! Before we go ahead with the editorial, let us make some general comments about this round. Problems A, B, C, D, E, F are "div 2" problems, while problems G, H, I are meant to be solved by Grandmasters. Overall, our goal was to provide a problemset that could be enjoyable for a wide range of participants and such that the winner could solve all the problems. There were three big "jumps" in the difficlty gaps between consecutive problems. Problems A and B are meant to be easy, many contestants have the skills and the techniques to attack them (and, maybe, to solve them). Problems C, D, E, F are gradually harder but the difficulty gap between C and F is not as large as usual (and this is reflected in the score distribution). The same holds for problem G, H, I; the difficulty gap between G and I is relatively small (but there is a big score difference because coding I is much harder). Sadly, we discovered 14 minutes into the round that problem I...
Let us now make some predictions (you, future reader

Full text and comments »

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

183.
By Um_nik, history, 4 years ago, In English
MIT Mystery Hunt Disclaimer: This blog is not about competitive programming; you probably will not learn anything about algorithms and data structures. In other words, it doesn't qualify for [this initiative](https://codeforces.me/blog/entry/110840), but I want to give a link to it anyways because I think it's cool. I love solving problems. No, seriously. I LOVE it. The mindset described in [this blog](https://codeforces.me/blog/entry/91114) is 100% how I feel. But it is not constrained to competitive programming problems. I loved math problems for a much longer time, and physics was somewhere there. But I also love solving puzzles. And playing puzzle games on the computer (well, on consoles). And participating in intellectual games. I am not as good in them as in cp, but it was never about being good for me, I just love the process. And I think that there might be some people with a similar love for puzzles among competitive programmers, this is why I decided to write this blog on CF <s>and no...
Around 2 am in the night I thought that we should request a hint. The hint was " Read the flavor

Full text and comments »

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

184.
By TheScrasse, 12 months ago, In English
Codeforces Round 1066 (Div. 1 + Div. 2) <img src="/predownloaded/13/18/131877f87a8429bb2b0f2038d88cfa74db11fafd.png" align="right" style="height: 250px;" alt="text"/> Ciao, Codeforces! We're glad to invite you to take part in [contest:2157], which will start on [contest_time:2157]. You will be given **9 problems** and **3 hours** to solve them in both divisions. The round will share some problems with [The 2025 ICPC Southwestern Europe Regional Contest (SWERC) 2025](http://www.swerc.eu/2025/). **Note the unusual starting time.** Some of the problems might be interactive, so please read the [guide for interactive problems](https://codeforces.me/blog/entry/45307) if you are not familiar with it. The problems were authored and prepared by [user:KLPP,2025-11-19] and me. We would like to thank - [user:Dominater069,2025-11-19] for his &#128173; &#128161; &#127880; coordination; - [user:Alexdat2000,2025-11-19] for Russian translation; - [user:dario2994,2025-11-19] for VIP testing; - [user:Geothermal,2025-11-19],...
Some of the problems might be interactive, so please read the [guide for interactive problems

Full text and comments »

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

185.
By Wind_Eagle, history, 5 years ago, translation, In English
Where the author of the contest came up entertaining. Cheating cheaters. Hello, Codeforces! A month ago I have wrote [my blog about cheaters](https://codeforces.me/blog/entry/94300). Under that blog, a number of suggestions have accumulated, and there is a number of interesting ideas that could be applied to sabotage a group of cheaters. I've often seen comments along the lines of: <spoiler summary="Pictures">. <a href="https://imgbb.com/"><img src="https://i.ibb.co/r65zfTL/cheat1.png" alt="pic1" border="0"></a> <a href="https://imgbb.com/"><img src="https://i.ibb.co/Yh6ZfY8/cheat2.png" alt="pic2" border="0"></a> </spoiler> Well, doing what [user:Ari,2021-09-28] suggested wasn't really what I wanted to do, but it was worth checking out what would happen if the wrong solutions were sent. I asked some famous user what would happen if I sent the wrong solutions to cheaters. He told me that someone had done this before and that he was quickly debunked. I wondered whether I could cheat cheaters without getting caught. But for this, I had to do so...
get to them even after reporting that they were being trolled? It feels like they just don'tread, though, read it for yourself.

Full text and comments »

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

186.
By pwned, 2 years ago, In English
Codeforces Round 987 (Div. 2) Hello Codeforces! We ([user:pwned,2024-11-08], [user:ACGN,2024-11-08], [user:HappyPacMan,2024-11-08], [user:maomao90,2024-11-08], [user:AverageDiv1Enjoyer,2024-11-08], and [user:trunkty,2024-11-08]) are thrilled to invite you to [contest:2031] on [contest_time:2031] **(note the unusual time)**! After more than two years of preparation and nearly thirty problems on our shortlist, our contest is finally here for your enjoyment! In this round, you will help Penchick as he embarks on a world trip through the Philippines, Indonesia, and even through the Australian beaches and attempt six problems in two hours! The score distribution will be as follows: $500-1000-1500-2000-2500-3000$. This round would not be possible without the support of everyone behind this round: - [user:maomao90,2024-11-08] and [user:KAN,2024-11-08] for their excellent coordination and problem setting, - [user:pwned,2024-11-08], [user:ACGN,2024-11-08], [user:AverageDiv1Enjoyer,2024-11-08], and [user:trun...
**Note: There is at least one interactive problem, so please read the [guide for interactive

Full text and comments »

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

187.
By awoo, history, 6 years ago, translation, In English
Educational Codeforces Round 91 [Rated for Div. 2] Hello Codeforces! On [contest_time:1380] [contest:1380] will start. Series of Educational Rounds continue being held as [Harbour.Space University](https://harbour.space/) initiative! You can read the details about the cooperation between [Harbour.Space University](https://harbour.space/) and Codeforces in the <a href="http://codeforces.me/blog/entry/51208">blog post</a>. This round will be **rated for the participants with rating lower than 2100**. It will be held on extended ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally. You will be given **6 or 7 problems** and **2 hours** to solve them. The problems were invented and prepared by Roman [user:Roms,2020-07-11] Glazov, Adilbek [user:adedalic,2020-07-11] Dalabaev, Vladimir [user:vovuh,2020-07-11] Petrov, Ivan [us...
://harbour.space/) initiative! You can read the details about the cooperation between [Harbour.Space University

Full text and comments »

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

188.
By adamant, history, 4 years ago, In English
How to read my blogs Hi everyone! I saw that a lot of people write meta blogs recently. As my blog count approaches 90, I feel like it may make a lot of sense to write another one that kind of focuses on the philosophy behind my blogs and explains potential readers what they should expect from my blogs and how to approach them. So, without further ado... ##### Tldr. 1. Read my blogs if and only if the general setup itself appeals to you. Don't feel obliged to do it to get better at competitive programming. 2. Don't be driven away by seemingly dense math notation if the topic looks interesting. Ask questions if something is difficult to comprehend, I will explain in a more detail and it will help others too. 3. Be ready to fill some possible gaps in the story yourself, as an exercise. 4. Be open-minded about analyzing setup in general, rather than working towards predetermined goal. 5. Be prepared to see too little explanation on how abstract nonsense from my blogs connects with concrete applic...
How to read my blogs, opportunities for further learning to a curious reader, rather than to indicate some kind of, time you can decide on whether you should read my blog or not by reading the title and skimming

Full text and comments »

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

189.
By CelioPassos, 2 years ago, In English
Snapshot of finite calculus and using it to solve a 3000 rated problem Hey all, First, I'll give a brief overview of what finite calculus is about and I'll then show you how I used it to solve [problem:1951G]. This may be not the most elegant way to solve that problem, but it requires few observations and I find it interesting enough to share it. I am also taking part in the [Month of Blog Posts challenge](https://codeforces.me/blog/entry/133806). You can find better introductions googling terms "finite calculus", "discrete calculus", etc, although I still have not found an in-depth, thorough, introduction for these ideas, only some short expositions scattered around the web. But these ideas are pervasive throughout competitive programming (think of adjacent differences, prefix sums, slopes and the like). _Disclaimer_: this blog requires some mathematics background to fully understand it. ### A short intro to finite calculus If you know calculus, you have seen derivatives, integrals and the fundamental theorem of calculus. For a function $...

Full text and comments »

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

190.
By awoo, history, 6 years ago, translation, In English
Educational Codeforces Round 100 [Rated for Div. 2] Hello Codeforces! On [contest_time:1463] [contest:1463] will start. Series of Educational Rounds continue being held as [Harbour.Space University](https://harbour.space/) initiative! You can read the details about the cooperation between [Harbour.Space University](https://harbour.space/) and Codeforces in the <a href="http://codeforces.me/blog/entry/51208">blog post</a>. This round will be **rated for the participants with rating lower than 2100**. It will be held on extended ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally. You will be given **6 or 7 problems** and **2 hours** to solve them. The problems were invented and prepared by Roman [user:Roms,2020-12-16] Glazov, Adilbek [user:adedalic,2020-12-16] Dalabaev, Vladimir [user:vovuh,2020-12-16] Petrov, Ivan [us...
://harbour.space/) initiative! You can read the details about the cooperation between [Harbour.Space University

Full text and comments »

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

191.
By awoo, history, 6 years ago, translation, In English
Educational Codeforces Round 89 [Rated for Div. 2] Hello Codeforces! On [contest_time:1366] [contest:1366] will start. Series of Educational Rounds continue being held as [Harbour.Space University](https://harbour.space/) initiative! You can read the details about the cooperation between [Harbour.Space University](https://harbour.space/) and Codeforces in the <a href="http://codeforces.me/blog/entry/51208">blog post</a>. This round will be **rated for the participants with rating lower than 2100**. It will be held on extended ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally. You will be given **6 or 7 problems** and **2 hours** to solve them. The problems were invented and prepared by Roman [user:Roms,2020-06-10] Glazov, Adilbek [user:adedalic,2020-06-10] Dalabaev, Vladimir [user:vovuh,2020-06-10] Petrov, Ivan [us...
://harbour.space/) initiative! You can read the details about the cooperation between [Harbour.Space University

Full text and comments »

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

192.
By errorgorn, 6 years ago, In English
Codeforces Global Round 13 Editorial [problem:1491A] ------------------ Setter: [user:syksykCCC,2021-02-28] Prepared by: [user:syksykCCC,2021-02-28] <spoiler summary="Hint 1"> How can we find the largest $k$ such that the $k$-th smallest element of the array is $0$? </spoiler> <spoiler summary="Hint 2"> How can we maintain $k$? </spoiler> <spoiler summary="Solution"> Let's define $cnt$ to represent the number of 1s in the array. For the modifications, if $a_i$ is already $1$ now, then we let $cnt \gets cnt - 1$. Otherwise, let $cnt \gets cnt + 1$. For the querys, just compare $cnt$ with $k$. If $cnt \ge k$, the answer will be $1$. Otherwise, the answer will be $0$. The complexity : $O(n + q)$. </spoiler> <spoiler summary="Code (C++)"> ```c++ #include <bits/stdc++.h> using namespace std; const int N = 1e6 + 5; int n, q, a[N], cnt; int main() { scanf("%d%d",&n,&q); for(int i = 1; i <= n; ++i) { scanf("%d",a+i); cnt += a[i]; } while(q--) { int opt, x; ...
void read(T &maxx,Args &... args) { read(maxx); read(args...); }

Full text and comments »

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

193.
By DmitryGrigorev, history, 8 years ago, translation, In English
Codeforces Round #546 (Div.2) Hi, Codeforces! I`m glad to invite everybody to the #546 Codeforces round, which will be held [on Monday, March 11, 2019 at 19:35](https://www.timeanddate.com/worldclock/fixedtime.html?day=11&month=3&year=2019&hour=19&min=35&sec=0&p1=166). The round will be rated for all participants from the second division (with rating **below than 2100**). As usually, we will be glad to see participants from the first division out of competition! Problems for the round have been proposed by Fedor [user:osaaateiasavtnl.,2019-03-09] Ushakov, Stepan [user:IbragiMMamilov,2019-03-09] Stepkin, Alexey [user:usertab34,2019-03-09] Roze, Denis [user:Denisson,2019-03-09] Shpakovskij and Alexander [user:Ralsei,2019-03-09] Gladkov. The round have been prepared by us, Dmitry [user:DmitryGrigorev,2019-03-09] Grigoryev, Fedor [user:osaaateiasavtnl.,2019-03-09] Ushakov, Semyon [user:cookiedoth,2019-03-09] Savkin and Dmitry [user:TheWayISteppedOutTheCar,2019-03-09] Piskalov. We'd like to give thanks to I...
Please, read all the tasks. Good luck!

Full text and comments »

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

194.
By MikeMirzayanov, 7 years ago, translation, In English
Testlib: Opts — parsing command line options Hello! It seems to me that over the past few years I have been writing something right while all normal people are celebrating the New Year. It's my tradition now! Actually, most of the core functionality of Codeforces was written on the New Year holidays of 2010: authorization, blogs, basic support for competitions. Perhaps I want to spend the next year with interest improving something in the Codeforces infrastructure (yep, how you celebrate the New Year &mdash; so you will spend it). Or maybe it's just that it's not necessary to work on New Year's and I'm doing not what you need right now, but what would be nice to do someday. This time I took a little time to add support for parsing command line parameters in <a href="https://github.com/MikeMirzayanov/testlib">testlib</a>. I really don't like to write such lines of code `int n = atoi(argv[3]);` in generators. Actually for several reasons: * it is unsafe that the 3rd command line parameter may be absent; * It is ...

Full text and comments »

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

195.
By Anadi, history, 6 years ago, In English
Good Bye 2020 Editorial [problem:1466A] - Author: [user:Okrut,2020-12-30] - Developer: [user:Anadi,2020-12-30] - First solve: [user:Mip182,2020-12-30] <spoiler summary="Tutorial"> [tutorial:1466A] </spoiler> <spoiler summary="Solution 1"> ``` #include <bits/stdc++.h> using namespace std; void solve() { int n; scanf("%d", &n); vector <int> in(n); vector <int> is(N); for(auto &p: in) scanf("%d", &p); for(int i = 0; i < n; ++i) for(int j = i + 1; j < n; ++j) is[in[j] - in[i]] = true; int ans = 0; for(auto &v: is) ans += v; printf("%d\n", ans); } int main() { int cases; scanf("%d", &cases); while(cases--) solve(); return 0; } ``` </spoiler> <spoiler summary="Solution 2"> ``` #include <bits/stdc++.h> using namespace std; void solve() { int n; scanf("%d", &n); vector <int> in(n); for(auto &p: in) scanf("%d", &p); set <int> S; for(int i = 0; i < n; ++i) for(int j = i + 1; j < n; ++j) S.insert(in[j...
void init() { scanf("%d %d", &n, &q); read(s), read(t);

Full text and comments »

Tutorial of Good Bye 2020
  • Vote: I like it
  • +316
  • Vote: I do not like it

196.
By animeshf, history, 11 years ago, In English
Mo's Algorithm on Trees [Tutorial] Introduction ------------ Mo's Algorithm has become pretty popular in the past few years and is now considered as a pretty standard technique in the world of Competitive Programming. This blog will describe a method to generalize Mo's algorithm to maintain information about paths between nodes in a tree. Prerequisites ------------- Mo's Algorithm &mdash; If you do not know this yet, read this amazing [article](http://blog.anudeep2011.com/mos-algorithm/) before continuing with this blog. Preorder Traversal or DFS Order of the Tree. Problem 1 &mdash; Handling Subtree Queries ------------------------------------------ Consider the following problem. You will be given a rooted Tree $T$ of $N$ nodes where each node is associated with a value $A[node]$. You need to handle $Q$ queries, each comprising one integer $u$. In each query you must report the number of distinct values in the subtree rooted at $u$. In other words, if you store all the values in the subtree rooted...

Full text and comments »

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

197.
By 74TrAkToR, history, 3 years ago, translation, In English
Codeforces Round #905 (Div. 1, Div. 2, Div. 3) Hello, Codeforces! We are happy to invite you to our experimental round for three divisions, which will take place at [contest_time:1887]. <b>Please note the non-standard start time for the round</b>. Each division will have 5-7 tasks. The round will be held according to the Codeforces rules and will be rated for all three divisions. A few changes regarding the ratings of participants in this competition: <ul style="list-style-type:square"> <li>In Div.3 the rating of participants is less than 1600. </li> <li>In the Div.2 ranking, participants range from 1600 to 2099. </li> <li>In Div.1 the rating of participants is no less than 2100.</li> <li><b>Please note</b> that after [contest:1884] the rating will not be recalculated until the end of this competition. </li> </ul> Let us note that two team Olympiads will be held in parallel on this day and the rounds are based on their tasks: <ul style="list-style-type:square"> <li> XXI Moscow Team Olympiad, high school stud...
**UPD**: One of the problems will be interactive, so please read [guide for interactive problems

Full text and comments »

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

198.
By awoo, history, 7 years ago, translation, In English
Educational Codeforces Round 87 Editorial [problem:1354A] Idea: [user:BledDest,2020-05-18] <spoiler summary="Tutorial"> [tutorial:1354A] </spoiler> <spoiler summary="Solution (pikmike)"> ~~~~~ t = int(input()) for _ in range(t): a, b, c, d = map(int, input().split()) if b >= a: print(b) continue if c <= d: print(-1) continue a -= b dif = c - d print(b + (a + dif - 1) // dif * c) ~~~~~ </spoiler> [problem:1354B] Idea: [user:BledDest,2020-05-18] <spoiler summary="Tutorial"> [tutorial:1354B] </spoiler> <spoiler summary="Solution (BledDest)"> ~~~~~ #include<bits/stdc++.h> using namespace std; char buf[200043]; int main() { int t; scanf("%d", &t); for(int i = 0; i < t; i++) { scanf("%s", buf); string s = buf; int ans = int(1e9); int n = s.size(); vector<pair<char, int> > c; for(auto x : s) { if(c.empty() || c.back().first != x) c.push_back(make_pair(x, 1)); else c.back().second++; } int m = c.size(); for...
int tc; scanf("%d", &tc); while(tc--) { read(); solve();, lst = tc; while(tc--) { assert(read()); solve(); } return 0; } ~~~~~, while(read()) { solve();

Full text and comments »

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

199.
By cry, 2 years ago, In English
Invitation to Codeforces Round 962 (Div. 3) <center> Hewwo Cowodeforcers! ------------------ </center> [user:sum,2024-07-04] and I are overjoyed to welcome you to participate in [contest:1996] on [contest_time:1996]. This contest is the last stop on our mission to problemset for every division. We hope you've been enjoying our stuff so far! 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**. After open hacks all accepted solutions will be rejudged on successful hacks. You will be given **7 problems** and **2 hours and 15 minutes** to solve them. Note that the **penalty** for each wrong submission in this round is **10 minutes**. [Remember](https://codeforces.me/blog/entry/59228) that only the trusted participants of the third division will be included in the official standings table. As it is written by link, this is a compulsory measure for combating unsp...

Full text and comments »

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

200.
By PrinceOfPersia, 12 years ago, In English
Algorithm Gym :: Everything About Segment Trees In the last lecture of **Algorithm Gym** ([Data Structures](/blog/entry/15729)), I introduced you Segment trees. In this lecture, I want to tell you more about its usages and we will solve some serious problems together. [cut] Segment tree types : Classic Segment Tree -------------------- Classic, is the way I call it. This type of segment tree, is the most simple and common type. In this kind of segment trees, for each node, we should keep some simple elements, like integers or boolians or etc. This kind of problems don't have update queries on intervals. Example 1 (Online): Problem [problem:380C] : For each node (for example $x$), we keep three integers : 1.`t[x]` = Answer for it's interval. 2. `o[x]` = The number of $($s after deleting the brackets who belong to the correct bracket sequence in this interval whit length `t[x]`. 3. `c[x]` = The number of $)$s after deleting the brackets who belong to the correct bracket sequence in this interval whi...

Full text and comments »

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

201.
By isaf27, history, 6 years ago, In English
Grakn Forces 2020 [Div1 and Div2 combined] Hello, Codeforces! <center> <img alt="grakn" src="https://grakn.ai/assets/svg/logo.svg" style="float:right; height: 50px; margin: 10px; max-width:10%;"/> </center> I'm glad to invite you to [contest:1408], which will be held on [contest_time:1408]. It will be **combined rated** round for **both divisions**. This round is initiated and supported by Grakn Labs. More information you could find [here](https://codeforces.me/blog/entry/82787). All problems were authored and prepared by [user:300iq,2020-09-29] and [user:isaf27,2020-09-29]. Thanks to [user:growup974,2020-09-29], [user:postscript,2020-09-29], [user:QAQAutoMaton,2020-09-29], [user:PM11,2020-09-29], [user:morzer,2020-09-29], [user:qlf9,2020-09-29], [user:RedDreamer,2020-09-29], [user:gdb_18,2020-09-29], [user:talibmohd,2020-09-29], [user:Dragnoid99,2020-09-29], [user:KAN,2020-09-29] and [user:VladGanzha,2020-09-29] for testing problems and good advice. Thanks to [user:MikeMirzayanov,2020-09-29] for great systems ...
You will be given **9 problems** and **2 hours 30 minutes** to solve them. Please,read all the

Full text and comments »

Announcement of Grakn Forces 2020
  • Vote: I like it
  • +506
  • Vote: I do not like it

202.
By adamant, history, 3 years ago, In English
Dirichlet convolution. Part 1: Fast prefix sum computations Hi everyone! Suppose that you need to compute some sum of a number-theoretic function that has something to do with divisors: $$\begin{gather} \sum\limits_{k=1}^n \varphi(k) = ? \\ \sum\limits_{k=1}^n \sum\limits_{d|k} d^2 = ?? \\ \sum\limits_{x=1}^n \sum\limits_{y=1}^x \gcd(x, y) = ?!? \end{gather}$$ As it turns out, such and many similar sums can be computed with Dirichlet convolution in $O(n^{2/3})$, and in this article we will learn how. Let $f(n)$ and $g(n)$ be two [arithmetic functions](https://en.wikipedia.org/wiki/Arithmetic_function). Let $F(n)$ and $G(n)$ be their prefix sums, that is $$\begin{matrix} F(n) = \sum\limits_{i=1}^n f(i), & G(n) = \sum\limits_{j=1}^n g(j). \end{matrix}$$ We need to compute a prefix sum of the [Dirichlet convolution](https://en.wikipedia.org/wiki/Dirichlet_convolution) $(f * g)(n)$. In this article, we will consider some general methods, and show how to do so in $O(n^{2/3})$ if we can compute prefix sums of $F(n)$ and $G(n)$ in ...

Full text and comments »

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

203.
By galen_colin, 6 years ago, In English
Hybrid Tutorial #-1: Heavy-Light Decomposition **[Here](https://www.youtube.com/watch?v=_G_LMuLWMaI&list=PLDjGkpToBsYDx4GWu2u87sTqt6ICELz-T) is a playlist of all hybrid tutorials I've done.** # "Intro" _Timestamp: [00:00](https://youtu.be/_G_LMuLWMaI)_ Hi! Definitely not inspired by [this comment](https://codeforces.me/blog/entry/81086?#comment-675431), I've decided to try something that seems relatively novel &mdash; combining a blog and video tutorial into one, in a "hybrid" fashion. Both should be usable independently, but they will have the same "flow" and structure so you can reference both for concepts that are harder to grasp, and the two will supplement each other. The goal of these is to be **complete** &mdash; beneficial for both video and blog lovers, as well as full of enough information that anyone without much of an idea of what the concept is should be able to fully understand. There will be code as well, however, I very highly recommend not looking at it, but rather working out the implementation for yours...
be necessary for array sizes) 2. Read in the value of $n$, and call `init_arrays(n)` 3.Read in

Full text and comments »

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

204.
By E869120, 7 years ago, In English
My winning theory in IOI 2018 & 2019 — Why I won 2 golds in IOI Dear Codeforces community.<br /> According to [IOI 2019 Results](http://stats.ioinformatics.org/results/2019), I got the 25th place and got successful gold medals twice in a row.<br /> Although it was pretty close to the gold-medal border (only 6.14pts / 600 difference) and it was lower performance than IOI 2018, which I participated when I was orange in Codeforces, I had many chances to get more points in this IOI, even for top 10. Since there are not so many people who have got two gold medals in IOI (and there were many requests like "I want [user:E869120,2019-08-14] to talk about how to get gold in IOI" like [this comment](https://codeforces.me/blog/entry/66909?#comment-510127) and [this comment](https://codeforces.me/blog/entry/66909?#comment-513129)). I want to write something about IOI, which may be useful for people who will participate in IOI next year and also some years later.<br /> ![ ](https://i.ibb.co/TLmqRRX/E869120-IOI-01.png)<br /> <br /> ### A. First of all At...

Full text and comments »

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

205.
By errorgorn, 5 years ago, In English
[Tutorial] Knapsack, Subset Sum and the (max,+) Convolution **Edit**: I have realized that this blog has been sent quite a lot on discord servers, so I am adding a content page at the start to help organize this blog better. ## Prerequisites Let us first define the classical knapsack, unbounded knapsack and subset sum problems. #### Subset Sum There are $N$ items. The $i$-th item has weight $w_i$. Find a set $S$ such that $\sum\limits_{i \in S} w_i = C$. #### Knapsack There are $N$ items. The $i$-th item has weight $w_i$ and value $v_i$. Find a set $S$ such that $\sum\limits_{i \in S} w_i \leq C$ and $\sum\limits_{i \in S} v_i$ is maximized. #### Unbounded Knapsack There are $N$ items. The $i$-th item has weight $w_i$ and value $v_i$. Find a **multiset** $S$ such that $\sum\limits_{i \in S} w_i \leq C$ and $\sum\limits_{i \in S} v_i$ is maximized. You should know how to do both versions of knapsack in $O(NC)$ and subset sum in $O(\frac{NC}{32})$ before reading this blog. In this blog post, I will just show some res...

Full text and comments »

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

206.
By sammyuri, 6 months ago, In English
Spectral::Cup 2026 Round 2 (Codeforces Round 1100, Div. 1 + Div. 2) Editorial Thank you for participating in our round! We hope you enjoyed the problems as much as we enjoyed preparing them. <spoiler summary="Rate the contest!"> <spoiler summary="Quality"> - Absolute Cinema contest - Excellent contest - Good contest - Average contest - Bad contest - Horrible contest </spoiler> <spoiler summary="Difficulty"> - Trivial contest - Easy contest - Average contest - Hard contest - Impossible contest </spoiler> </spoiler> [problem:2229A] Idea by: [user:Intellegent,2026-05-23] Prepared by: [user:Intellegent,2026-05-23] Editorial by: [user:reirugan,2026-05-23] <spoiler summary="Hint 1"> Let $y$ denote the final position of all of the slimes. Then it is optimal to choose $x = y$ for every operation. </spoiler> <spoiler summary="Hint 2"> Let $\mathrm{mn}$ denote the minimum value in $a$, a...
#define INT(...) int __VA_ARGS__; read(__VA_ARGS__) #define LL(...) ll __VA_ARGS__;read, void read() {} template void read(H &h, T &...t) { rd(h), read(t...); }

Full text and comments »

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

207.
By feecIe6418, 4 years ago, In English
Editorial of Codeforces Global Round 21 Thanks for participation! If your solution to D involves any data structures and is not $O(n)$ -- please read the "solution 1". I believe it is very interesting, but to make the difficulty suitable for D we allowed not $O(n)$ solutions. [problem:1696A] <spoiler summary="Hint 1"> How many operations will we perform? <spoiler summary="Answer"> At most one. Why? </spoiler> </spoiler> <spoiler summary="Solution"> Suppose we can only perform exactly one operation. In this case the answer is $S=\max_{1\le i\le n}(a_i\mathrm{\ or\ }z)$. In fact, we can prove that this is the answer. Define $a_i'$ as the value of $a_i$ after some operations. It suffices to prove the answer will never exceed $S$. Note that $z$ will always become a submask of itself after any number of operations, so $a_i$ will always be a submask of $(a_i\mathrm{\ or\ }z)$ after any number of operations. This leads to the conclusion that $a_i'\le (a_i\mathrm{\ or\ }z)$ for all $i$. Thus $\max_{1\le i...
Read the hints first to understand the solution better.

Full text and comments »

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

208.
By eatmore, history, 8 years ago, In English
New Code Jam interface: a step back in usability [This post](https://groups.google.com/d/topic/google-code/9SlOptq6gIc/discussion) in Code Jam group Hi all! This year, Google has again decided to change Code Jam user interface. The new interface has already been used for Code Jam to I/O for Women and Kick Start rounds, and from what I saw, it is even worse than the last year. Let's start. [![ ](https://i.imgur.com/sACL7ko.png)](https://i.imgur.com/sACL7ko.png) This is what I saw when I opened Code Jam main page. This year it uses even longer domain name, [codingcompetitions.withgoogle.com](https://codingcompetitions.withgoogle.com/), and some text seems to be missing. After some investigation, I found that this occurs when a browser is configured to block third-party cookies. I configure my browser this way because I don't want some companies to track me around, and for nearly all sites, this causes no issues. On some sites, blocking third-party cookies causes single sign-on to stop working, but this is understandable. Code ...
Side note: suppose that you just want to read the problems, and all you got is a tablet.

Full text and comments »

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

209.
By ZhouShang2003, 2 years ago, In English
Pinely Round 4 (Div. 1 + Div. 2) <img src="/predownloaded/25/f9/25f953f1e0d453d352b1a0bde08014923fce0577.png" align="right" style="height: 200px;" alt="header"/> Hello, Codeforces! We are pleased to invite you to [contest:1991], which will start on [contest_time:1991]. The round will be rated for **everyone**. You will be given **9 problems** and **3 hours** to solve them. There is at least one interactive problem, so please read the [guide for interactive problems](https://codeforces.me/blog/entry/45307) if you are unfamiliar with it. The problems were authored and prepared by me. We would like to thank: - [user:errorgorn,2024-7-24] for the excellent coordination. - [user:dXqwq,2024-7-24], [user:StarSilk,2024-7-24], [user:jiangbowen_,2024-7-24], [user:Endagorion,2024-7-24], [user:JCY_,2024-7-24], [user:jiangbowen,2024-7-24], [user:QwertyPi,2024-7-24], [user:chen_zexing,2024-7-24], [user:YocyCraft,2024-7-24], [user:zeliboba,2024-7-24], [user:HackerMonk,2024-7-24], [user:axs7384,2024-7-24], [user:Vlad...
problem, so please read the [guide for interactive problems](https://codeforces.me/blog/entry/45307

Full text and comments »

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

210.
By awoo, history, 6 years ago, translation, In English
Educational Codeforces Round 93 [Rated for Div. 2] Hello Codeforces! On [contest_time:1398] [contest:1398] will start. Series of Educational Rounds continue being held as [Harbour.Space University](https://harbour.space/) initiative! You can read the details about the cooperation between [Harbour.Space University](https://harbour.space/) and Codeforces in the <a href="http://codeforces.me/blog/entry/51208">blog post</a>. This round will be **rated for the participants with rating lower than 2100**. It will be held on extended ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally. You will be given **6 or 7 problems** and **2 hours** to solve them. The problems were invented and prepared by Roman [user:Roms,2020-08-13] Glazov, Adilbek [user:adedalic,2020-08-13] Dalabaev, Vladimir [user:vovuh,2020-08-13] Petrov, Ivan [us...
://harbour.space/) initiative! You can read the details about the cooperation between [Harbour.Space University

Full text and comments »

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

211.
By Geothermal, history, 7 years ago, In English
Gauging Interest in Training Program Hi all! I'm currently considering opening up a competitive programming training program of some sort. The details are definitely still in the works, though, and I wanted to discuss some preliminary ideas with the community to get feedback on what would be most helpful (and on whether there would be any interest in this). I'm interested in starting a training program for three main reasons: - To make competitive programming more accessible to those without access to resources like college courses or training camps - To provide a space in which questions are encouraged and actively answered (especially since I think this generally isn't the case in the community at large) - To help competitive programmers build problem-solving skills and intuition, which I think aren't sufficiently emphasized by most contest training resources I think one of the most frustrating things about being a new (or even intermediate) competitive programmer is that it's generally pretty difficu...
Thanks to everyone who read this far--if you have any questions or comments, please be sure to post

Full text and comments »

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

212.
By ksun48, 8 years ago, In English
Codeforces Round #492 [Thanks, uDebug!] Hello denizens of Codeforces once again! After our last [two](http://codeforces.me/blog/entry/21860) [rounds](http://codeforces.me/blog/entry/43848), Yang Liu ([user:desert97,2018-06-19]) and I ([user:ksun48,2018-06-19]) are pleased to announce Codeforces Round #492, which will happen on [June 24, 2018 at 19:35 MSK](https://www.timeanddate.com/worldclock/fixedtime.html?day=24&month=6&year=2018&hour=19&min=35&sec=0&p1=166). There will be two versions of the contest, one for users in Division 1 and one for users in Division 2. Both versions will have six problems, with four problems shared between the versions. The round will feature our friend and superstar member of ACM-ICPC team MIT TWO, Allen Liu ([user:cliu568,2019-06-19]). The scoring distribution will be visible once the contest begins. As usual, we'd like to thank our wonderful problem coordinator [user:KAN,2018-06-19] and Codeforces administrator [user:MikeMirzayanov,2018-06-19], as well as the rest of the Codeforce...
Good luck! As always, we encourage competitors to read all the problems.

Full text and comments »

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

213.
By ko_osaga, history, 4 years ago, In English
SMAWK algorithm as an alternative for D&C optimization Yesterday I participated in a local contest involving a problem about Monge arrays. I could've wrote some d&c optimization, but I got bored of typing it so I copypasted [user:maroonrk,2023-01-01]'s SMAWK implementation to solve it. Today, I somehow got curious about the actual algorithm, so here it goes. ## 1. Definition I assume that the reader is aware of the concept of D&C Optimization and Monge arrays. The goal of SMAWK is to compute the row optima (ex. row minima or maxima...) in a $n \times m$ **totally monotone** matrix. By *totally monotone*, it means the following: **Def: Monotone.** The matrix is monotone if the position of row optima is non-decreasing. **Def: Totally Monotone (TM).** The matrix is totally monotone if every $2 \times 2$ submatrix is monotone. Totally monotone matrices are monotone (proof easy but nontrivial), but not vice versa. The latter is a stronger condition. Note that Divide and Conquer Optimization works on a monotone matrix, therefore ...
## 1. Definition I assume that the reader is aware of the concept of D&C Optimization and Monge

Full text and comments »

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

214.
By zscoder, history, 10 years ago, In English
Codeforces Round #372 Hi everyone, it's me again! [Codeforces Round #372 (Div. 1 + Div. 2)](http://codeforces.me/contests/715,716) will take place on [17 September 2016 at 16:35 MSK](http://www.timeanddate.com/worldclock/fixedtime.html?day=17&month=9&year=2016&hour=16&min=35&sec=0&p1=166), After [my last round](http://codeforces.me/contest/711), this will be my second round on Codeforces. I believe you'll find the problems interesting and I hope you'll enjoy the round. This round would not be possible without [user:dans,2016-09-15] who improved one of the problems that made this round possible, and also helped in preparing and testing the round. Also, thanks to all the testers, [user:IlyaLos,2016-09-15], [user:HellKitsune,2016-09-15] and [user:phobos,2016-09-15] and thanks to [user:MikeMirzayanov,2016-09-15] for the awesome Codeforces and Polygon platforms. ZS the Coder and Chris the Baboon's trip in Udayland is over. In this round, you'll help ZS the Coder solve the problems he have randomly ...
The problems are sorted by difficulty but as always it's recommended to **read all the problems**.

Full text and comments »

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

215.
By adamant, history, 4 years ago, In English
Big integers with negative digits: The Trygub numbers Hi everyone! Today we will talk about something that might be useful in programming competitions. Yay! Also great thanks to [user:antontrygubO_o,2023-04-30] for sharing this with me and others in a Discord server. Let's implement a data structure that maintains a big number $N$ in base $b$ and supports the following: - Given (possibly negative) integers $|x|, |y| \leq n$, add $x b^y$ to $N$. - Given $k$ and assuming $N \geq 0$, print the $k$-th digit of $N$. - Check if $N$ is positive, negative or equals to $0$. Each operation should take at most $O(\log n)$ amortized time and $O(q)$ memory. While some approach you may think of immediately would imply using segment tree, or a similar structure, the solution proposed here only requires `std::map`, so it's much shorter and easier to implement (at the slight expense of increased constant factor). It may be used in the following problems: - [#2302. 「NOI2017」整数](https://loj.ac/p/2302) - [problem:1817E] - [problem:1810F] ...
P.S. Applying it to [problem:1817E] and [problem:1810F] is left to the curious reader as an

Full text and comments »

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

216.
By adamant, history, 18 months ago, In English
Finding a billion factorials in 60 ms with SIMD Hi everyone! _This blog is not about asymptotic optimization. Refer to [this comment](https://codeforces.me/blog/entry/63491?#comment-474051) for those._ There is a problem on Library Checker that goes as follows: <hr> **[Many Factorials](https://judge.yosupo.jp/problem/many_factorials)**: You're given $n_1,\dots,n_t$, where $t \leq 10^5$. For each $i$, find $n_i! \bmod M$, where $M = 998\;244\;353$. <hr> In this blog, we will learn how to solve this task in 61 ms, without precalc and **without** FFT. That's right, we will take the dumbest solution we can imagine, and will improve its constant factor until its decent enough. How much decent? Well, let's use the following baseline: <spoiler summary="Naive solution"> ```cpp vector<int> facts(vector<int> args) { const int block = 1 << 16; vector<int> args_per_block[mod / block + 1]; vector<int> res(size(args)); for(auto [i, x]: args | views::enumerate) { args_per_block[x / block].push_b...

Full text and comments »

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

217.
By Geothermal, history, 5 years ago, In English
Thoughts on Reaching Cyan? Hi, Codeforces! Recently, [user:Wind_Eagle,2022-04-03] wrote a blog with his thoughts on practicing in which he asserted the standard advice to solve more problems is not a reliable way for gray/green users to improve. I don't agree with some of his conclusions: for example, he asserts that it is difficult/impossible to practice at the gray/green level without a coach; as anecdotal evidence, I have never had a coach coordinating my competitive programming practices, and I think many other top competitive programmers have also never had access to coaching. However, I agree that the standard "just solve problems" advice is not working, and I don't know what *is* the best advice to give to gray/green users on how best to practice, so I wanted to start a discussion of what has worked for people in the past. Therefore, I have a request for everyone reading this blog: if you are cyan or above, please post a comment sharing what you did to advance to cyan (or perhaps even blue). Ever...

Full text and comments »

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

218.
By errorgorn, 5 years ago, In English
On Div2ABs 2 years ago, [user:antontrygubO_o,2022-04-27] wrote [a blog](https://codeforces.me/blog/entry/75163) about div2ABs where he expressed his opinions that d2ABs should not be about "here is a statement, please implement what is written there". Thanks to him, the quality of d2ABs (and problem quality in general) have certainly improved. However, I still believe that there still quite large differences between how coordinators/problemsetters view d2ABs and how the intended participants view them. From the survey made by [user:kpw29,2022-04-27], we can see that most people agree that most people agree that we should **primarily** consider the target audience when proposing a task. I too think if a task is boring to div 1 contestants, we should not think of that as a reason to immediately disqualify a problem from being a d2A. ![ ](https://codeforces.me/predownloaded/70/b5/70b515da85a4dc3b362cf4eb0963dbd1fb642819.png) I think when people judge the interesting-ness of d2As, they try...

Full text and comments »

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

219.
By soullless, history, 20 months ago, In English
I Wrote a Book — For Those Who Truly Want to Grow Hey everyone! I’m excited to share something important with you. Over the past two years, I’ve walked a long road in competitive programming — through thousands of problems, hundreds of contests, ups and downs, burnout, and bouncing back. And now, I’ve written a book that captures all of that experience. But this isn’t just a guide. It’s a motivational and educational book — for high school students, university students, and anyone who wants to grow stronger in olympiad programming. Inside, you’ll find: the raw truth about burnout and how to deal with it, real strategies for consistent growth, a personal story — from the very first steps to winning gold, and most importantly, ideas that will help you reach the top — and stay there. This book is for everyone: beginners and advanced alike. Download the PDF: https://drive.google.com/drive/folders/1NJ5Qx5ci7GrQeMKZhDakVHqaqg1CdNEg I’ll be truly grateful if you read it and share your thoughts. This isn’t a textbo...
I’ll be truly grateful if you read it and share your thoughts. This isn’t a textbook — it’s a

Full text and comments »

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

220.
By manish.17, 5 years ago, In English
Codeforces Round #766 (Div. 2) omg hi Codeforces! [user:ScarletS,2022-01-12], [user:flamestorm,2022-01-12], [user:fishy15,2022-01-13], [user:saarang,2022-01-12], <a class="rated-user user-orange" href="/profile/lookcook" title="Did no work and cried for name to be here">lookcook</a> and I are glad to invite you to our Codeforces round, [contest:1627], which will be held on [contest_time:1627]. **This round will be rated for participants with rating lower than 2100**. We would like to thank: - [user:Monogon,2022-01-12] senpai for excellent coordination of the contest. - [user:MikeMirzayanov,2022-01-12], for creating the amazing Codeforces and Polygon platforms! - [user:KAN,2022-01-15], for Russian translations! - [user:dorijanlendvaj,2022-01-12], [user:errorgorn,2022-01-12], [user:PurpleCrayon,2022-01-12], [user:generic_placeholder_name,2022-01-12], [user:blue,2022-01-12], [user:polarity-,2022-01-12], [user:atharv,2022-01-12], [user:epicxtroll,2022-01-12], [user:dbsic211,2022-01-12], [user:StArChAn...
.** Make sure to read [this blog](https://codeforces.me/blog/entry/45307) and familiarize yourself with

Full text and comments »

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

221.
By Ahmed_Hosssam, 5 years ago, In English
Codeforces Round #788 (Div. 2) <spoiler summary="عيد سعيد(Happy Eid), Codeforces!"> <img src="https://i.imgur.com/frdxaAH.png" /> </spoiler> I'm glad to invite you to [contest:1670], which will be held on [contest_time:1670]. This round is rated for the participants with rating lower than 2100. You will be given **6 problems** and **2 hours** to solve them. All problems were prepared by me, [user:Hemose,2022-05-04] and [user:ZerooCool,2022-05-04]. I would like to thank: - [user:Monogon,2022-05-04], for a lot of things (awesome coordination, helping in preparation, rejecting only not interesting tasks and a lot of useful discussions). - [user:I_Love_Slim,2022-05-04] for teaching us <s>BLABIZO</s> useful concepts. - Our army of testers [user:YahiaSherif,2022-05-04], [user:DeadlyPillow,2022-05-04], [user:TheScrasse,2022-05-04], [user:Bakry,2022-05-04], [user:IsaacMoris,2022-05-04], [user:TeaTime,2022-05-04], [user:magnus.hegdahl,2022-05-04], [user:generic_placeholder_name,2022-05-04], [user:...
The statements are short and we have tried to make the pretests strong. I encourage you toread all

Full text and comments »

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

222.
By pigstd, 4 years ago, In English
Pinely Round 1 (Div. 1 + Div. 2) <img align="right" alt="text" src="/predownloaded/1c/91/1c91ed031100f3338aa5f8ed58d0405adb9ff9d7.png" style="height: 500.0px;max-width: 100.0%;max-height: 100.0%;"> Hello, Codeforces! Members of team EZEC are glad to invite you to participate in **[contest:1761]**, which will start on **[contest_time:1761]**. You will be given **7** problems, **one of which has a subtask**, and **2 hours and 30 minutes** to solve them. The round will be rated for everyone. It is greatly recommended to read all the problems. There is at least one interactive problem, so please see the [guide of interactive problems](https://codeforces.me/blog/entry/45307) if you are unfamiliar with it. We would also like to thank: - Our red sun [user:orzdevinwang,2022-11-19], the youngest TOP10 coder in history, for illuminating our path. - Our great emperor [user:antontrygubO_o,2022-11-19] for cooperating and coordinating with us to make this round happen. He saved the round by contributing his problem...
recommended to read all the problems.

Full text and comments »

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

223.
By Arturgo, history, 7 years ago, In English
About a general reader / writer for STL-Structures, Hi everybody, I started to implement very general functions to use in programming competitions, such as this general reader/writer for C++ tuple, containers, and basic types~: ~~~~~ #include <iostream> #include <tuple> #include <type_traits> #include <utility> #include <vector> using namespace std; template <typename T> constexpr bool is_tuple = false; template<typename ... types> constexpr bool is_tuple<tuple<types...>> = true; template<typename A, typename B> constexpr bool is_tuple<pair<A, B>> = true; template<typename T> struct IsContainer { typedef typename remove_const<T>::type test_type; template<typename A> static constexpr bool test(A* pt, decltype(pt->begin())* = nullptr, decltype(pt->end())* = nullptr) { return is_same<decltype(pt->begin()),typename A::iterator>::value && is_same<decltype(pt->end()),typename A::iterator>::value; } template<typename A> static constexpr bool test(...) { return false; } static constexpr bool value = t...
About a general reader / writer for STL-Structures,, int nbRows = read(), nbCols = read(); auto grid = read>>(nbRows

Full text and comments »

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