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.
By KAN, 10 months ago, In English
Rounding 2025 Hi Codeforces! 2025 comes to an end. However square the year was, we held a number of rounds: 29 Div. 1 and 31 Div. 2-only contests, to be precise! Additionally, 18 Div. 3, 4 Div. 4, and 13 Educational rounds made the schedule even more congested. <img src="/predownloaded/c8/54/c854d6a423b830263449cca6ff841c8e4e02e024.png" style="width:1400px; float:center; margin: 1em 1em 1em 1em"/> December is not only the <strike>perfect</strike> [only](/blog/entry/149140?#comment-1332941) time to wrap the year, but also to celebrate and thank all the people who made this year possible. That's why I want to highlight with this post the people whose efforts shaped Codeforces contests. I'd like to say a huge thank you to every active community member who created and/or prepared problems for Codeforces rounds! Without your ideas and creativity, it would be impossible to hold so fun and interesting competitions. There are so many of you from every corner of the world, so that it's impossible...

Full text and comments »

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

2.
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 ...
fully. I know that you have openly admitted your mistake, and I admire you for that. If the fact that, your mistake, and I admire you for that. If the fact that I've used you as an example made you feel

Full text and comments »

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

3.
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...
cause of the mistake and even the source code line. If the diagnostics are not displayed, then at least, the Codeforces servers. Sometimes, it's not easy to notice such a mistake. A small overflow of, Sometimes, it's not easy to notice such a mistake. A small overflow of the array can lead to an, Thus, the diagnostics will sometimes help you to find a mistake like "out of bounds error

Full text and comments »

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

4.
By antontrygubO_o, 5 years ago, In English
Giving negative feedback to contests in comments //This is a short post motivated by the comment section of the last Div2 round (and of several rounds before) Every problemsetter tries to make his contest as good as possible, and is upset when something goes wrong. Most problemsetters don't set contests for money, the payments are not worth the time and efforts spent on coming up with problems, preparing them, and hosting the contest. The most rewarding thing in this process in not the money, it's to see contestants enjoying your problems. That's why feedback is so important. If the comment section is filled with comments praising the contest, setter will most likely want to come back with another contest, and if it's filled with hate and offenses, it's possible that setter will just give up on problemsetting and won't want to host another round. This means two things. First, if you liked the round, or some particular problem, why not to write a comment about it? I am sure that most setters would really appreciate it, a...

Full text and comments »

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

5.
By MikeMirzayanov, history, 19 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...

Full text and comments »

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

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

7.
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...
, because sometimes we may spend a long time debugging some silly mistake. We would want that the

Full text and comments »

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

8.
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...
confident enough to say that it can happen and was an acceptable mistake. I suggest you, future, were very scrupolous in testing the problems and I am pretty sure that any mistake in the preparation

Full text and comments »

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

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

10.
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?
mistake.

Full text and comments »

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

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

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

Full text and comments »

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

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

14.
By maroonrk, history, 5 months ago, In English
Regarding AtCoder’s Ban Policy and the Recent ARC222 Ban In ARC222, held last week, we banned a user who had been in first place at one point during the contest. This has led to discussion about AtCoder’s ban system, so I would like to explain several points. ## General Policy The people responsible for making ban decisions are well aware that there may be strong competitors who have not participated in many contests before. We do not ban users merely because they achieve good results. That said, we cannot say that the possibility of a mistaken ban is completely zero. Recently, every time we hold a contest, tens to hundreds of bad actors have attempted to achieve high rankings using AI. Their methods have also become increasingly sophisticated, and we spend a great deal of time and effort making these judgments. As a result, we cannot completely deny the possibility that legitimate participants may be banned by mistake. However, for users who have already participated in dozens of contests, we conduct thorough investigations a...
cannot completely deny the possibility that legitimate participants may be banned bymistake. However, legitimate participants may be banned by mistake.

Full text and comments »

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

15.
By Sanae, history, 6 months ago, In English
Apology for faults in Codeforces Round 1098 Hello, I'm Sanae. In ufc+8 zone, I watched the entire contest at midnight. Too many cheaters emerged and we were busy banning them. I noticed WA submissions on [problem:2228B], [problem:2228C2] and TLE submissions on [problem:2228D], which was intended. Soon after the end of the contest, I released the editorial. The bad news was, the complaints flooded the website and my contribution fell from +91 to -92. After reflecting on the issues, I was anixous and blamed myself. Now, I make an apology to point out the problems to avoid them next time. Sorry, everyone! 1. Too many cheaters emerged. [Comment 1](https://codeforces.me/blog/entry/153617?#comment-1365371) 2. The problems stay in the queue for a very long time bothered contestants. 3. B is easy but many contestants misssed the corner case. And C has many corner cases. [Comment 1](https://codeforces.me/blog/entry/153617?#comment-1365212), [Comment 2](https://codeforces.me/blog/entry/153617?#comment-1365256), [Comment 3...

Full text and comments »

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

16.
By Endagorion, 12 years ago, In English
Codeforces Round #300 (with prizes!) Hello, Codeforces! [On Sunday, April 26th at 19:00 MSK](http://www.timeanddate.com/worldclock/fixedtime.html?day=26&month=4&year=2015&hour=19&min=0&sec=0&p1=166) the 300'th regular Codeforces Round will take place. I would like to congratulate all Codeforces members and administration on this remarkable milestone. The platform has grown hugely in size and quality since its foundation, has hosted lots of exciting competitions, and has been providing the opportunity to everyone to hone their problem solving and algorithmic mastery. For this we thank the Codeforces platform creator [user:MikeMirzayanov,2015-04-24] and all the Codeforces crew. Keep up the incredible job, guys! That being said, I'm excited to announce that the problems on the jubilee three-hundredth Codeforces Round will be set by me, Mikhail Tikhomirov ([user:Endagorion,2015-04-24]). You may remember the past rounds with my problems: [#99](http://codeforces.me/contests/138,139), [#109](http://codeforces.me/contest...

Full text and comments »

Announcement of Codeforces Round 300
  • Vote: I like it
  • +1212
  • Vote: I do not like it

17.
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...
proper proof. So if you find something illogical or wrong, that should mean that I’ve made amistake

Full text and comments »

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

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

Full text and comments »

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

19.
By Lyde, 4 years ago, In English
Sometimes it's not their fault. Hello! It's 2023 now, and everyone is happy and hoping for a good year, which many good contests to come. So I want to say about one thing that I saw in most of the contests from last year, which I was pretty much annoyed about it and decided to speak about so that this year we will hope to have a better experience doing contests here. I have been in this community for more than 3 years now, not very long, but definitely enough to say that although the number of participants did increase, the number of users increase dramatically, but the number of people that respond to the contests positively don't. It actually did decrease though. I still remember that 500+ upvotes for a contest announcement are a normal thing back then, but I rarely see them now. And a common thing right now, every single contest that is over will have some comments criticizing it, but not in a good way at all. So I will make this quick for certain types of comments like that. I don't know if you do but I ...

Full text and comments »

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

20.
By brunomont, 5 months ago, In English
Chinese Postman Problem: How I Ran a 180 km Ultramarathon Through Every Street in My City Hello, Codeforces! A couple of years ago, a friend of mine told me that two cyclists had passed through every single street in the center region of the city I live in (Belo Horizonte, southeastern Brazil), on the [third try](https://www.strava.com/activities/1030665876/overview). <spoiler summary="First try"> After ~160 km, they had not completed 1/3 of the goal. [Strava link](https://www.strava.com/activities/976021527). <img src="/predownloaded/8a/53/8a53829f7d78e88808a3ff751b64406ec2fc0efd.png" style="width: 600.0px;max-width: 100.0%;max-height: 100.0%;"> </spoiler> <spoiler summary="Second try"> They were better prepared, but one of the guys was run over by a car (no big injuries). [Strava link](https://www.strava.com/activities/999450285). <img src="/predownloaded/85/8f/858fdcdcfda93cd1d9c7c59db7dbfad9e63d6ea2.png" style="width: 600.0px;max-width: 100.0%;max-height: 100.0%;"> </spoiler> <center> <img src="/predownloaded/8d/5c/8d5cfb677a361654105e49f36f214c35...

Full text and comments »

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

21.
By SecondThread, history, 5 years ago, In English
CF Sweatshirt signed by legends at ICPC World Finals Good morning! ICPC World Finals just concluded in Moscow. I was lucky enough to be participate representing the University of Central Florida, who finished in a respectable 17th place. While there, friends, acquaintances, and CF Legends signed my Codeforces sweatshirt in their handle with their current color. The most common request of the people I asked was to show off what it ended up looking like on a blog post of Codeforces, so here that is! ![ ](https://wumbogames.github.io/cfPictures/IMG_2102.png) ![ ](https://wumbogames.github.io/cfPictures/IMG_2101.png) <spoiler summary="Famous Signings"> ![ ](https://wumbogames.github.io/cfPictures/IMG_2075.png) ![ ](https://wumbogames.github.io/cfPictures/IMG_2078.png) </spoiler> #### Signers: - [user:MikeMirzayanov,2021-10-11] the creator and maintainer of Codeforces and Polygon who deserves our eternal thanks, and [user:Una_Shem,2021-10-11] without whose work there would be no sweatshirt to sign. - [user:tourist,2021-1...
understandable mistake since they are the same color on CF.

Full text and comments »

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

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

23.
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...
**UPD2:** Sorry for the long queue and my mistake in estimating the difficulty of problem D2 and E.

Full text and comments »

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

24.
By geranazavr555, 7 years ago, translation, In English
Polygon updates (June-October 2019) Hello, Codeforces! I and [user: cannor147,2019-11-07], as students of ITMO University, joined the Codeforces team in June. From June to October, we mainly dealt with the development of the Polygon platform. In this post, we would like to present to you a list of what we have done during this time. This list does not include minor bug fixes or any improvements that are invisible to users. #### PIN codes for problems and contests Sometimes very important contests and problems are being developed in Polygon. In such cases, a leader of the jury may be worried about data leaking. For example, it can be so because of the weak password of another member of the jury. PIN code is an additional factor of confirmation the access for the problem or contest and it can be set up only by the owner. It is assumed that the PIN code will be sent in another secure way. There is a link Create Pin for the owners in the contest interface: ![Create Pin in the interface](https://i.ibb.co/bgcg8C...

Full text and comments »

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

25.
By Una_Shem, history, 6 years ago, translation, In English
About Gift Distribution Hello everyone! <img alt="Packages" src="https://codeforces.me/predownloaded/a7/ce/a7ce52909464af02e2f922990c8c7e4418b98f67.jpg" style="float:right; height: 500px; margin: 10px; max-width:50%;"/> “My name is Una and I am from the Codeforces team” &mdash; this is usually how my messages to users of the site begin. One of the reasons why I write a message is very joyful &mdash; sending out gifts to the winners of the competitions and now also to participants of crowdfunding dedicated to the 10th anniversary of Codeforces. That’s what I’d like to talk about a little bit. Everyone knows where it all starts &mdash; there is a round with gifts, in the comments to which after the ending the coordinators or Mike post a list of winners. Then, in a short time, all winners receive a system message asking them to update the data about the size of the T-shirt and address. In some special cases, such as crowdfunding, for example, all participants receive an email. For various reasons...
[size of the T-shirt](https://codeforces.me/settings/general).** In case someone makes amistake in, -shirt](https://codeforces.me/settings/general).** In case someone makes a mistake in the size

Full text and comments »

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

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

Full text and comments »

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

27.
By djm03178, 2 years ago, In English
Common mistakes on Dijkstra algorithm and how to hack them As many people may have noticed, I've done quite a number of TL hacks on [problem:2000G]. The hacked submissions even include many masters' and grandmasters' solutions, and most of them don't even have suspicious running time on the original tests. I predict many more solutions will fail on system testing because I've checked only some of C++20 and C++17 submissions and haven't tried running all the hack cases. So, how did they get time limit exceeded? They're actually caused by a few different mistakes, and we need different strategies to hack each of them. For convenience I'll assume that $\mathcal{O}(n)$ = the number of nodes = the number of edges, because whether the factor becomes $n$ or $m$ can vary depending on the implementation, and the number of edges is likely to be at least the number of nodes. Also for convenience (and as this problem is like that) I'll assume that the graph is bidirectional, but it works the same for directed graphs (only a bit harder to slowdown du...
. Revisiting the same node ------------------ This is the most common mistake on Dijkstra, 2. Visiting furthest nodes first ------------------ It's also a common mistake to make **the, This is the most common mistake on Dijkstra implementations. By revisiting it means that **it

Full text and comments »

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

28.
By rama_pang, history, 6 years ago, In English
[Tutorial] Li Chao Tree Extended Hello everyone! I discovered a new (?) trick on how to apply lazy propagation on the Li Chao Tree and decided to write a blog about it. I've personally never seen it before (outside of myself), nor have I seen a problem that needs the Extended Li Chao Tree specifically, but it *can* overkill some problems. Of course, I might not be looking hard enough... You can learn about the basics of Li Chao Tree from [cp-algorithms](https://cp-algorithms.com/geometry/convex_hull_trick.html) or [this simple blog](https://robert1003.github.io/2020/02/06/li-chao-segment-tree.html). The Extended Li Chao Tree can do the following problems (and other variations): ## Problem 1 There is an array $A$ of size $N$. There are $Q$ online operations: - Range Line Insertion. Given $l$, $r$, $a$, $b$, do $A_i = \max(A_i, a \cdot i + b)$, $\forall i \in [l, r]$ in $O(\log^2 N)$ - Range Line Addition. Given $l$, $r$, $a$, $b$, do $A_i += a \cdot i + b$, $\forall i \in [l, r]$ in $O(\log^2 N)$. - Po...

Full text and comments »

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

29.
By maomao90, 2 years ago, In English
Meta Hacker Cup... Why must you be so special?? _Disclaimer: This is a rant about Meta Hacker Cup and may not contain any useful information._ Meta Hacker Cup is one of the biggest annual programming competitions, but it has the strangest submission format, unlike any other online judge. Why does it have to be so different? Let’s take a look at how Meta Hacker Cup 2024 Round 1 went for [user:maomao90,2024-10-06] > The time now is 1:00 AM in Singapore. The contest starts, and maomao90 begins solving the problems. > The time now is 1:41 AM. maomao90 has solved problems A, B, and C without much trouble and starts working on problem D. After quickly coming up with a theoretical solution, maomao90 begins coding. > The time now is 2:05 AM. The code is ready and passes the sample tests. maomao90 proceeds to validate the solution. > The time now is 2:06 AM. Validation passes, and the input zip file is downloaded. > The time now is 2:07 AM. maomao90 runs the code on the final test. ![Image showing assertion failed](https...
Is the validation test intentionally weak, or is it a mistake by the problem setter?

Full text and comments »

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

30.
By isaf27, history, 7 years ago, In English
About the Codeforces Round #637 Hello Codeforces. I'm writing this post to make comments about a situation on the last Codeforces Round and tell the bad news. We did many mistakes and due to them, the round caused much dissatisfaction from the Codeforces community. Some of our mistakes: 1. Some stupid mistakes in the statements. 2. In the problem D2E/D1C the numbers $d_i$ were not necessarily sorted, but there were no pretests for that. 3. The checker of the problem D2F/D1D didn't check one of the requirements and due to that $8$ solutions failed on pretests during the system testing. 4. After the editorial was posted the mistake was found in the main solution of the problem D1E ([more details here](https://codeforces.me/blog/entry/76479?#comment-609911)). Now we don't know the correct solution. So, the round was very unsuccessful, I'm very sorry about this. I will make conclusions and will try to avoid such situations later. Please, treat with respect to the authors, even in such a bad situatio...
editorial was posted the mistake was found in the main solution of the problem D1E ([more details here, 4. After the editorial was posted the mistake was found in the main solution of the problem D1E

Full text and comments »

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

31.
By plagues, history, 4 months ago, In English
I finally became IGM — please don't spend years hating yourself for failures Hello everyone! A couple of days ago I finally reached IGM, and you cannot even imagine how happy I am. I want to tell you a bit about my journey. In 8th grade I got my first prize diploma at ROI. That was a pretty cool achievement, but I always wanted to be better. I had three whole years ahead of me to become a winner, yet I never managed to do it. My competitive programming career has been full of disappointments. The only year when I truly believed in myself was 8th grade. I was top 2 at IATI Junior by a huge margin, got my first VKOSHP diploma, became a ROI prizewinner, and overall progressed very fast. For example, that was when I reached 2100 on Codeforces for the first time. As you can see, it took me another 5 years just to finally become a grandmaster. In 9th grade, my team and I got top 5 at VKOSHP. For me it was a huge tilt, because it was the first “not gold” result after I had been dreaming about gold for so long. In 10th grade I was supposed to particip...
That was a huge mistake.

Full text and comments »

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

32.
By Qingyu, 16 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...
MOE policy on Olympiads, **confirmed in 2022**, but I cannot go to colleges due to a stupidmistake

Full text and comments »

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

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

Full text and comments »

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

34.
By ToxicPie9, 4 years ago, In English
[Tutorial/Parody Post] Common Mistakes in Competitive Programming and How to Avoid Them Yesterday [user:YouKn0wWho,2023-01-11] posted a [blog](https://codeforces.me/blog/entry/111217) explaining common mistakes in competitive programming and how to avoid them. I was greatly inspired by that post so I decided to make my own. I have compiled some of the mistakes that I didn't make 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 Rust as it is the most beloved language for CP. #### Mistake 1 Check out the following code: <spoiler summary="Code"> ``` fn main() { let x: i32 = 1_000_000_000; let y: i32 = 1_000_000_000; println!("{}", x * y); } ``` </spoiler> The output should be $10^{18}$. But if you run the code, you will get a different output. Why? <spoiler summary="Reason"> Because it won't even compile....
#### Mistake 1, #### Mistake 2, #### Mistake 3, #### Mistake 4, #### Mistake 5, #### Mistake 6, #### Mistake 7, #### Mistake 8, #### Mistake 9, I forgot Mistake 10.

Full text and comments »

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

35.
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...
small number of participants. But such a mistake can significantly affect the course of the contest.

Full text and comments »

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

36.
By Zlobober, 11 years ago, translation, In English
Codeforces update: contests and problemsetters Hi everybody! Hope you liked our [Revolution of Colors and Titles](/blog/entry/20638). Maybe you even have took part in a contest in new status. The last round have set an incredible record: 8000 participants! And I'm glad to tell you that there was no single technical issue during the round time! Consider the 15-minute delay as a part of our evil plan for setting up a new record :) I'm glad to tell that Codeforces team is able not only to tune colors and formulas, but also to work on new features for you. You may see on [contests](/contests) page that there is a list of authors for each of the rounds! Moreover, in profile of a person there is now an entry called "problemsetting" that allows you to see the list of all contests in whose preparation a person took a part. <center> <a href="http://i.imgur.com/3mul76p.png"><img src="http://i.imgur.com/3mul76p.png" /></a> <br /> [user:Endagorion,2015-10-03] looks like this. </center> [cut] Let's clarify what do we mean by tak...

Full text and comments »

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

37.
By Nyaan, history, 4 months ago, In English
How I Spent Two Hours of My Free Time Today I am one of the part-time staff members at AtCoder responsible for investigating cheating involving AI. Let me explain what happened during my free time today. ## What I did in my free time today I was browsing Codeforces blogs, as I often do for fun. I found a post asking AtCoder to unban a certain user. The banned user was also in the comments, strongly insisting that they had not cheated. The comment section was full of people criticizing AtCoder. I immediately reviewed the case again. The user had been banned yesterday for cheating that took place three months earlier. After carefully rechecking the evidence, I also concluded that they had clearly used AI. (I will not explain the details because they relate to our methods for detecting AI use. The same applies to the cases below.) The post also named another person who was said to have been falsely banned. I did not feel like spending even more time on this, but I carefully reviewed that case as well. That user had blat...
**Please do not let cheaters convince you that AtCoder often bans innocent users bymistake.** Also, - If you believe AtCoder banned you by mistake and want the ban removed, the right thing to do is, Next, I found another post in which someone claimed that AtCoder had banned them bymistake. I

Full text and comments »

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

38.
By sdnr1, history, 8 years ago, In English
[Tutorial] Searching Binary Indexed Tree in O(log(N)) using Binary Lifting **NOTE** : Knowledge of Binary Indexed Trees is a prerequisite. ## Problem Statement Assume we need to solve the following problem. We have an array, $A$ of length $N$ with only non-negative values. We want to perform the following operations on this array: 1. Update value at a given position 2. Compute prefix sum of $A$ upto $i, i \leq N$ 3. Search for a prefix sum (something like a `lower_bound` in the prefix sums array of $A$) [cut] <br> ## Basic Solution Seeing such a problem we might think of using a Binary Indexed Tree (BIT) and implementing a binary search for type $3$ operation. Its easy to see that binary search is possible here because prefix sums array is monotonic (only non-negative values in $A$). The only issue with this is that binary search in a BIT has time complexity of $O(log^2(N))$ (other operations can be done in $O(log(N))$). Even though this is naive, here is how to do it: <spoiler summary="Implementation"> `int sum(pos)` -> comput...

Full text and comments »

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

39.
By MikeMirzayanov, 8 years ago, In English
Happy 2019 Year! <img style="float:right; margin: 0 1em 1em 1em;" src="https://cdn.shortpixel.ai/client/q_lossless,ret_img/https://programmingforsuccess.in/wp-content/uploads/2017/09/2019-happy.jpg"> Congratulations to all the new 2019 year! At this very moment you can make an important wish. Done? I wish it to be fulfilled! I wish you to become better in the new year, to think better and to meet less often with bugs and mistakes. Let all your solutions be fast, effective and correct! Later, I will compile statistics for 2018 and publish in the form of an annual report Now I'd like to remind you most voted posts of 2018. Here is the list of the top 15: * <a href="/blog/entry/62865">Codeforces: Problem Difficulties</a> by me, +3158 * <a href="/blog/entry/63375">Codeforces: Our Steps After DDOS Attack</a> me, +2995 * <a href="/blog/entry/56954">Hello 2018</a> by [user:tourist,2018-12-31], +2848 * <a href="/blog/entry/59228">Codeforces: Updates in rating and rounds</a> by me, +1973 * <a...

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

42.
By maroonrk, history, 13 months ago, In English
AtCoder Grand Contest 073 Announcement We will hold AtCoder Grand Contest 073. This contest counts for GP30 scores. - Contest URL: https://atcoder.jp/contests/agc073 - Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20250928T2100&p1=248 - Duration: 180 minutes - Number of Tasks: 4 - Writer: [user:maroonrk,2025-09-27] - Tester: [user:maspy,2025-09-27], [user:HIR180,2025-09-27] - Rated range: 2000 - The point values will be 700-1000-1400-1700. We are looking forward to your participation! **UPD and announcement about the AI usage in this contest** First of all, I'm terribly sorry for what happened today; Problem C was solved by an AI. It is legal to use AI in AGC contests. However, this rule was adopted under the assumption that we would not provide problems that are solvable solely by AI. What makes the situation worse is that, as far as I know, only paid plans are able to solve this problem. This is especially serious, and I fully accept your frustration. Of course, I te...
Again, this is entirely my mistake and I sincerely apologize to all participants. I would also

Full text and comments »

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

43.
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 ...
I don't think anyone is going to make a mistake on the A + B problem we were solving before. So, you've made a mistake in implementation or if the idea is wrong altogether. To do so, it is best to

Full text and comments »

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

44.
By -Morass-, history, 9 years ago, In English
Problem Topics Good Day to you! I've been asked to make some topic-wise list of problems I've solved. Even though I couldn't involve all problems, I've tried to involve at least "few" problems at each topic I thought up (I'm sorry if I forgot about something "easy"). I've alredy made such list once anyway I've tried to include more problems now &mdash; so here it is: <spoiler summary="aho"> http://www.spoj.com/problems/ADAJOBS/ URI 2226 (5) //[NICE][NUMBERS][DP] http://www.spoj.com/problems/SUB_PROB/en/ http://codeforces.me/contest/696/problem/D 8 http://www.spoj.com/problems/AHOCUR/ 5 //Aho-Corassic + DP https://www.codechef.com/problems/LYRC (5) //Sample aho-brute-force http://codeforces.me/problemset/problem/346/B //Proposed by [user:bradyawn,2019-08-03] </spoiler> <spoiler summary="automat"> 6861 [LA] //CYK UVA 10679 //Suffix Automat http://www.spoj.com/problems/STRMATCH/ //Suffix Automat &mdash; trie might do too http://www.spoj.com/problems/NSUBST...
11451 UVA (4) //C==20 mistake in statement

Full text and comments »

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

45.
By Maksim1744, 5 years ago, In English
Counting primes in $\tilde{{\cal O}}(n^{2/3}\,\,)$ _Some time ago I read [this](https://projecteuler.net/thread=10;page=5#111677) post about calculating prime-counting function in $O(n^{3/4})$ (you have to solve problem 10 to access the post). And in the end author mentioned that there is $O(n^{2/3})$ solution. To my surprise I was not able to find any more or less relevant information on the internet about that. Maybe there is a beautiful blog describing all of this on 10-th page of google, but I decided to collect information I found in this post._ ###Prerequisites - From [distribution of prime numbers](https://en.wikipedia.org/wiki/Prime_number_theorem) $n$-th prime is approximately $n \ln n$, I will use it while proving complexities. ###$\tilde O(n^{3/4})$ Let's start with $O(n^{3/4})$ approach from Project Euler. We will need some definitions: - $\pi(n)$ &mdash; prime counting function, i.e. number of primes which are not greater than $n$. - $S(n, a)$ &mdash; suppose we take all numbers from $1$ to $n$ and sieve them w...

Full text and comments »

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

46.
By Endagorion, history, 6 years ago, In English
Codeforces Global Round 8: editorial Thank you for waiting! I hope you've enjoyed the problems. Let me know what you think in the comments! **UPD**: I almost forgot but here are some notes, as well as challenges for all problems. For a lot of them I don't have a solution and would be happy to hear your ideas. [tutorial:1368A] <spoiler summary="Challenge (awful)"> Find a closed formula for the answer. For simplicity assume $a \leq b$, </spoiler> [tutorial:1368B] <spoiler summary="Challenge (?)"> As mentioned above, the problem is not that easy in general case when there are a lot of repeated letters. Still, is it possible to do? Any solution faster than brute-force would be interesting, or even some ideas or observations. </spoiler> <spoiler summary="Notes"> I find it much harder to create a good easy problem than a good hard problem. This position in paricular gave me a lot of trouble, we had to scratch three or four other versions. Not to say the result is very inspiring, but the previous ones were...

Full text and comments »

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

47.
By KAN, history, 9 years ago, translation, In English
Situation with Round 421 problem div. 1A/div. 2C During the discussion after the Round 421 it turned out that the author's solution was wrong. Yes, we had several testers, we had a bruteforce solution that worked correctly, we had a stress testing between the bruteforce and the main solutions. However, all these measures haven't prevented the mistake: the testers haven't noted the issue, the stress haven't found any counter-tests. The solutions also produced the same answers all small tests we had in the testset, so we only found the issue when a test used for a hack was added. We are terribly sorry about the mistake. We did our best to ensure the problems are ok, I don't know any available method that we haven't used to check the problem. We've spent the last few hours trying to come up with a new, correct solution to the problem, but right now I don't see any solution that seems undoubtedly correct to me. There are a few that work better than the author's, but yet unproved, you can try to prove [this one](http://codeforces.co...
We are terribly sorry about the mistake. We did our best to ensure the problems are ok, I don't

Full text and comments »

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

48.
By BledDest, 20 months ago, In English
On problem 2075B (ER176 B) and why it exists [SPOILERS] So, if you paricipated in ER 176 and got WA2 on problem B, you might think this is a terrible problem, maybe one of the worst on CF. Let me try to explain why it was created, and maybe it will change your opinion about it (or maybe it won't). This problem has an obvious solution: you have to maximize the sum of the first $k$ chosen elements and the last element you paint, so the sum of $(k+1)$ elements of the array. So, let's take $(k+1)$ greatest elements, add them up, and we get the answer. It even passes the sample test case, but it is wrong. <spoiler summary="Why it is wrong"> If $k=1$, there is only one "starting" element. So, the last element you paint must be on the border (the $1$-st or the $n$-th element of the array). If $k>1$, the greedy solution actually works since any element between two elements which were initially chosen can be the last element. So, out of $(k+1)$ maximums, you can initially paint them all blue, except for the middle of them. But if $k=1$, yo...
/preparation, but it is a mistake I made during the contest itself. The first global clarification for

Full text and comments »

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

49.
By dalex, 7 years ago, translation, In English
All you should know about comparators in C++ _Please put to main page. So we won't see blogs like [https://codeforces.me/blog/entry/70236](https://codeforces.me/blog/entry/70236) in the nearest future._ In C++, comparator should return false if its arguments are equal. In C++, comparator should return false if its arguments are equal. In C++, comparator should return false if its arguments are equal. In C++, comparator should return false if its arguments are equal. In C++, comparator should return false if its arguments are equal. In C++, comparator should return false if its arguments are equal. In C++, comparator should return false if its arguments are equal. In C++, comparator should return false if its arguments are equal. In C++, comparator should return false if its arguments are equal. In C++, comparator should return false if its arguments are equal. In C++, comparator should return false if its arguments are equal. In C++, comparator should return false if its arguments are equal. ...
Hope you remember it and will never make such a stupid mistake!

Full text and comments »

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

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

51.
By ouuan, history, 7 years ago, In English
One thing you should know about comparators — Strict Weak Ordering Is "In C++, comparator should return false if its arguments are equal." [all you should know about comparators in C++](https://codeforces.me/blog/entry/70237)? **Definitely NOT.** ### What's the requirement of the custom comparator in STL? It should be a *Strict Weak Ordering*. In other words, let the comparator be $f$, and $f(x, y)=true$ means $x< y$, then: 1. $f(x, x)$ must be false (Irreflexivity) 2. If $f(x, y)$ is true, then $f(y, x)$ must be false. (Antisymmetry) 3. If $f(x, y)=true$ and $f(y, z)=true$, then $f(x, z)$ must be true. (Transitivity) 4. If $f(x, y)=false$, $f(y, x)=false$, $f(y, z)=false$ and $f(z, y)=false$, then $f(x, z)=false$ and $f(z, x)=false$. (Transitivity of equivalence) In fact, *Antisymmetry* can be deduced by *Irreflexivity* and *Transitivity*, so we can ignore it. Here are some examples that these rules aren't satisfied: | Comparator | Irreflexivity | Transitivity | Transitivity of equivalence | Example | | :----------: | ...

Full text and comments »

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

52.
By maspy, history, 5 months ago, In English
On Improving Problem Statements Recently, I have often found myself somewhat concerned about the quality of problem statements on Codeforces. Of course, this may simply be due to some bias: perhaps I just happened to notice more such cases over the past few months. I also fully understand that writing and reviewing problem statements is a very difficult task. Even so, I feel that there is still room for improvement in several respects. In particular, I would appreciate it if more attention could be paid to the following points: * Finding and fixing typos before the contest, paying attention not only to the statement body but also to the input and sample sections. * Using the same expression as consistently as possible when referring to the same object or concept. * Avoiding undefined, problem-specific terminology as much as possible. * Checking whether technical terms are being used in a meaning different from their usual one. * Paying attention to potentially ambiguous expressions and arranging explanat...

Full text and comments »

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

53.
By Denisson, history, 9 years ago, translation, In English
Codeforces Round #444 (Div. 2) Editorial Once again we apologize for making mistakes during preparation. ###[problem:887A] Author: [user:ayoyia,2017-11-04]. If the string contains no ones then the answer is "NO" as the remainig number must be positive. Otherwise we can find the leftmost one and check if it is followed by at least six zeroes. [Solution.](https://pastebin.com/mKYmrrnm) ###[problem:887B] Author: [user:ayoyia,2017-11-04]. The answer is always less or equal to 98. We can go through numbers from 1 to 99 and find the first one which we cannot make using cubes. [Solution.](https://pastebin.com/W5MBrL5e) ###[problem:887C] Author: [user:ayoyia,2017-11-04]. The amount of variants of input data for which the answer is "YES" is not more than 12 without considering rearrangement of colours. They all could be written in an array. The alternative solution is writing a function of rotating a specific edge of the cube and checking if it is solved. [Solution.](https://pastebin.com/G8kAaSV...

Full text and comments »

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

54.
By lk_ZeroMaker, 7 years ago, In English
See what's CodeChef's response to their mistake Several days ago, when I was participating in Code Chef March Challenge 2020, I found this announcement [here](https://www.codechef.com/MARCH20): ![announcement](/predownloaded/49/8a/498ae23d79aa3d22e9d05a18cee962200da39452.png) CodeChef [gives cash prizes to the top 2 global contestants](https://discuss.codechef.com/t/how-do-i-win-a-codechef-goodie/7344/2), so, does "double the number of prizes" apply to cash prizes as well? With this doubt, I sent an email to CodeChef, and received this: ![reply1](/predownloaded/88/66/88664f35dab8107d9f901f07ffbd468e00330e88.png) When I got this reply, I was at rank 3. Since he said "The number of cash prizes will be double", which sounded like top 1~4 will get cash prizes, I thought I didn't need to optimize my solution in order to win the cash prize. After the final ranking was out, I was still rank 3, so I sent another email to confirm that I would get the cash prize, but this time the reply was different: ![reply2](/predownlo...
See what's CodeChef's response to their mistake

Full text and comments »

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

55.
By Dominater069, 2 years ago, In English
How to Solve Questions [Dominater Version] Recently, I got a request asking me to write down my thought process while solving questions. So, here is the promised blog. I would like to thank [user:Iceknight1093,2024-08-30], [user:qwexd,2024-08-30], [user:Sana,2024-08-30], [user:Everule,2024-08-30] and [user:NovusStellachan,2024-08-30] for proof reading and suggesting edits in the blog. Special thanks to [user:satyam343,2024-08-30] for discussing most of the blog with me. <h3> 1. Overview </h3> The blog contains my solutions to $7$ problems in a wide range of ratings, starting from $1200$ all the way upto $2700$. Each problem has a step-by-step solution and you can notice how there are no large jumps in logic, but everything comes naturally. I do not claim that this is always possible in each problem, however I solve majority of CF problems in such a manner. There are certainly other high rated people who will have completely different methods of solving. However, this is about what works for me. There are some meta ...
I made a mistake in contest because I forgot that elements not part of the final sequence may have

Full text and comments »

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

56.
By TheScrasse, history, 3 years ago, In English
Sorry Sorry for weak tests in [problem:1917C]. Initially, the statement had the array $b$ in input, and we had to do these three things simultaneously: - make $O(n^2)$ pass; - make $O(nd)$ fail; - make $d$ small enough (i.e., $\leq 10^6$), so that the input could be read fast in any language. But $O(nd)$ was too fast, so (on Dec 22) we decided to use $d \leq 10^9$ and compress the array. But testers had already tested the old version of the problem, and I can't expect testers to reset their memory and retry the problem, so no one found the wrong $O(nk)$ solution. I'm sorry for making at least two mistakes: - Modifications 2 days before the contest may be ok, but they must be checked very carefully because fewer testers will see them. - I should have checked the existence of a pretest with all small cases. Maybe in this problem such test is not so comfortable to make, but you can achieve a similar effect by using a pretest with many random cases where every value in the inpu...

Full text and comments »

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

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

58.
By Endagorion, 12 years ago, In English
Codeforces Round #295 Editorial (now with bonuses!) We would like to thank the testers of this round's and Winter Computer Camp olympiad's problems: [user:alger95,2015-03-02], [user:thefacetakt,2015-03-02], [user:adamant,2015-03-02], [user:dragonic,2015-03-02], [user:Who179,2015-03-02], [user:ASverdlov,2015-03-02]. Make sure to comment if you find any mistakes. **UPD**: I've just remembered to put up the usual challenges for the problems. So, here they go. [problem:520A] Idea: [user:Endagorion,2015-03-02] Preparation: [user:Endagorion,2015-03-02] To check that every letter is present in the string we can just make a boolean array of size 26 and for every letter set the corresponding variable to TRUE. In the end check that there are 26 TRUEs. That is an $O(n)$ solution. Also don't forget to change all letters to lowercase (or all to uppercase). To make all the letters lowercase, one could use standard functions, like `tolower` in Python. Also, it is known that the letters from `a` to `z` have consecutive ASCII numbe...

Full text and comments »

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

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

Full text and comments »

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

60.
By ace5, 17 months ago, In English
Very hard bug in a very simple code Take a look at this code: <spoiler summary="Code"> ~~~~~ #include <bits/stdc++.h> using namespace std; vector<int> k; int f() { k.push_back(3); return 3; } int main() { k.push_back(1); k[0] = f(); cout << k[0]; } ~~~~~ </spoiler> At first glance, it should output $3$ because that's what $f()$ returns, which is then assigned to $k_0$. But when executed, this code outputs $1$! This code is very short and everything seems clear, we're simply assinging $k_0$ to the return value of $f()$ which is $3$, and the push_back in $f()$ clearly doesn't affect the result... or does it? <h3>How an assingment operation really works</h3> It may seem obvious at first, we just copying one value to another, but let's see how compiler actually handles this operation. Consider this code. ([Source](https://en.cppreference.com/w/cpp/language/eval_order.html)) <spoiler summary="Code"> ~~~~~ #include <cstdio> int a() { return std::puts("a...
Have you faced a similar mistake?, I faced this mistake while debugging a Cartesian tree problem, and spent 2-3 hours figuring it out

Full text and comments »

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

61.
By MikeMirzayanov, 7 years ago, translation, In English
Codeforces: Uphacking <img src="/predownloaded/23/8e/238e0f685f8b7b53a6aeee7099936d271eebb13f.png" style="float:right;margin:0 1em 1em 1em;"/> Hi Codeforces. Recently there have been several improvements on the website. A little later, I will write a short note about them. Here I want to tell about a noticeable new functionality that has recently been implemented by [user:kuviman,2019-07-05]. Sometimes after the end of a round there are requests in comments to add a particular test. And problem writers or coordinators add it manually. Now this process is automated. Meet the uphacking phase! Now, after the end of almost any contest, participants from Div.1 have the opportunity to hack any solution in this contest during the week. Yes, including official solutions from rounds. In case of successful hacking: * Your test will be automatically added to the problem and will be used in the future when testing new solutions for this problem; * If a hacked solution is a practice (i.e. upsolving), ...
intentionally contain a mistake. Please strictly follow this rule. It is because of the possibility of

Full text and comments »

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

62.
By DrSwad, history, 7 years ago, In English
A Beautiful Technique for Some XOR Related Problems ## Inspiration I'm very excited about this blog, as it took me quite a lot of effort and scavenging through the internet to completely grasp the concept of this technique(That's probably because I have almost zero knowledge in Linear Algebra or I'm just plain dumb). So I feel like I genuinely conquered a challenge, and I really want to share it with someone. But there's no way my CP friends circle will believe it, they'll think I'm just trying to show off :P So here I am, sharing it on CF. I also created a [personal blog](https://drschwad.github.io/), so that if I ever feel like sharing something again(not only about CP), I can write a blog there. I also added this same post [there](https://drschwad.github.io/2019-08-06-z2-space-xor-trick/), you can read it there if you prefer dark theme. I'll be pleased to hear any thoughts on the blog or if I can improve it in some way ^\_^ ## Introduction Since it concerns Linear Algebra, there needs to be a lot of formal stuff going on ...

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

65.
By makrav, history, 5 months ago, In English
Niche technique with centroids Hello Codeforces! I was solving [this](https://codeforces.me/gym/102331/problem/J) problem, and the model approach involves HLD solution, however I came up with some interesting approach with centroids. In short, I wrote $dp_{v, cnt, mask}$ where $v$ is vertex in tree in which centroid subtree I am choosing edges, $cnt$ is number of edges that was taken to the matching and $mask$ is mask of vertices which were already taken to some of matching edges, but we only consider those vertexes which have edges to vertices outside of $v$'s centroid subtree. So this solution works in $O(C \log n)$ where $C$ is number of different $dp$ states, which is equal to $\displaystyle\sum_{v=1}^{n} siz_v \cdot 2^{edges}$ where $siz_v$ is size of $v$'s centroid subtree, and $edges$ is number of different edges from tree going outside from $v$'s centroid subtree. Here is the proof that number of different states is $O(n \log^2 n)$. Let me know if you notice any mistakes. Thanks to [user:zwezdinv...

Full text and comments »

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

66.
By Endagorion, history, 9 years ago, In English
Yandex.Algorithm 2017, third elimination round: editorial (with challenges, bells and whistles) This time I've decided to play with spoilers to faciliate the presentation as some of the guys here did before. Tell me what you think about this write-up! #### Problem A. Shifts Topics: dynamic programming. Summary: the first "hard" problem of the contest. Knowing your basic DP problems helps a lot, but coming up with the precisely correct solution may take a lot of persistence. Solution: Suppose that we are allowed to make left circular shifts as well as right ones. <spoiler summary="Can you solve the problem in this case?"> First of all, making a shift is effectively moving a character to a different position in the string. Clearly, moving a character more than once makes no sense since we could have just moved it to its final destination instead without wasting any operations. Also, it obvious that the number of occurences of each character should be the same in both strings since it is preserved by shifts. Now, consider the characters that are *not* moved by ...

Full text and comments »

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

67.
By PersistentLife, history, 3 months ago, In English
As an CNOI Gold Medalist: How I Train CNOI Gold Medal Winning Competitive Programmers UPD: [Curated Problem Set #1](Thhttps://codeforces.me/blog/entry/156427) is released. Please join our Discord server to receive the latest updates: https://discord.gg/DsHSfmVgG UPD: Curated problem set #1 (both normal and advanced) **for subscribers** is ready! Feel free to join our Discord server and subscribe! This post is about: 1. The Main Two Abilities You Need in Competitive Programming 2. How to Choose Problems of an Appropriate Difficulty 3. How Should You Work on a Problem 4. When You Should Learn New Knowledge (Like New Algorithms) 5. How to Train Before an Important Contest 6. Free Content, Personalized Subscription Services, and Potential Opportunity for One-to-One Coaching 7. Survey About the Services I won a gold medal at NOI 2024 in my second year of high school and was admitted to the Turing Class at Peking University. After securing my admission, I continued pursuing competitive programming: I began studying new material at university in advance whi...

Full text and comments »

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

68.
By Flamire, history, 12 months ago, In English
Codeforces Round 1064 (Div. 1, Div. 2) Editorial [2166A &mdash; Same Difference](https://codeforces.me/contest/2166/problem/A) idea & solution: [user:le0n,2025-11-17] <spoiler summary="Tutorial"> It can be observed that $s_n$ will not change throughout the operations, therefore, for the final string to have every character the same, every character must be equal to $s_n$. To change every character to $s_n$, we can iterate over all characters from right to left, repeatedly setting $s_{i-1}\leftarrow s_i$ if $s_{i-1}\neq s_n$. Through this, we can need one operation for every character not equal to $s_n$, which is also obvious as a lower bound. Time complexity: $O(n)$. </spoiler> <spoiler summary="Solution"> ~~~~~ #include <bits/stdc++.h> using namespace std; char s[100005]; int main() { int n, t, i, m; scanf("%d", &t); while(t--) { scanf("%d", &n); scanf("%s", s + 1); m = 0; for(i = 1; i < n; i++) m += (s[i] != s[n]); printf("%d\n", m); } return 0; } ~~~~~ </spoiler> ...

Full text and comments »

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

69.
By vovuh, 9 years ago, In English
Codeforces Round #479 (Div. 3) Hello! [contest:977] will start on [May 6 (Sunday) at 14:05 (UTC)] (http://www.timeanddate.com/worldclock/fixedtime.html?day=6&month=5&year=2018&hour=17&min=5&sec=0&p1=166). It will be the first Div.3 round in the history of Codeforces. You will be offered 6 problems with expected difficulties to compose an interesting competition for participants with ratings up to 1600. Probably, participants from the first division will not be at all interested by this problems. And for 1600-1899 the problems will be too easy. However, all of you who wish to take part and have rating 1600 or higher, can register for the round unofficially. The round will be hosted by rules of educational rounds (extended ACM-ICPC). Thus, during the round, solutions will be judged on preliminary tests, and after the round it will be a 12-hour phase of open hacks. I tried to make strong tests &mdash; just like you will be upset if many solutions fail after the contest is over. [Remember] (/blog/entry/59228) t...

Full text and comments »

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

70.
By arvindf232, history, 2 years ago, In English
How might LGMs cheat using current AI. Or, are these not cheating? Disclaimer: My natural English ability is questionable. I have passed the blog through chatgpt to correct grammatical mistakes. I experimented with o1-mini and tried to understand its implications for competitive programming on Codeforces at level 2500 or higher. Obviously, the current AI cannot outright provide you with solutions; however, there are already ways it can help quite a lot. ### Brute Force Writing I believe most competitors regularly use brute-forces. They are kind of an admission of failure to find your mistakes on your own. Previously, brute-forces came with the cost of taking 5 minutes to write. I would not do it unless it is a very hard problem, or I have tried debugging by hand for 10 minutes and seen nothing. If AI usage is assumed, then these 5 minutes would be completely saved. Five minutes would correspond to approximately a 10 performance rating if on the final problem and increasingly more on earlier problems. ### Translations of Languages Thi...

Full text and comments »

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

71.
By purplesyringa, history, 2 years ago, In English
Please improve QoL for blogs I'm pretty sure I've spent more time writing blogs than contests on Codeforces. Over time, I've found plenty of rough edges. So this is a plea to the Codeforces team to fix them. I'm effectively going to say "please redo everything" over dozens of paragraphs, but I'll hopefully make the steps to the solution tangible and clear. If this is deemed way too ambitious, few improvements are better than none. [cut] <!-- --> ## Publication time So I write a post in the Codeforces UI, save a draft, update it a few times, think it's ready, and publish it. I open my brand new post and see: > ### Totally not a useless post > By [user:purplesyringa,2024-09-24], history, 3 days ago, In English Okay, wait, "3 days ago"? Oh, right, that's when I saved the first draft. Now people open the post, see "3 days ago", see 0 upvotes, and what do they think? That's right, they think it's garbage because no one's voted positive, so they skip the article. Maybe not everyone's like tha...

Full text and comments »

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

72.
By marat.snowbear, 12 years ago, In English
Codeforces Round #269 (Div. 2) Hello Codeforces community! I'm happy to invite you to participate in Codeforces Round #269 for Division 2 which will be held [this Friday, September 26th](http://www.timeanddate.com/worldclock/fixedtime.html?day=26&month=9&year=2014&hour=19&min=30&sec=0&p1=166). As usual first division coders are invited to participate unofficially, I would appreciate a lot if they will join. All problems are mine, so if you won't like them... well, you know whom to blame for those. I did my best in order not to disappoint you. Since this is my first round, let me introduce myself. I'm 27, have around 7 years of programming experience and was never into ACM/ICPC and stuff like that before, learned words like "dynamic programming" couple of years ago from the algorithms course on Coursera and a bit later found this site. I'm from Saint Petersburg, Russia, was born and lived here until I became 24. Then I got married and me and my wife decided to go live somewhere else and we moved to Kyiv, Uk...

Full text and comments »

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

73.
By carcinisation, history, 8 months ago, In English
Appeal for AhmetKaan Hello. After todays round, during system testing, our friend's account [user:AhmetKaan,2026-03-09] has been disabled. AhmetKaan has been an honest participant on Codeforces for more than 7 years, never resorting to cheating even with the ups and downs of his long journey. I can personally attest to the fact that he is an honest competitor, and would never do such a thing. We believe there has been a mistake and we ask for help to recover the account. [user:MikeMirzayanov,2026-03-09] [user:vladosiya,2026-03-09] **Edit:** Even though I have not much control over it, I am sorry for the complete mess this blog has turned into. Having to track all the updates and new arguments has become mentally extremely tiring for me and, I think, many of the people here. As I wasn’t actively commenting for the past few days, I have a lot of stuff to address. When the account was first disabled, I checked his submission for problem F [submission:365901157] (which was the hardest problem he s...

Full text and comments »

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

74.
By BledDest, 11 months ago, In English
About ER185, problem D Judging by the comments in the ER announcement, people seriously disliked problem D (to say the least). I want to explain why it exists. But first, I have to admit that I made two serious mistakes when setting the problem. My first mistake is actually putting it into a 2-hour solo round; in its current state, it is much more suitable for a longer contest with a team of three people, where you can actually get some help in debugging the code or verifying your solution logic. The second mistake will be explained a bit later, but I want to say that I understand why people think this is a terrible problem. I am sorry if this problem made the contest much worse for you. However, I am also asking that you consider my point of view. You don't have to agree with it, but I don't want anyone to view me as some insane author who's setting a problem just to watch everyone get furious while implementing it. This is definitely an implementation-heavy problem. But I think that implementation...
mistake is actually putting it into a 2-hour solo round; in its current state, it is much more suitable

Full text and comments »

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

75.
By rembocoder, 4 years ago, translation, In English
Simple DP optimizations No, I don't mean Convex Hull Trick and Knuth optimization. I mean simpler and more common methods. _This is a continuation of my series of posts on DP, to understand the terminology read the [prologue](https://codeforces.me/blog/entry/102542)._ ### Transitions from a segment Very often after building the DP graph one can discover that the transitions into a state go not from a random set of vertices, but from some segment of values for one of the parameters. _For example, from states `dp[i][j]` with some constant `i` and `j` lying in a segment `[a, b]`._ **In such cases one may not implement each transition separately, but to implement them all at once.** If by implementing a transition we mean adding from `dp[A]` to `dp[B]`, then we can use prefix sums. In case if we need to find the _best_ transition into `dp[B]`, then we can use Segment Tree. #### An Example [AtCoder DP Contest: Problem M](https://atcoder.jp/contests/dp/tasks/dp_m) _Find the number of integer seq...

Full text and comments »

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

76.
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 ...
a chance to solve them without editorial. This was my mistake for a long time; I kept picking easy

Full text and comments »

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

77.
By dacin21, history, 8 years ago, In English
On the mathematics behind rolling hashes and anti-hash tests This blog assumes the reader is familiar with the basic concept of rolling hashes. There are some math-heavy parts, but one can get most of the ideas without understanding every detail. The main focus of this blog is on how to choose the rolling-hash parameters to avoid getting hacked and on how to hack codes with poorly chosen parameters. # Designing hard-to-hack rolling hashes ## Recap on rolling hashes and collisions Recall that a rolling hash has two parameters $(p, a)$ where $p$ is the modulo and $0 \leq a < p$ the base. (We'll see that $p$ should be a big prime and $a$ larger than the size $\left|\Sigma\right|$ of the alphabet.) The hash value of a string $S = s_0 \dots s_{n-1}$ is given by $$ h(S) := \left(\sum\limits_{i=0}^{n-1} a^{n-1-i} s_i\right) \mod p $$ For now, lets consider the simple problem of: given two strings $S, T$ of equal length, decide whether they're equal by comparing their hash values $h(S), h(T)$. Our algorithm declares $S$ and $T$ t...

Full text and comments »

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

78.
By Pyqe, 23 months ago, In English
Online mirror of The 2024 ICPC Asia Jakarta Regional Contest Selamat pagi Codeforces! We're going to hold The 2024 ICPC Asia Jakarta Regional Contest. We invite you to join the online mirror contest [2024-2025 ICPC, Asia Jakarta Regional Contest (Online Mirror, Unrated, ICPC Rules, Teams Preferred)](https://codeforces.me/contests/2045) on Codeforces. It'll be held on [contest_time:2045] and will last for 5 hours. The mirror will be held using ICPC-style scoring with 10 to 13 problems. The problem statements will only be available in English. We encourage participating as a team using only one computer for coding (as in ICPC contests). The mirror will be unrated. Some useful links: * [The 2024 ICPC Asia Jakarta homepage](https://competition.binus.ac.id/icpc2024) * [The regional information in ICPC Global](https://icpc.global/regionals/finder/Jakarta) * [The onsite scoreboard](https://competition.binus.ac.id/contest) We hope that you'll enjoy the contest. Good luck and have fun! **UPD.** The mirror has ended! You can find...
**UPD2. Mistake in Problem D. Aquatic Dragon**

Full text and comments »

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

79.
By Endagorion, history, 11 years ago, In English
Codeforces Round #339 Editorial I'm terribly sorry for the delay. Please report any mistakes. [problem:614A] Author: [user:Tigutor,2016-01-16] Developers: [user:Tigutor,2016-01-16], [user:ch_egor,2016-01-16] You had to print all numbers of form $k^x$ for non-negative integers $x$ that lie with the range $[l; r]$. A simple cycle works: start with $1 = k^0$, go over all powers that do not exceed $r$ and print those which are at least $l$. One should be careful with 64-bit integer overflows: consider the test $l = 1$, $r = 10^{18}$, $k = 10^9$, the powers will be 1, $10^9$, $10^{18}$, and the next power is $10^{27}$, which does not fit in a standard integer type. [problem:614B] Author, developer: [user:ch_egor,2016-01-16] You were asked to print the product of $n$ large numbers, but it was guaranteed that at least $n-1$ are beautiful. It's not hard to see that beautiful numbers are 0 and all powers of 10 (that is, 1 followed by arbitrary number of zeros). If there is at least one zero among the g...

Full text and comments »

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

80.
By ninja_28, history, 6 years ago, In English
CodeCraft-21 and Codeforces Round #711 (Div. 2) Editorial [problem:1498A] ================== #### [**Video Editorial**](https://www.youtube.com/watch?v=lV5cb8wh3sE) **Author and Problemsetting:** [user:ninja_28,2021-03-29] **Editorialist:** [user:sigma_g,2021-03-29] <spoiler summary="Hint"> Can you think of the simplest properties that relate a number and its sum of digits? </spoiler> <spoiler summary="Hint 2"> Note that if $X$ is a multiple of 3, then **both** $X$ as well as the sum of digits of $X$ are a multiple of 3! Can you put this property to use here? </spoiler> <spoiler summary="Hint 3"> If $X$ is a multiple of 3, then $\texttt{gcd-sum}(X) \ge 3$. Therefore, we are guaranteed that at least every third number will satisfy the constraints required by our problem $(\texttt{gcd-sum}(X) > 1)$. </spoiler> <spoiler summary="Solution"> Therefore, for the input $n$, we can simply check which one of $n$, $n+1$, and $n+2$ has its gcd-sum $> 1$, and print the lowest of them. </spoiler> <spoi...

Full text and comments »

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

81.
By upobir, 6 years ago, In English
Quadrangle Inequality Properties I learned some stuff about quadrangle inequality recently. I wanted to collect those in one place, so here goes. **Note:** I use $A \prec B$ to denote that $A$ is strictly more optimal than $B$. $\preceq$ is self-explanatory. The actual order depends on problems, in some cases it's $<$, in some cases, it's $>$. All of the arrays are 1-indexed and have length $n$ (if unspecified). Also for ease of following the proofs, I have tried to maintain that $a \leq b \leq c \leq d$ wherever they are used. By the notation $[l,r]$ I mean the subarray taken by using indices $i$ such that $l \leq i \leq r$. **Quadrangle Inequality:** Consider a real valued function $C(l, r)$ which is defined for $1 \leq l \leq r \leq n$. Let us call this function the *cost function*. The cost function is said to satisfy the quadrangle inequality iff $C(a, c)+C(b, d) \preceq C(a, d) + C(b, c)$ for $a \leq b \leq c \leq d$. Intuitively this implies that for $C()$, *"wider is worse"*. Let us call the cost functio...

Full text and comments »

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

82.
By .o., 12 years ago, In English
Good Bye 2014 Editorial First of all, sorry for the late editorial. I was too exhausted and immediately went to bed after the round finished, and didn't write the editorial. There are many pictures in this editorial, to cover up my poor English skills! If you have detected any errors or have questions, feel free to ask questions by comments. Unfortunately, the authors only know English, so we can't answer you if you write comments in Russian. ## [problem:500A] Let's assume that I am in the cell $i$ ($1 \le i \le n$). If $i \le n-1$, I have two choices: to stay at cell $i$, or to go to cell $(i + a_{i})$. If $i = t$, we are at the target cell, so I should print "YES" and terminate. If $i > t$, I cannot go to cell $t$ because I can't use the portal backwards, so one should print "NO" and terminate. Otherwise, I must go to cell $(i + a_{i})$. Using this method, I visit each cell at most once, and there are $n$ cells, so the problem can be solved in linear time. #### What is test 13? There are 9...

Full text and comments »

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

83.
By matrix, 12 years ago, In English
Codeforces Round #282 Hi, Codeforces Round #282 will be held at [13th of December, 19:30 MSK](http://timeanddate.com/worldclock/fixedtime.html?day=13&month=12&year=2014&hour=19&min=30&sec=0&p1=166). Please don't note anything since the time is the usual time of contests. The round is prepared by [user:FarbodY,2014-12-12], [user:Haghani,2014-12-12] and Me([user:matrix,2014-12-12]). We'd like to thank [user:Zlobober,2014-12-12] who helped us a LOT for preparing the problems, [user:MikeMirzayanov,2014-12-12] for the Polygon and Codeforces platforms and [user:delinur,2014-12-13] for helping us in preparing statements and translating them. Our special thanks goes to [user:mruxim,2014-12-12] for testing the round. The problems will be sorted according to the estimated order of difficulty according to our opinion but we strongly recommend you to read all of the problems. As always the update regarding score distribution will be posted **just** before the round starts. :) **UPD**: It was writ...
**UPD**: It was written that contest starts at 20:00 MSK. it was a mistake and is fixed now. The

Full text and comments »

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

84.
By rng_58, 14 years ago, In English
Codeforces Round #162 Tutorial #### [Div2 A Colorful Stones (Simplified Edition)](http://codeforces.me/problemset/problem/265/A) (Author: [user:rng_58,2013-01-21]) In this problem you just need to implement what is written in the statement. Make a variable that holds the position of Liss, and simulate the instructions one by one. #### [Div2 B Roadside Trees (Simplified Edition)](http://codeforces.me/problemset/problem/265/B) (Author: [user:snuke,2013-01-21]) The optimal path of Liss is as follows: First she starts from the root of tree 1. Walk up the tree to the top and eat a nut. Walk down to the height $min(h_1, h_2)$. Jump to the tree 2. Walk up the tree to the top and eat a nut. Walk down to the height $min(h_2, h_3)$, $\cdots$ and so on. #### [Div1 A / Div2 C Escape from Stones](http://codeforces.me/problemset/problem/264/A) (Author: [user:DEGwer,2013-01-21]) In this problem, there are many simple algorithms which works in $O(n)$. One of them (which I intended) is following: You should...

Full text and comments »

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

85.
By NemanjaSo2005, 22 months ago, In English
I Reached GM! Hello, codeforces community, After the last round of 2024, [contest: 2053], I finally reached Grandmaster (GM)—an achievement I had dreamed of ever since I became a Master 2 years ago, but doubted I could achieve. In Spring 2024 I set myself a goal to reach GM before the end of 2024, which felt ambitious and even unrealistic at times. But here I am, thrilled to share that I have accomplished my goal! Some of you have noticed that upon reaching 2400 rating I used magic to change my rank to CM. Why? For two reasons: first, I quite like the CM color. Perhaps it is because CM seemed like such a cool rank when I started. Second, I wanted to give myself more time to write this blog, so I hope you will enjoy it! While some of you might know me, I assume most are seeing my name for the first time. Allow me to introduce myself briefly. I am a 19-year-old Serbian competitive programmer who has been doing CP for around 8 years now. My journey is filled with many highs and lows &mdash; ma...
did was make a list of mistakes, and whenever I made some significant mistake, I added it to the list

Full text and comments »

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

86.
By arvindf232, history, 3 years ago, In English
Please restore Kotlin 1.6 Update: The current settings of 1.9 should run at least as fast as the previous Kotlin 1.6. Dear codeforces and [user:MikeMirzayanov,2024-01-16], Please restore Kotlin 1.6. This issue could be serious enough to end my CP career. The short story is that Kotlin 1.6 is the only 32-bit version. Without Kotlin 1.6 we must submit in 64bits, and in many situations this will be too slow. As the only 32 bits version available of the language, it should not have been removed to begin with. After using the exact language version on Round 920 (Div.3) having decent success, I found that I was unable to submit in Kotlin 1.6: It seems that Kotlin version 1.6 had been removed. ![Current language selection ](/predownloaded/74/a3/74a3010edfb102209786fd03d3ef9ca3a78e0421.png) If this is a mistake, please restore it. If this is simply the result of having three languages versions being too much: You could probably remove 1.7.20, as 1.9.21 seems to be superior in every way. ...
If this is a mistake, please restore it. If this is simply the result of having three languages

Full text and comments »

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

87.
By EvenImage, 12 years ago, In English
Codeforces Round #268 Editorial I'll upload my example solutions and will post links to them as soon as it becomes possible. All the problems in Div 1 don't have the unique solution. I list several solutions to each problems. There are also some interesting bonus problems. I can't solve some of them yet :( If you have interesting ideas, feel free to share and discuss your ideas in the comments. :) My English is poor, so if there are some mistakes or something you can't understand, you can also discuss it in the comments. [problem:469A] [I Wanna Be the Guy](http://kayin.moe/iwbtg/downloads.php) is an interesting game. I strongly recommend it to you. The problem itself is easy. Just check if all the levels could be passed by Little X or Little Y. [submission:7894174] [problem:469B] This problem is not hard. Just iterator over all possible $t$, and check if the schedule of Little X and Little Z will overlap. [submission:7894252] **Bonus:** 1. $p,q\leq 50, l,r\leq 10^9$ 2. $p,q,l,r\leq 1...

Full text and comments »

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

88.
By Gellyfish, 17 months ago, In English
Codeforces Round 1028 (Div.1, Div.2) Editorial You could tell people didn't seem to like the match very much. I'm sorry I screwed up again ¯\\_(ツ)_/¯ If you're interested, I'd like to share some thoughts I have about this contest. <spoiler summary="sad story"> This time I've been trying my best to make the problems use more varied algorithms instead of just dp problems, but sadly [problem:2115C] was much harder than expected. But it seems like people are complaining more about the narrow time limit, centered on [problem:2116C] and [problem:2115C]. No one realized this before the contest, because none of the tester's code is get TLE except the wrong time complexity. I actually don't see a problem with the Time Limit of [problem:2116C]. Some of you may be puzzled, but let me try to explain this: - The intended solution is $O(\sum n \max(a) + \max(a)^2)$ and does not contain $\log \max(a)$. Computing $\gcd(x, y)$ is not $O(1)$, if you don't preprocess, then it's not unusual to actually get a TLE. - I believe the v...
For [problem:2115C], I'll admit it was a huge mistake:

Full text and comments »

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

89.
By Um_nik, history, 4 years ago, In English
An unexpected D&C with FFT I came up with this idea when solving [an AtCoder problem](https://atcoder.jp/contests/arc140/tasks/arc140_f), but the editorial had a simpler solution. I liked the idea, so I decided to set [a CodeChef problem](https://www.codechef.com/COOK142A/problems/BOXES) using this idea. Since most of you guys don't participate in CodeChef contests, which is a big mistake, I'll write a short blog explaining the idea. Consider this a spoiler warning for these two problems and a CodeChef promotion. ### Combinatorial problem For given $a$ and $n \le 10^5$ calculate $A_k = \sum_{i=0}^{k} \binom{k}{i} \binom{n-k}{k-i} a^{i}$ for each $k$ from $0$ to $n$. (Use the two links above to see why anybody would like to do that) ### Reformulation with polynomials It is easy to see that $A_k$ is $((1+ax)^{k}(1+x)^{n-k})[x^k]$ (coefficient of $x^k$ in polynomial $(1+ax)^{k}(1+x)^{n-k}$). But since the polynomials are different for different $k$ this doesn't seem very helpful... ### Solution ...
guys don't participate in CodeChef contests, which is a big mistake, I'll write a short blog

Full text and comments »

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

90.
By Endagorion, 12 years ago, In English
Codeforces Round #300 Editorial (+challenges) As usual, a challenge comes with every problem. I tried not to repeat the mistakes of my previous editorials and made sure that all challenges have a solution =) (except for the _italics_ parts that are open questions, at least for me). Go ahead and discuss them in the comments! General questions about problems and clarification requests are welcomed too. **UPD**: I added codes of my solutions for all the problems. I didn't try to make them readable, but I believe most part of them should be clear. Feel free to ask questions. [problem:538A] Let me first clarify the statement (I really wish I didn't have to do that but it seems many participants had trouble with the correct understanding). You had to erase exactly one substring from the given string so that the rest part would form the word `CODEFORCES`. The (somewhat vague) wording `some substring` in the English translation may be the case many people thought that many substrings can be erased; still, it is beyond my understa...

Full text and comments »

Tutorial of Codeforces Round 300
  • Vote: I like it
  • +312
  • Vote: I do not like it

91.
By Zlobober, history, 11 years ago, In English
Checkers with testlib.h Introduction ------------ Checker is a program that should be written when task allows more than one correct solution. Although it seems that it is very easy to write checker, there are lots of important technical details that are easy to forget if you don't use a special library like testlib.h. A common convention is that a checker should be a program taking three command-line arguments: the testdata filename, the participant output filename and the jury answer filename. Checker should read the contents of the input, output and answer, decide whether participant answer is correct (and optimal being compared to the jury's answer if there can be unoptimal answer in this task) and return one of several pre-defined verdicts: | Verdict | testlib macro | meaning | |---------|---------------|---------| | Ok | `_ok` | The output is correct, follows the output format and represents an optimal answer (if applicable in this problem). | | Wrong Answer | `_wa` | The output is wrong or...

Full text and comments »

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