Можно ввести несколько слов — все они попадут в требования к поиску. Кроме того, осуществляется поиск по словоформам и, если повезет, по синонимам. Поддерживается поиск по названию, автору и специальный синтаксис запросов. Примеры:

  • 305 — ищет все посты, содержащие 305, найдет посты про Раунд 305
  • andrew stankevich contests — можно писать сразу много слов, будут искаться все
  • user:mikemirzayanov title:сазанка — ищет все посты в названии со словом "сазанка" авторства MikeMirzayanov
  • "vk cup" — можно использовать кавычку, чтобы искать точные совпадения
  • title:educational — искать в названии

Результаты

1.

Bug

Последнее посещение:  3 года назад
Зарегистрирован:  12 лет назад
2.
Автор Monogon, история, 7 лет назад, По-английски
Codeforces Round #639 Hello, Codeforces! I'm very glad to invite you to [contest:1344] and [contest:1345]. This contest will take place on [contest_time:1344]. In both divisions, you will have **2 hours 15 minutes** to solve **6 problems**. The score distribution will be announced closer to the start of the contest. Of course, this round would not be possible without the help of many people, who I'd like to thank: - [user:isaf27,2020-05-01], for coordinating this round, and helping with solution ideas. - My ICPC teammates [user:Kuroni,2020-05-01] and [user:strongoier,2020-05-01], and coach [user:cn355,2020-05-01], for encouraging me to pursue competitive programming. In particular, I'd like to thank [user:Kuroni,2020-05-01] for being so spectacularly bad that a barely-orange user like myself actually has a place on our team. - [user:300iq,2020-05-01], [user:antontrygubO_o,2020-05-01], [user:Ari,2020-05-01], [user:ffao,2020-05-01], [user:fpc_coder,2020-05-01], [user:gamegame,2020-05-01], [user:Kur...
also a bug that gave us trouble in answering your questions. I'm sorry if you asked a question that, the long queue and other issues, the contest is unrated. There was also a bug that gave us trouble

Полный текст и комментарии »

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

3.
Автор maspy, история, 4 месяца назад, По-английски
0 Problems Remaining [日本語記事(For Japanese Speakers)](https://maspypy.com/codeforces-all-ac) ---- Previous post: https://codeforces.me/blog/entry/150057 Submission: [submission:384239819] 2026/07/26 03:13:42 JST (2026/07/25 18:13:42 UTC) I have solved every problem in the Codeforces PROBLEMSET except for those for which I determined that obtaining an accepted verdict is impossible. ![unsolved problem list](https://maspypy.com/wp-content/uploads/2026/07/problemset.png) # Scope I considered the problems listed in the [PROBLEMSET](https://codeforces.me/problemset). I have solved very few problems from the [GYM](https://codeforces.me/gyms). The only collection I worked through systematically was the PROBLEMSET. I determined that it is theoretically impossible to obtain an accepted verdict for the following 31 problems: [problem:775A], ([92101](https://codeforces.me/problemset/problem/921/01) ... [92114](https://codeforces.me/problemset/problem/921/14)), [problem:927A], [prob...
is no way to remove them from “Last Unsolved.” Should this not be considered a bug? # Motivation, way to remove them from “Last Unsolved.” Should this not be considered a bug?

Полный текст и комментарии »

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

4.
Автор Errichto, 11 лет назад, По-английски
Good Bye 2015 Hi everybody. The last round of the 2015 will take place on the 30-th of December ([starting time](http://www.timeanddate.com/worldclock/fixedtime.html?day=30&month=12&year=2015&hour=18&min=5&sec=0&p1=166)). The contest will last 3 hours. It won't be a usual round. Both divisions will compete together. You will get 8 problems to solve in 3 hours. Points will decrease slower than usually — otherwise you would get eps for solving a problem at the end. Scoring will be announced just before a contest. So will the speed of the points/minute loss. My goal was to provide you a diverse problemset with interesting problems for all contestants. During a contest you should consider reading not only the next problem but the few next ones. You will get this round thanks to work of many people. I am a problem setter. [user:GlebsHP,2015-12-28] helps me with everything (a lot). [user:AlexFetisov,2015-12-29], [user:johnasselta,2015-12-29] and [user:Zlobober,2015-12-29] are t...

Полный текст и комментарии »

Анонс Good Bye 2015
  • Проголосовать: нравится
  • +1387
  • Проголосовать: не нравится

5.
Автор MikeMirzayanov, история, 20 месяцев назад, По-английски
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 — 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 — 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) — all of that affects my mental state and willingne...
the bug to the coordinator and [user:KAN,2025-04-06]. I think that's the appropriate level of, As for [this comment](https://codeforces.me/blog/entry/139300#comment-1245989), I flagged thebug

Полный текст и комментарии »

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

6.
Автор pajenegod, история, 3 года назад, По-английски
Slowdown bug affecting C++ (64 bit) on Codeforces Yesterday, investigating [Strange TLE by cin using GNU C++20 (64)](https://codeforces.me/blog/entry/126573), I found an easy and reproducable way to trigger a slowdown bug that I believe has been plaguing Codeforces for some time now. So I'm making this blog to raise awarness of it. [user:MikeMirzayanov,2024-03-02], please take a look at this! Here is how to trigger the slowness bug: 1. Take any problem with a relatively large input on Codeforces ($2 \cdot 10^5$ ints is enough). 2. Take a random AC C++ submission that uses `std::cin`. 3. Add the line `vector<vector<int>> TLE(40000, vector<int>(7));` somewhere in global space. 4. Submit using either C++20(64 bit) or C++17(64 bit). 4. ??? 5. TLE For example take [user:Tourist,2024-03-02]'s solution to problem [problem:1936-D]. With the vector of death added to the code, it gets [TLE on TC5](https://codeforces.me/contest/1936/submission/249181295) (taking $> 5$ s). While without the deadly vector, the submission takes [15...
Slowdown bug affecting C++ (64 bit) on Codeforces, There are lots of alternative ways to, /entry/126573), I found an easy and reproducable way to trigger a slowdown bug that I believe has been, Declaring the vector inside main also causes the slowdown bug [submission:249330046]., Here is how to trigger the slowness bug:, Submissions using `scanf` instead of `cin` seems to be less affected by the slowdownbug. But even, You can change the size slightly, and still get the slowdown bug. From testing 39999 and 40000, as

Полный текст и комментарии »

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

7.
Автор ToxicPie9, 3 года назад, По-английски
You won't believe how this simple trick defeated the unexplained bug destroying every top LGM ### TL;DR Currently people are discussing a slowdown bug on Codeforces that seems to happen randomly, and can cause code to run 100x slower and get TLE. More details in [user:pajenegod,2024-03-03]'s [blog post](https://codeforces.me/blog/entry/126654). In this article, I present a mitigation: add the following to your code. ~~~~ #include <windows.h> void *operator new(size_t size) { if (void *ptr = HeapAlloc(GetProcessHeap(), 0, size ? size : 1)) return ptr; throw std::bad_alloc{}; } void operator delete(void *ptr) { HeapFree(GetProcessHeap(), 0, ptr); } ~~~~ <spoiler summary="If you use malloc/free in C++ (you shouldn't), also change them."> ~~~~ void *my_malloc(size_t size) { if (void *ptr = HeapAlloc(GetProcessHeap(), 0, size ? size : 1)) return ptr; throw std::bad_alloc{}; } void my_free(void *ptr) { HeapFree(GetProcessHeap(), 0, ptr); } ~~~~ </spoiler> <spoiler summary="If you use aligned new/delete in C++, also change the...
You won't believe how this simple trick defeated the unexplained bug destroying every top LGM, are scammed). This combined with the fact that changing the 7 makes the bug disappear, hints that, root cause of the bug which is outside contestants' control, creating unfair disadvantages in, runtime errors or another bug causing even weirder TLEs). , ### TL;DR Currently people are discussing a slowdown bug on Codeforces that seems to happen, After the bug was discovered, people are hacking submissions by using special inputs that cause a, Before this slowdown bug and its fixes are well-known, I think hacking using the bug is equivalent, Currently people are discussing a slowdown bug on Codeforces that seems to happen randomly, and can, Does this fix the slowdown bug? No one will likely ever know, because unlike Microsoft's C, In a way you could say that the bug is not Codeforces's fault... but it's not really not their, There has been [a bug on Codeforces causing random TLEs](https://codeforces.me/blog/entry/126573, This runs normally, which means that UCRT is unlikely the reason of the bug., bug is that if 40000 or 7 is changed slightly, or if the vector is moved to the middle, then nothing

Полный текст и комментарии »

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

8.
Автор MikeMirzayanov, история, 11 лет назад, По-русски
Codeforces: Rating Is Fixed (bug, go away!) Hello! Last weeks I was concerned (and probably, you too) about abnormal rating growth of our leaders. Of course, first of all I'm talking about [user:tourist,2016-04-06], his rating is just rushed into the sky. [ ](http://codeforces.me/predownloaded/99/59/9959129ab312a0bd0923600541211a1246a5201b.png) There were even comments from a series of "I told, and it happened" ![ ](http://codeforces.me/predownloaded/f6/a2/f6a2d5fcb18598f48cc5e3e3719e8ea135c5f820.png) After the first round of VK Cup 2016, I carefully investigated the reasons of such growth and found a simple and trivial bug in the rating formulas. It's funny that even after being published, nobody found it. Look at this function: ~~~~~ private double getSeed(List<Contestant> contestants, Contestant contestant, int rating) { Contestant extraContestant = new Contestant(null, 0, 0, rating); double result = 1; for (Contestant other : contestants) { result += getEloWi...
Codeforces: Rating Is Fixed (bug, go away!), (according to formulas with a bug) is no more than 3, the historic change continued to be used, * If, a simple and trivial bug in the rating formulas. It's funny that even after being published, nobody, trivial bug in the rating formulas. It's funny that even after being published, nobody found it. Look at, It turned out that this bug did not affect practically all users. Bug touched only the top. I, The good news is that this bug has a statistically significant effect only in the very rare cases, This bug led to the fact that taking the first place [user:tourist,2016-04-06] actually won a very

Полный текст и комментарии »

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

9.
Автор YouKn0wWho, 3 года назад, По-английски
A Huge Update on The Ultimate Topic List Hi, around 3 years ago I compiled most of the Competitive Programming topics in one place [here](https://codeforces.me/blog/entry/95106) with relevant resources, templates, and problems. It got great responses, it now has 4000+ upvotes and the blog website has been visited 200k+ times! But it contained links to only 1-2 resources and problems per topic and it didn’t contain basic topics for beginners. Also, there was no way of tracking your progress. This time I decided to improve it, by a lot. I took this project one month ago and it took me on average 6h-10h per day for the last one month to complete this project (also I was doing a full-time job). I hope it was worth it! The new version is not just a blog, it is a full-fledged website with multiple features (I have hosted it on one of my existing websites): ![topic_list](/predownloaded/7e/20/7e2045c57574d37e170ea3eb1fdc5516ff68bc0e.png) - **Topics:** The website contains around 500 topics and tricks. Not all topics are ...

Полный текст и комментарии »

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

10.
Автор YouKn0wWho, 4 года назад, По-английски
[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...
Notice that the problem has multiple test cases. But you are not resetting, When `n == 1`, you are continuing even before taking the array as input, mentioned how to avoid them. Also, in most cases, I will give you a chance to find out what thebug, Can you guess where the bug is?

Полный текст и комментарии »

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

11.
Автор bitset, 3 года назад, По-английски
[Bugged] Dynamic Bitsets in GCC **UPD1: The bug has been [fixed](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115399). I'll update the blog again when the fix is on Codeforces.** **UPD: Unfortunately, left / right shift is bugged and doesn't clear bits [properly](https://codeforces.me/blog/entry/129454?#comment-1157481). It should be fine for other operations, but use it at your own risk.** <spoiler summary="Original Blog"> Hello sirs, you might know that Boost has a dynamically sized bitset class, but did you know that GCC also has one? Turns out it's included in the tr2 folder. You can simply include the `<tr2/dynamic_bitset>` header, and use it as `std::tr2::dynamic_bitset`. **Yes, it works on Codeforces.** Here's a code example to count triangles in a graph ([abc258_g](https://atcoder.jp/contests/abc258/tasks/abc258_g)): <spoiler summary="Code"> ```cpp #include <bits/stdc++.h> I wonder if it's possible to get GCC to fix it... using namespace std; #include <tr2/dynamic_bitset> using namespa...
**UPD1: The bug has been [fixed](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115399). I'll update

Полный текст и комментарии »

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

12.
Автор snowysecret, 5 лет назад, По-английски
Codeforces Round #761 (Div. 2) Hello, Codeforces! I am happy to invite you to [contest:1617], which will take place on [contest_time:1617]. The round will be rated for participants with rating lower than 2100. **Notice the unusual starting time.** All the problems were authored and prepared by me. The round wouldn’t be possible without these people: - [user:Artyom123,2021-12-14] for excellent coordination and translation of statements. - [user:KAN,2021-12-14] for help with round preparation. - [user:arvindf232,2021-12-14], [user:physics0523,2021-12-14], [user:SecondThread,2021-12-15], [user:Igorbunov,2021-12-14], [user:kevinxiehk,2021-12-14], [user:generic_placeholder_name,2021-12-14], [user:Kotehok3,2021-12-14], [user:minhcool,2021-12-14], [user:anthony123,2021-12-14], [user:Elison,2021-12-14], [user:shishin,2021-12-14], [user:I_Love_YrNameCouldBeHere,2021-12-14], [user:Absyarka,2021-12-14], [user:erniepsycholone,2021-12-14], [user:dbsbs,2021-12-14], [user:lomienyeet,2021-12-14] for testing and valuabl...
**UPD:** Sorry but there is a checker bug in problem E. All submissions of problem E will be, /blog/entry/97920). **UPD:** Sorry but there is a checker bug in problem E. All submissions of

Полный текст и комментарии »

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

13.
Автор unreal.eugene, 5 лет назад, По-английски
Polygon Updates (June — August 2021) Hello, Codeforces. I and [user:DK318,2021-08-19] joined the Codeforces team in June. These three months 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. Most of the changes were made to attain easier problem creation. This list does not include minor bug fixes or any improvements that are invisible to users. #### Tables support when rendering statements in HTML Now it's possible to insert the most basic tables in your HTML statements. For example, you can show the scoring system of your problem or insert several images side by side. Only column text alignment and border specification are supported now. <img src="/predownloaded/4a/4a/4a4a6c726e96df40929803a1276a448947d6ebed.png" style="width: 800px; margin-left: auto; margin-right: auto; display: block"/> #### A brief manual for writing statements We bet a lot of users who wrote statements were confused by the fact ...
creation. This list does not include minor bug fixes or any improvements that are invisible to users.

Полный текст и комментарии »

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

14.
Автор Um_nik, история, 2 года назад, По-английски
Hacking (as a CF feature) does not fit modern competitive programming 1. How does hacking work with the new feature of unrated registration? I have seen this question raised in the comments to the announcement several times, but there is no answer still and I think it's weird that Mike hasn't thought about it before announcing. 2. I was working recently on a div.2 Codeforces round (still might happen in the future) and I was told by my coordinator that pretests should be equal to systests in all the problems. From this I can conclude that it is a Codeforces policy and intentionally weak pretests do not happen. It doesn't mean that it is impossible to hack anybody, but it doesn't sound like a viable strategy. I find it weird that this information is not public, it's like I'm getting bonus information about all other Codeforces rounds by setting a round myself. I have done exactly zero research on the matter, but my feeling is that 99% of hacks (I'm talking about during-the-round-hacking here, not open hacking of education rounds and such) happen in ...
has (15+-3) solutions with the same bug. So somebody in the room gets (1500+-300) points that have no, ) solutions with the same bug. So somebody in the room gets (1500+-300) points that have no

Полный текст и комментарии »

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

15.
Автор robinyu, 9 лет назад, По-английски
Codeforces Round #419 _Mabuhay!_ I am honored to announce Codeforces Round #419. It will take place tomorrow, on [June 17, 17:35 MSK](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Codeforces+Round+%23419&iso=20170617T1735&p1=166&ah=2). The problems in this round are written by me, [user:robinyu,2017-06-16]. I believe it is the first Codeforces round with a Philippine writer. I would like to extend my heartfelt gratitude to [user:kevinsogo,2017-06-16], [user:AlexFetisov,2017-06-16] and [user:winger,2017-06-16] for their invaluable help in testing the problems, [user:KAN,2017-06-16] for his endless patience and support in preparing the contest, and of course [user:MikeMirzayanov,2017-06-16] for the absolutely amazing Codeforces and Polygon platforms. In this round, you will be helping [Karen](http://kinmosa.wikia.com/wiki/Karen_Kuj%C5%8D) in her day-to-day routine. <center><img src="/predownloaded/d1/9b/d19b65bfdc54ec764a9823a7e108afc940cf9f5f.png"></center> There will be pretty pic...
Good luck, and I wish you all high ratings and bug-free code!

Полный текст и комментарии »

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

16.
Автор rewhile, 20 месяцев назад, По-английски
<h1>Mike, please stop ignoring your userbase</h1> **This blog will compile a list of codeforces issues along with all the times Mike has ignored complaints about them** ## 1. Unreasonable delay for viewing submissions [<a class="rated-user user-green">+973</a>] - [Submission pages on Codeforces often not loading](https://codeforces.me/blog/entry/134655) [<a class="rated-user user-green">+281</a>] by [user:jeroenodb,2025-04-04] on *October 2024* - [Unreasonable delay for viewing submissions](https://codeforces.me/blog/entry/135457) [<a class="rated-user user-green" title="Green 392">+392</a>] by [user:djm03178,2025-04-04] on *October 2024* - [Please, give us proper explanations about this nonsense.](https://codeforces.me/blog/entry/136830) [<a class="rated-user user-green">+300</a>] by [user:djm03178,2025-04-04] on *December 2024* No [user:MikeMirzayanov,2025-04-04] reply ## 2. Cloudflare misconfiguration [<a class="rated-user user-green">+1232</a>] Posted [CF should rename itself to Cloudflare instead of Codef...
interactor bug](https://codeforces.me/blog/entry/139300#comment-1245989) but offered no rejudge

Полный текст и комментарии »

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

17.
Автор nyavim, история, 2 года назад, По-английски
Another Graph Editor! **UPDATE (5 Dec 2024)** There have been a few new features since its initial release. - Multiple graphs/testcases (each "tab" can store its own testcase so you can visualize all testcases at once) - Multi-edge support - Bipartite mode - More appearance-related configuration sliders Thanks for all the support and suggestions! Things will continue to be added slowly over time, but if there's a particular feature that you want you can just open an issue on GitHub. --- Hello, Codeforces! I've been working on a graph visualization tool for a while now, and because I couldn't think of a good name for it, I've opted to call it *Another Graph Editor*. If you have any name suggestions, pls let me know. Here's the [website](https://anacc22.github.io/another_graph_editor/) and the [repo](https://github.com/anAcc22/another_graph_editor). ![ ](https://github.com/anAcc22/another_graph_editor/blob/main/screenshots/main.png?raw=true) The layout is very much inspired by CS A...

Полный текст и комментарии »

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

18.
Автор vovuh, история, 6 лет назад, По-английски
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...
Codeforces, it (most probably) means you have a bug somewhere in your code. There are rare cases when the

Полный текст и комментарии »

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

19.
Автор Errichto, 10 лет назад, По-английски
Good Bye 2016 sponsored by Barcelona ACM-ICPC Camp Hello everybody! On December 30 at 14:05 UTC/17:05 MSK ([check your time zone here](http://timeanddate.com/worldclock/fixedtime.html?day=30&month=12&year=2016&hour=17&min=5&sec=0&p1=166)) Codeforces will host the New Year's contest Good Bye 2016. The contest is combined for both divisions, lasts 2.5 hours and contains 8 problems. Thanks to <a href="http://harbour.space/">Harbour.Space</a> and <a href="http://in.harbour.space/icpc/"> Barcelona ACM-ICPC Programming Bootcamp 2017</a> sponsoring the contest, winners can expect really cool prizes: - 5 best participants (not ACM ICPC veterans) will win free participation in Hello Barcelona programming bootcamp. - 30 best participants (not ACM ICPC veterans) will receive a 30% discount for participation in Hello Barcelona programming bootcamp. - 100 best participants will receive t-shrits by organizers and Codeforces. <center> <img src="http://codeforces.me/predownloaded/dd/0f/dd0fbc52ada73fb48011ce52adee739a248fa804.png"/> </...

Полный текст и комментарии »

Анонс Good Bye 2016
  • Проголосовать: нравится
  • +556
  • Проголосовать: не нравится

20.
Автор KaiSuoShuTong, 21 месяц назад, По-английски
Codeforces Round #1010 (Div. 1, Div. 2, based on Zhili Cup 2025) <img src="/predownloaded/56/63/566383e7e7fa812dd2a088c602242a8719a18bea.png" style="width: 250.0px;float: right;margin: 0 1.0em 1.0em 1.0em;max-width: 100.0%;max-height: 100.0%;"> Nihao! Hello to all fans of competitive programming and Codeforces enjoyers! On behalf of Tsinghua University’s Zhili College, we — your proud and slightly sleep-deprived Class of 2028 Information and Computing Science students — are happy to invite you to participate in [contest:2081] and [contest:2082], which will take place on [contest_time:2081]. **Note the unusual start time of the round.** You’ll have **3 hours** to tackle **7 problems** for division 1 and **6 problems** for division 2, the round will be rated for all participants. It’s a little longer than your typical Codeforces round, and yes, we know you’ll be sleep-deprived — but who needs sleep when there’s coding to do, right? This round’s problems are brought to you by the incredible [user:Ecrade_, 2025-03-01], [user:newbiewzs, 2025-...
**Good luck, and may your code be bug-free and your coffee cup never empty.**

Полный текст и комментарии »

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

21.
Автор Swistakk, история, 11 лет назад, По-английски
How bugged Floyd-Warshall is not bugged Yesterday at SRM 670 I got a funny story which I want to describe. During challenge phase I noted that one solution of medium problem in my room uses Floyd-Warshall. I thought "Oh, why haven't I thought about it during coding phase? Much shorter than those DFSes!", but then I noted that unexpectedly this infamous order of loops is not correct. It went like this: ~~~~~ FOR(x, n) FOR(y, n) FOR(z, n) dis[x][y] = min(dis[x][y], dis[x][z] + dis[z][y]); ~~~~~ while everyone should know that FOR(z,n) should be the outer loop, not the inner one. I tried to hack this solution, so I inputted graph 0-3-2-1, however my test was rejected, because problem was about trees and there was a constraint that parent of vertex $i$ should be less than $i$ and I didn't have time to come up with another testcase. Unexpectedly, this solution passed systests! I thought that its author is very lucky. However it turns out that for trees with this constraint this order of loop result in computing correct ...

Полный текст и комментарии »

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

22.
Автор Kostroma, 7 лет назад, По-английски
AIM Tech Poorly Prepared Contest (unrated, funny, div. 1 preferred) Hello! Traditionally AIM Tech organizes a big party for Petrozavodsk camp participants to have fun and get an opportunity to communicate with each other. Usually it comes along with **a funny contest in unusual format**. This year we decided to share the fun with all codeforces community! This year we came up with a format requiring (probably) less time for preparing the contest. It is somewhat similar to an ordinary contest with a 3-hour duration. We already have some problem ideas, so it should be super easy to prepare the problems just one night before the competition. We hope everything will run smoothly! The contest will start on [contest_time:1302]. It could be a bit rescheduled due to onsite delays. It will be **an unrated funny competition**. Unlike usual ICPC-style contests, you'll be given an archive with several open test cases and answers for each problem. You'll have some sample test cases in the statement too, they'll be included in the archive. However, the ...
contains a bug (or even several bugs!). However, we decided not to cancel the competition. We give you the, ! Unfortunately, each authors' solution contains a bug (or even several bugs!). However, we decided not to

Полный текст и комментарии »

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

23.
Автор ace5, 17 месяцев назад, По-английски
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...
Very hard bug in a very simple code, You can avoid this bug in many different ways, such as:

Полный текст и комментарии »

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

24.
Автор gepardo, история, 8 лет назад, По-английски
An alternative sorting order for Mo's algorithm Hello, Codeforces! I think many of you know about Mo's algorithm. For those, who don't know, please read this [blog](https://codeforces.me/blog/entry/7383). Here, I consider an alternative (and faster) approach of sorting queries in Mo's algorithm. # Table of contents * [Canonical version of the algorithm](#s1) * [Achieving a better time complexity](#s2) * [Relation to TSP](#s2-1) * [Hilbert curve](#s2-2) * [Benchmarks](#s3) * [Applicability](#s4) <div style="font-size: 1pt"> &nbsp; [cut] &nbsp; </div> <a name="s1"></a> # Canonical version of the algorithm The canonical version of this algorithm has $O((n + q)\cdot\sqrt{n})$ time complexity if insertions and deletions work in $O(1)$. Usually, the two comparators for query sorting are used. The slowest one: ~~~~~ struct Query { int l, r, idx; inline pair<int, int> toPair() const { return make_pair(l / block, r); } }; inline bool operator<(const Query &a, const Query &b) { re...

Полный текст и комментарии »

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

25.
Автор MikeMirzayanov, 8 лет назад, По-английски
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...

Полный текст и комментарии »

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

26.
Автор geranazavr555, 7 лет назад, По-русски
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...
include minor bug fixes or any improvements that are invisible to users.

Полный текст и комментарии »

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

27.
Автор Wind_Eagle, история, 5 лет назад, По-русски
Where the author of the contest came up entertaining. Cheating cheaters. Hello, Codeforces! A month ago I have wrote [my blog about cheaters](https://codeforces.me/blog/entry/94300). Under that blog, a number of suggestions have accumulated, and there is a number of interesting ideas that could be applied to sabotage a group of cheaters. I've often seen comments along the lines of: <spoiler summary="Pictures">. <a href="https://imgbb.com/"><img src="https://i.ibb.co/r65zfTL/cheat1.png" alt="pic1" border="0"></a> <a href="https://imgbb.com/"><img src="https://i.ibb.co/Yh6ZfY8/cheat2.png" alt="pic2" border="0"></a> </spoiler> Well, doing what [user:Ari,2021-09-28] suggested wasn't really what I wanted to do, but it was worth checking out what would happen if the wrong solutions were sent. I asked some famous user what would happen if I sent the wrong solutions to cheaters. He told me that someone had done this before and that he was quickly debunked. I wondered whether I could cheat cheaters without getting caught. But for this, I had to do so...
rectangle is green, my solution works, look for a bug yourself.

Полный текст и комментарии »

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

28.
Автор Errichto, 10 лет назад, перевод, По-русски
VK Cup 2017 Round 1 and CF Round 405 div1+div2 Hello. The round 1 of VK Cup 2017 will take place on March 18 at 18:35 MSK (check your timezone [here](https://www.timeanddate.com/worldclock/fixedtime.html?day=18&month=3&year=2017&hour=18&min=35&sec=0&p1=166)), along with standard div1+2 Codeforces Round \#405. The contest "VK Cup 2017 &mdash; Round 1" is for teams qualified from two Qualification Rounds. The top 400 teams will advance to the Round 2, while other ones will have one more chance in the Wild Card Round 1 in April. Those who don't participate in the VK Cup can take part in the Codeforces Round \#405 individually (problems will be available in English too). All three rounds last 2 hours, and all are rated. I want to thank: [user:KAN,2017-03-17] for his help in the contest preparation, [user:MikeMirzayanov,2017-03-17] that we are here, [user:AlexFetisov,2017-03-17] for testing, the VK company for this nice annual contest. I'm a setter and I hope (and expect?) that you will enjoy the problems. During the conte...

Полный текст и комментарии »

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

29.
Автор errorgorn, 5 лет назад, По-английски
Linear Basis (Xor Basis Extended) As part of the graduation requirements for my school, I have to complete a simple research project, so I decided to do something related to data structure and algorithms. I believe I have come out with a data structure that maintains the basis of vectors in $(\mathbb{Z}/m\mathbb{Z})^d$, where $m$ **may not be prime**. Since this was related to competitive programming, I think it is a good idea to share it here. Hopefully, this algorithm is actually novel :P I would like to thank: - [user:icypiggy,2021-12-26] for being my research mentor and tolerating my dumb questions - [user:rama_pang,2021-12-26] and [user:adamant,2021-12-28] for their helpful suggestions and comments Please comment under the blog or message me on codeforces if any parts are unclear or wrong. Also, I hope that some LGMs can help solve the open problems in this blog. # Introduction Maintaining the basis of vectors in $(\mathbb{Z}/2 \mathbb{Z})^d$, also known as the xor basis algorithm is a well-studie...
> //change less to less_equal for non distinct pbds, but erase will bug

Полный текст и комментарии »

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

30.
Автор Geothermal, история, 3 года назад, По-английски
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...
FSTed due to a minor bug in my logic that would have been caught on a fair number of small cases

Полный текст и комментарии »

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

31.
Автор MikeMirzayanov, 4 года назад, По-английски
Testlib: tests + CI Hello, Codeforces. I have wanted for a long time and now, finally, I sat down and did it. Many of you are familiar with my [Testlib](https://github.com/MikeMirzayanov/testlib) project. This is a library that helps you develop problems if you are using C++. In the case of problems for Codeforces rounds, its use is mandatory. It seems to me that it is almost a de facto standard for preparing materials for completely different olympiads and competitions. The history of С++-Testlib is almost lost in centuries, I published the first version in 2005. Nowadays, making edits to Testlib has become tricky. The code grown to thousands of lines, also it has too long a history. This increases the likelihood of accidentally changing some aspect of behavior, which will jeopardize the holding of a Codeforces round or another important competition. In short, making a bug in this code or changing behavior anywhere is highly discouraged. So I recently took the plunge and wrote some test...
short, making a bug in this code or changing behavior anywhere is highly discouraged.

Полный текст и комментарии »

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

32.
Автор Errichto, 10 лет назад, По-английски
Codeforces Round #356 Hello Codeforces. The CF Round \#356 will happen on 8-th June ([exact time](http://www.timeanddate.com/worldclock/fixedtime.html?day=8&month=6&year=2016&hour=19&min=35&sec=0&p1=166)). You will get five problems to solve in two hours. The round is rated. I encourage you to read other problems if you don't like or can't solve something. The scoring distribution will be announced. [user:MikeMirzayanov,2016-06-06] and [user:GlebsHP,2016-06-06] make the round possible. Also, thanks for [user:Stonefeang,2016-06-06], [user:kostka,2016-06-06], [user:johnasselta,2016-06-06], [user:AlexFetisov,2016-06-07] and (more to be added?) for their amazing help. And I want to thank my girlfriend because there would be no Limak without her. It's my first standard round. Still, you should get nice interesting problems. You will meet Limak, who is usually a little polar bear. Here he is, preparing one of problems. ![ ](http://codeforces.me/predownloaded/91/95/91956cb0e92e3c0376634a6a1...

Полный текст и комментарии »

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

33.
Автор dj3500, 12 лет назад, По-английски
Hightail — automatic tester for programming contests Hi! In this post I would like to introduce you to an application called [Hightail](http://github.com/dj3500/hightail). [Hightail](http://github.com/dj3500/hightail) is an automatic tester for programming contests such as CodeForces rounds. It will parse the problem statement, extract sample test cases (inputs and outputs) from it, and verify the correctness of your program against them. It is built to provide maximum automation and to relieve the contestant as much as possible. A list of Hightail's features: - parsing problem statements - parsing entire contests (autoloading all problems) - scheduling contest parsing ahead of time - ability to comfortably view, edit and add test cases - handling of all verdicts: WA, TLE, RE, even AC - customizable time limits - ability to create in/out files in your working directory - detection of floating point values (comparing 0.1 vs. 0.10 does not give WA) - easy-to-use UI, keyboard shortcuts - resilient: it is multi-threaded so ...

Полный текст и комментарии »

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

34.
Автор Errichto, 7 лет назад, По-английски
Codeforces Round #584 (Dasha Code Championship Elimination Round) (div. 1 + div. 2) Hey, hi, hello. [contest:1209] starts on [contest_time:1209] and lasts 2h30m. The score drain will be adjusted for longer contest duration. It's a combined rated round with around eight problems. It is open and it is rated for everybody. Yes, it's rated. There are Dasha t-shirts for top 30 competitors (not counting later-to-be onsite finalists). As an extra, this is an elimination round for those who live in/near SPb/Novosibirsk. More info about the championship is in the other [blog](https://codeforces.me/blog/entry/69530). Thanks to Dasha.AI for making such an event for the community! Problems are prepared by [user:MikeMirzayanov,2019-09-14], [user:FieryPhoenix,2019-09-14], [user:dragonslayerintraining,2019-09-14] and [user:Errichto,2019-09-14]. One of these setters also created Codeforces, thanks for that! And huge thanks to [user:_kun_,2019-09-14] for coordinating the round, to [user:Merkurev,2019-09-14], [user:isaf27,2019-09-14], [user:KAN,2019-09-14] and me for test...

Полный текст и комментарии »

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

35.
Автор snowysecret, 5 лет назад, По-английски
Editorial for Codeforces Round #761 (Div. 2) Thanks for participating, hope you enjoyed the problems! Implementations for the problems are chosen randomly among testers, and I made some changes to their codes (for example, deleted meaningless comment lines). Please do not hesitate to provide feedback in the comments, so I can improve in setting problems next time. **UPD**: Sorry but there is a checker bug in problem E. All submissions of problem E will be rejudged soon. **UPD2:** Rejudge done, the round remains rated. <spoiler summary="Statistics"> Number of FST for rated participants: - Problem A: $29$ - Problem B: $90$ - Problem C: $12$ - Problem D1: $4$ - Problem D2: $0$ - Problem E: $6$ Number of AK: $22$ Number of clarifications: $85$ </spoiler> [problem:1617A] <spoiler summary="Hint"> When is the lexicographically smallest permutation of $S$ (i.e. the sorted string) not the answer? </spoiler> <spoiler summary="Solution"> If there are no occurrences of `a`, `b` or `c` in $S$, ...
**UPD**: Sorry but there is a checker bug in problem E. All submissions of problem E will be

Полный текст и комментарии »

Разбор задач Codeforces Round 761 (Div. 2)
  • Проголосовать: нравится
  • +425
  • Проголосовать: не нравится

36.
Автор purplesyringa, 5 лет назад, По-английски
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...
that this problem was connected to the sandbox as well. So why not write "fixed abug in the sandbox

Полный текст и комментарии »

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

37.
Автор vbandurin, история, 3 года назад, По-английски
Polygon Updates (August — September 2023) Hello, Codeforces! I, [user:ChurakovaAlexandra,2023-10-13], and [user:medvezhonokok,2023-10-13] are students of ITMO, and since this August, we started our internship at Codeforces. We are delighted that now we have the opportunity not only to write academic code but to do something that competitive programming enthusiasts from all over the world use. Currently, we are working on minor improvements to Polygon &mdash; a system for preparing problems. Later, as we gain more experience and delve into the technologies, we will also start working on Codeforces. A big thank you to our mentors [user:geranazavr555,2023-10-13] and [user:MikeMirzayanov,2023-10-13], who are always there to help and support. Here's a list of the main improvements to Polygon that we've made (sometimes with significant help from our mentors) over these two months. [cut]<br/> ###### 1. Automatic translation of solutions from one programming language to another. On the 'Solutions' page, a 'Tra...
changes and/or open bug issues.

Полный текст и комментарии »

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

38.
Автор MikeMirzayanov, 8 лет назад, перевод, По-русски
ICPC Finals 2019 <img src="/predownloaded/02/25/02253adce36abb83bcaedca3cd1498b9d459d90d.png" style="margin: 0 0 0 1em; float: right;"> ICPC World Finals 2019 will begin on <a href="https://www.timeanddate.com/worldclock/fixedtime.html?msg=ICPC+World+Finals+2019&iso=20190404T12&p1=320&ah=5">April 4, 2019 at 11:00 (UTC)</a>. This event is the main event of the year in the world of sports programming! In the past 20 years alone, ICPC participation has increased by more than 2000%. The contest evolved into its present form as a multi-tier competition in 1977, with the first finals held in conjunction with the ACM Computer Science Conference. Last year, ICPC Regional participation included 52,709 of the finest students and faculty in computing disciplines from 3,233 universities in 110 countries. We remind you that in the current world champion is the team of Moscow State University. Codeforces wishes the teams to show a vivid and interesting contest. We wish to find beautiful solutions, write ...

Полный текст и комментарии »

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

39.
Автор prvocislo, история, 4 года назад, По-английски
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 ...

Полный текст и комментарии »

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

40.
Автор -is-this-fft-, история, 5 лет назад, По-английски
[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 ...

Полный текст и комментарии »

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

41.
Автор gKseni, 9 лет назад, По-русски
ICPC World Finals 2018 <img src="/predownloaded/de/f3/def309578bab3ca770ea7262a4135f8f1ea50545.jpg" style="margin: 0 0 0 1em; float: right;"> ACM-ICPC World Finals 2018 will begin on <a href="https://www.timeanddate.com/worldclock/fixedtime.html?msg=ACM+ICPC+2018+World+Finals&iso=20180419T10&p1=33&ah=5">April 19, 2018 at 2:00 (UTC)</a>. This event is the main event of the year in the world of sports programming! In the past 20 years alone, ICPC participation has increased by more than 2000%. Last year, ICPC Regional participation included 49,935 of the finest students and faculty in computing disciplines from 3,098 universities in 111 countries on six continents. A record 53,446 students and 5,411 coaches competed in ICPC and ICPC-assisted competitions last year, setting new records in participation. Codeforces wishes the teams to show a vivid and interesting contest. We wish to find beautiful solutions, write without bugs and enjoy many accepted problems! Links: * <a style="font-weight: bol...

Полный текст и комментарии »

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

42.
Автор Errichto, 11 лет назад, По-английски
Codeforces Round #318 [RussianCodeCup Thanks-Round] Hello Codeforces community! Codeforces Round #318 (for both divisions) will take place on [August, 29 at 19:30 MSK](http://www.timeanddate.com/worldclock/fixedtime.html?day=29&month=8&year=2015&hour=19&min=30&sec=0&p1=166). It is the Thanks-Round devoted to Russian Code Cup. You will be given 5 problems and 2 hours to solve them. Scoring will be announced close to the round. I strongly recommend you to read all problems. ![ ](http://codeforces.me/predownloaded/97/f0/97f0ed2e07a03e20ded192532c533b620734da64.jpg) <a href="http://www.russiancodecup.ru/">RussianCodeCup</a> is the largest open programming competiton for Russian-speaking participants by Mail.Ru Group. Its history started in 2011. And since the first championship RCC offers great problems and generous prizes. This year finals will be held on September, 19th. Wish good luck to all the finalists! Thank you, RussianCodeCup, for your gift on the 5th anniversary of Codeforces! I am honoured to be a problem setter ...

Полный текст и комментарии »

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

43.
Автор purplesyringa, история, 2 года назад, По-английски
AI might erase CP, but not us I haven't slept for 20 hours and I can't fall asleep. I've been reading others' topics on AI, and I had a sort of epiphany. These ideas have been brewing inside me for many years, and I thought it might be time to share them with the community. --- There were times when I was a "competitive programmer" at the core. I spent many years doing that exclusively. I've never been to IOI, but I like to think that I've reached some good heights. Two years ago, I stopped writing online competitions. I've written a few offline competitions after that, but eventually, I decided to stop that too. Yet somehow Codeforces still attracts me. I don't want to solve problems, but I keep typing codeforces.com into the address bar. *Why?* Just yesterday, I didn't have an answer. --- Imagine a layperson asking you what competitive programming is. What are you going to say? My answer has always been "Oh, we solve interesting algorithmic problems with time constraints and other limits". Many ...
uncovering bugs. I like watching people reporting UB as if it was a compiler bug, because sometimes it really

Полный текст и комментарии »

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

44.
Автор orz, история, 3 года назад, По-английски
C++20 is back In contests and in the custom invocation, after a pause, one can again find GNU G++20 64-bit. However, the [slowdown issue](https://codeforces.me/blog/entry/126654) because of which the language disappeared persists, there are still snippets of code that can slow down the execution on Codeforces servers by a factor of 100 or so. So what is the official position of Codeforces headquarters and of our community on that? 1. Are there general methods of constructing testcases that can exploit this GCC/Windows bug and therefore slow down solutions (like there are [anti-hash tests](https://codeforces.me/blog/entry/62393) for solutions using `unordered_set`)? Are there methods that slow down both contest mode and custom invocation mode (since [submission:249807302] is only slow in the contest mode whereas [submission:253289473] is only slow in the custom invocation)? 2. If so, should we expect such tests in future contests, will such methods be used during the test preparation in co...
this GCC/Windows bug and therefore slow down solutions (like there are [anti-hash tests](https, 1. Are there general methods of constructing testcases that can exploit this GCC/Windowsbug and, 3. If this is deemed an unwanted bug, will participants be protected from unscrupulous hacks and, 4. Is there no bug in 32-bit version? If it's 64-bit only, maybe CF team could add a C++20 32-bit, 5. Is there this bug in Microsoft Visual C++ compilers (32 or 64 bits)? If so, is it the reason why, 6. Are there generic methods of protecting against the bug (except switching to 32 bits)? I read, 7. Has anyone a clue what is going on, why do the aforementioned programs run slowly? Is thisbug, 8. Is this bug reproducible on other platforms? For instance, on godbolt there are some windows, 9. Is there surely no such bug on Linux? (Anyway, with regard to Codeforces it is probably a

Полный текст и комментарии »

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

45.
Автор AlexSkidanov, история, 9 лет назад, По-английски
Are we close to machines solving ICPC problems? Hi, all, I with few other folks at [NEAR](http://near.ai/blog) work on teaching machines to program. A particularly exciting sub-project of that is teaching machines to solve competitive programming problems. In this post I would like to give a quick overview of where the state of the art is today, what the major challenges are, why this is not a popular area of research, and how the CodeForces community can help to address some of the issues the program synthesis community is facing today. We also have a certain budged allocated for this project, and we are paying to the CodeForces members who help us with some data annotation challenges. We have paid more than $10k in our first two annotation projects, and are launching three more projects today. Scroll to the end if you are interested. Competitive programming as a benchmark ====================================== With the emergence of deep learning, neural networks started performing almost at a human level in many ta...
something like "Fixing a bug we found yesterday"., the code back to the model, spotting this bug would be extremely hard. Even for humans it is a non, 1. Small commits that fix a simple bug, and the text of the associated issue. The person who fixes

Полный текст и комментарии »

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

46.
Автор errorgorn, история, 6 лет назад, По-английски
Codeforces Round #723 (Div. 2) Editorial [problem:1526A] ------------------ Setter: [user:antontrygubO_o,2021-05-28] Preparer: [user:errorgorn,2021-05-28] <spoiler summary="Hint 1"> Notice that the array size is even length. Usually in such problems, we would split the array into $2$ equal parts. Can you figure out what those $2$ parts are? </spoiler> <spoiler summary="Hint 2"> We sort the array and split it into the big half and the small half. </spoiler> <spoiler summary="Solution"> The main idea is that we can split the numbers into the two halves, the big half and small half, we can place the bigger half at the odd positions and the smaller half at the even positions. This works because the smallest big number is larger than the biggest small number. Hence, the mean of any two small numbers is smaller than any big number, and the mean of any two big numbers is bigger than any small number. </spoiler> <spoiler summary="Code (C++)"> ```c++ //雪花飄飄北風嘯嘯 //天地一片蒼茫 #include <bits/stdc++.h> #inc...
> //change less to less_equal for non distinct pbds, but erase will bug

Полный текст и комментарии »

Разбор задач Codeforces Round 723 (Div. 2)
  • Проголосовать: нравится
  • +199
  • Проголосовать: не нравится

47.
Автор Errichto, 11 лет назад, перевод, По-русски
VK Cup 2016 — Round 3 Hi everybody. The VK Cup Round 3 is coming ([exact time](http://www.timeanddate.com/worldclock/fixedtime.html?day=7&month=5&year=2016&hour=18&min=5&sec=0&p1=166)). The duration will be longer than usual, likely 3 hours. As usually in VK Cup, there will be three contests &mdash; div1, div2, official one. All of them are rated. Div1 and div2 versions are for individual participants, not for teams. Setters are [user:Stonefeang,2016-05-05], [user:Errichto,2016-05-05] and [user:qwerty787788,2016-05-05]. I think that (some) problems are extremely interesting and I really wish I could participate. Thanks to [user:GlebsHP,2016-05-05] and [user:MikeMirzayanov,2016-05-05], we wouldn't have a round without them. Also, thanks to [user:AlexFetisov,2016-05-06] and [user:winger,2016-05-06] for testing. We will later inform about the final duration. Maybe we will inform about the number of problems and scoring. I wish you great fun and no frustrating bugs. And Limak wishes you...

Полный текст и комментарии »

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

48.
Автор kuviman, история, 11 лет назад, По-русски
Codeforces Updates (April-May, 2015) Hello! Codeforces never sleeps, and I am going to tell you about our recent updates which weren't announced yet. ### Testlib - testlib moved to [GitHub](https://github.com/mikemirzayanov/testlib), and the version 0.9.9 with C++11 support has been released. ### Polygon - Added basic support for test groups. Now you can specify group for each test, run invocations by test groups, and you can view summary for each group on the invocation page. If group is specified for a test, it will be added to the problem descriptor (i. e. `<test cmd="gen 1 2" group="testGroup" method="generated"/>`). - You can now view problem statements and validator for a problem/contest on the same page. This makes finding mistakes in translations and in validator much easier (before you had to open them on separate tabs and switch between them, which is not comfortable). On the problem statements page the "Review" link has been added: <br/> ![ ](http://codeforces.me/predownloaded/22/8b/228bf6f506072...
additionally are showed using Notification API. - Fixed a bug in API: in `contest.hacks` method `defender, ; messages additionally are showed using Notification API. - Fixed a bug in API: in `contest.hacks

Полный текст и комментарии »

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

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

Полный текст и комментарии »

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

50.
Автор adamant, 12 месяцев назад, По-английски
Caveats of using optimize("Ofast") with target("avx2") Hi everyone! As you may know, it is often recommended to put these lines in your header: ```cpp #pragma GCC optimize("Ofast,unroll-loops") #pragma GCC target("avx2") ``` And they're usually great!<sup>[1]</sup> Well, until they aren't. For last 2-3 days I was riddled with the issue that [CP-Algorithms Library](https://lib.cp-algorithms.com) would perform very well on Library Checker, but whenever I tried to also apply it on Codeforces, it will fail to speed up the code, and sometimes would even make it much slower. As I finally figured out the cause, I'd like to write a blog about it, so that other people don't waste as much time. Mitigating these issues improved my running time on [problem:1975G] from **1530 ms** in [submission:316602668] to **203 ms** in [submission:352602775]. ##### Tl'dr See the "Takeaway" section at the bottom. [cut]<br> ##### Example problem I will reproduce the issue on a simple example: <hr> **[problem:911G]**: You are given an...
pragma _after_ including `bits/allocator.h`, so that we circumvent the bug. Let's try it in, =native` or `-mavx2`, and it should not prevent code compilation with global avx2 target due to thebug in, It is a [known bug](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109753) in GCC 13 and 14. It has

Полный текст и комментарии »

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

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

Полный текст и комментарии »

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

52.
Автор BigBag, 10 лет назад, По-русски
Codeforces Round #373 Hi everyone! Codeforces Round #373 (Div. 1 + Div. 2) will take place on [23 September 2016 at 16:05 MSK](http://www.timeanddate.com/worldclock/fixedtime.html?day=23&month=9&year=2016&hour=16&min=5&sec=0&p1=166). Please note that **the timing is unusual**. This time tasks for you were prepared by me (Matvey Aslandukov) and my brother [user:_XuMuk_,2016-09-21] (Andrew Aslandukov). It is our first codeforces round and we hope you'll enjoy it. We want to say special thanks to [user:Seyaua,2016-09-21] (Ievgen Soboliev), [user:alexfetisov,2016-09-21] (Alexandr Fetisov) and [user:winger,2016-09-21] (Vladislav Isenbaev) for testing the problems, [user:GlebsHP,2016-09-21] for his help with the contest preparation, and [user:MikeMirzayanov,2016-09-21] for the excellent platforms Polygon and Codeforces. Coincidentally, the date of the round falls on my birthday, so I am very happy that I can spend that day surrounded by our friendly community :) There will be five problems and two hou...
suppose that this bug affected the final results a lot and there is no way to consider its influence on, the main factor to make a decision on whether the round should be rated or not is how much thebug

Полный текст и комментарии »

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

53.
Автор Dominater069, 2 года назад, По-английски
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 ...
of finding bug with stress test, fixing them and then again running stress test before my code was, was still done within $12$ minutes and it took me less than $5$ mins to stress test, and fix mybug, Also, be careful while implementing this solution. I made a small bug during the contest due to, The bug is you need to specifically consider only distinct elements in $(b, c, a_b, a_c

Полный текст и комментарии »

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

54.
Автор purplesyringa, история, 2 года назад, По-английски
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...
authors to answer them. - Blogs *request support*, e.g. ask commenters to find abug or answer a, simple introduction to segment trees". - Blogs: "I found a compiler bug, check out my totally UB

Полный текст и комментарии »

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

55.
Автор Princ_iple, история, 7 лет назад, По-английски
Codeforces Practice Tracker — Browser Extension Hi everyone! I'd like to share with you my new extension, [**Codeforces Practice Tracker**](https://chrome.google.com/webstore/detail/cnahgdhboflcnojgmeehhhfeoojifonm). Codeforces Practice Tracker helps to track your practice progress in codeforces through time phases, It simply adds new tab to your profile (or any other profile) in this tab you can find data about each time phase. ![ ](/predownloaded/b9/b2/b9b2bde177a6fc2b43894af65ab8e17dc2c3e5a8.png) For each time phase it shows: - Number of solved problems. - Number of submissions. - Hardest (Max Rated) problem you solved. - Average of the rates of the problems you solved. - Number of contests and virtuals you participated. - Statics of submissions. Note: Gyms problems and unrated problems are only considered in number of solved problems and number of submissions. More features: - Show each phase and compare it with previous one. - Skip inactive phases. - Change number of days of each phase. It ...

Полный текст и комментарии »

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

56.
Автор -14, история, 5 лет назад, По-английски
Incredible bug found in __gnu_cxx::rope Today when I took part in the Round #740 solving problem [D. Top-Notch Insertions](https://codeforces.me/contest/1558/problem/D), [my submission](https://codeforces.me/contest/1558/submission/126903561) failed on test 2 without knowing why. After asserting I found that rope contains unwanted contents and I didn't fix the problem during the contest. However, when I replace all `__gnu_cxx::rope.erase(x)` into `__gnu_cxx::rope.erase(x, 1)`, my code works fine (idk if it will pass system test or not; at least, it passes asserting that all elements are rolled back to the initial state). Then! I found it unbelievable to see the following code from [here](http://www.aoc.nrao.edu/php/tjuerges/ALMA/STL/html-4.1.2/rope-source.html#l02310): ![ ](/predownloaded/ad/58/ad5833f2cffab1ebc845091a0cefe4e25cb2533c.png) Look at the line 2318, comments: `Erase, single character`. However, it calls `erase(__p, __p + 1);`, who will erase `__p + 1` characters starting from the position `__p...
Incredible bug found in __gnu_cxx::rope, FUNCTION IN THE FUTURE) Thank you! **UPD**: I've submitted the [bug ](https://gcc.gnu.org/bugzilla, **UPD**: I've submitted the [bug ](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102048) to gcc.

Полный текст и комментарии »

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

57.
Автор qwexd, 4 года назад, По-английски
Codeforces Team To Do List # Feature Requests and Suggestions for Codeforces ***This blog lists common feature requests, suggestions, and bugs for Codeforces. Originally posted 3 years ago, this is a reformatted version with implementation status updates.*** ## ✅ Implemented Features - **Allow changing profile picture to the default profile picture.** ✅ - **Make comment replies collapsable.** ✅ - **Paginated comments sections.** *(so that blogs with a large amount of comments are actually scrollable on mobile)* ✅ - **Make upvotes and downvotes changable.** ✅ - **Add unrated registeration.** ✅ ## UI/UX Improvements - **Make official dark mode.** - **Make the folder icon in the catalog clickable so that we can collapse certain columns while searching.** - **In Fav. Blog Entries Option, blogs should be collapsed by default so that we can see multiple favorite blogs at one time otherwise it takes a lot of scrolling to see...

Полный текст и комментарии »

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

58.
Автор ecnerwala, история, 6 лет назад, По-английски
Deltix Round Spring 2021 bug - Uphacks counted as real systests It looks like some of Deltix Round Spring 2021 got rejudged to include uphacks, including causing my D to go from passing to failing, and also affecting the placing and rating. You can see in the [announcement](http://codeforces.me/blog/entry/90915) that I originally got 5th, but the [scoreboard](http://codeforces.me/contest/1523/standings) now shows 10th, and my submission [submission:117918101] shows an extra 10 tests beyond the 127 that other submissions have, like [submission:117881477]. It seems like this bug is several months old: [user:galen_colin,2021-06-01] posted about it at https://codeforces.me/blog/entry/88000, and [user:MikeMirzayanov,2021-06-01] didn't fix that contest and said he'd "try to avoid it in the future". This bug is totally unacceptable, it significantly affected results a full 2 days after the contest ended; imagine if it affected prize distribution. I have no idea when these hacks were added, but it's definitely not akin to in-contest hacking. [user...
Deltix Round Spring 2021 bug - Uphacks counted as real systests, It seems like this bug is several months old: [user:galen_colin,2021-06-01] posted about it at

Полный текст и комментарии »

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

59.
Автор errorgorn, 6 лет назад, По-английски
Codeforces Global Round 13 Editorial [problem:1491A] ------------------ Setter: [user:syksykCCC,2021-02-28] Prepared by: [user:syksykCCC,2021-02-28] <spoiler summary="Hint 1"> How can we find the largest $k$ such that the $k$-th smallest element of the array is $0$? </spoiler> <spoiler summary="Hint 2"> How can we maintain $k$? </spoiler> <spoiler summary="Solution"> Let's define $cnt$ to represent the number of 1s in the array. For the modifications, if $a_i$ is already $1$ now, then we let $cnt \gets cnt - 1$. Otherwise, let $cnt \gets cnt + 1$. For the querys, just compare $cnt$ with $k$. If $cnt \ge k$, the answer will be $1$. Otherwise, the answer will be $0$. The complexity : $O(n + q)$. </spoiler> <spoiler summary="Code (C++)"> ```c++ #include <bits/stdc++.h> using namespace std; const int N = 1e6 + 5; int n, q, a[N], cnt; int main() { scanf("%d%d",&n,&q); for(int i = 1; i <= n; ++i) { scanf("%d",a+i); cnt += a[i]; } while(q--) { int opt, x; ...
> //change less to less_equal for non distinct pbds, but erase will bug

Полный текст и комментарии »

Разбор задач Codeforces Global Round 13
  • Проголосовать: нравится
  • +255
  • Проголосовать: не нравится

60.
Автор awoo, история, 11 лет назад, По-русски
Creating Gravity Defied tracks using Codeforces rating graph Introduction ============ <img src="http://cs624422.vk.me/v624422694/36ac0/8jKq7pMzPOc.jpg" style="float: right;"></img> Hi everybody! Recently I have decided to refresh memories about good old times and play Gravity Defied on my phone. It wasn't really hard to find port of that legendary game from J2ME to modern platforms. It rapidly gained glory among students of past decade. Key points of Gravity Defied success were nice gameplay (biker completing different stages with high cliffs and deep pits), convinient physics (ability to rotate mid-air) and simplicity of modmaking. As for me, it was a bit more than usual game. When I had completed over thousand tracks, I began earning money on helping others to progress. Only later even more difficult games were developed: HOMM 3, Far Cry and Dark Souls... Predevel story ============ <img src="http://cs624422.vk.me/v624422694/370dd/wU1hi77t6U8.jpg" style="float: right;"></img> And now Gravity Defied is on my phone again! Not o...

Полный текст и комментарии »

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

61.
Автор I_love_Hoang_Yen, история, 11 лет назад, По-английски
My story at ACM ICPC World Final 2016 My team (me + [user:flashmt,2016-05-20] + [user:nguyenhungtam,2016-05-20]) was probably never noticed by anyone, but we were actually aiming for medal. And I think we performed ok in the final, ending up at #15, still need some more luck & brain to win a medal. Anw, I decided to share my story. Btw if you are Vietnamese, you can also read [this](https://www.facebook.com/notes/thanh-trung-nguyen/t%C3%B3m-t%E1%BA%AFt-acm-world-final-2016/1157851804228014?pnref=story). Back story ========== In the ACM history, a Vietnamese team has never won any WF medal. 5 years ago, team of [user:ktuan,2016-05-20] (only Vietnamese red target on Topcoder) had high hope, but ended up at #17. 4 years ago, team of [user:ConanKudo,2016-05-20] also had high hope, but messed up in the first 3 hours and ended up at #17. So I really wanted to win medal. And I've been planning for this World Final for several years.. Team formation ============== I've chosen [user:flashmt,2016-05-20] as teamm...

Полный текст и комментарии »

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

62.
Автор pseudocoder10, 6 лет назад, По-английски
Lockout Bot for codeforces Hello everyone, I'm sure many of you have been watching and enjoying the recent [lockout streams](https://www.youtube.com/watch?v=bBNIIg8REUU&feature=youtu.be) organized by [user:ecnerwala,2020-06-08] and [user:scott_wu,2020-06-08] and would be wanting to compete with your friends in a similar format. I have made a discord bot that does exactly the same. The source code for the bot can be found [here](https://github.com/pseudocoder10/Lockout-Bot). The bot gives a set of 5 problems with ratings from [x, x+400], where x is chosen by you and the point distribution is [100, 500]. The first person to solve a problem gets the points for it. The match ends when someone has >= 800 points or 45 minutes have been elapsed. The bot automatically updates the status when someone solves a problem but you can also do it manually. To invite the bot to your discord server, click [here](https://discord.com/oauth2/authorize?client_id=669978762120790045&permissions=0&scope=bot). If you don't wanna ...
**UPD:** If you want to report any bug or make suggestions, it will be better to comment in the

Полный текст и комментарии »

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

63.
Автор cyand1317, история, 9 лет назад, По-английски
Codeforces Round #431 Hi! I’d like to invite you to Codeforces Round #431 which takes place at [16:35 MSK on 1 September](https://www.timeanddate.com/worldclock/fixedtime.html?day=01&month=9&year=2017&hour=16&min=35&sec=0&p1=166). Please note that the timing is again unusual. One of the problems is created by [user:adedalic,2017-08-31] and [user:KAN,2017-08-31], while the others are authored by me. This is my second round here, and it couldn’t have been realized without efforts of: [user:AlexFetisov,2017-08-31], [user:ifsmirnov,2017-09-01], [user:Tommyr7,2017-08-31], [user:winger,2017-08-31] and [user:wu_qing,2017-09-01] who tested the problems; [user:KAN,2017-08-31] who appears to be a meticulous guide throughout the preparation process; and [user:MikeMirzayanov,2017-08-31] with the supercalifragilisticexpialidocious Codeforces and Polygon platforms — my deep gratitude to you! Both divisions are welcomed as **rated** contestants and will have **five problems** to solve in **two hours**. The scorin...

Полный текст и комментарии »

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

64.
Автор mnbvmar, 8 лет назад, По-английски
Codeforces Round #556 Editorial This is the preliminary version of editorial. Expect bugs. Some changes might happen! --- [1150A. Stock Arbitraging](https://codeforces.me/contest/1150/problem/A) <spoiler summary="Tutorial"> [tutorial:1150A] </spoiler> <spoiler summary="Code"> [53560020](https://codeforces.me/problemset/submission/1150/53560020) </spoiler> --- [1150B. Tiling Challenge](https://codeforces.me/contest/1150/problem/B) <spoiler summary="Tutorial"> [tutorial:1150B] </spoiler> <spoiler summary="Code"> [53560074](https://codeforces.me/problemset/submission/1150/53560074) </spoiler> --- [1150C](https://codeforces.me/contest/1150/problem/C) / [1149A. Prefix Sum Primes](https://codeforces.me/contest/1149/problem/A) <spoiler summary="Tutorial"> [tutorial:1150C] </spoiler> <spoiler summary="Code"> [53560113](https://codeforces.me/problemset/submission/1150/53560113) </spoiler> --- [1150D](https://codeforces.me/contest/1150/problem/D) / [1149B. Three Rel...

Полный текст и комментарии »

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

65.
Автор Errichto, 11 лет назад, По-английски
IndiaHacks Finals — rated CF round Hi everybody. The IndiaHacks finals will take place tomorrow (on Saturday). The contest is being organized by HackerEarth. Just after the official finals, the CF round will start ([check-your-time](http://timeanddate.com/worldclock/fixedtime.html?day=19&month=3&year=2016&hour=11&min=35&sec=0&p1=166)) with almost the same problems. <s>You can treat it as a standard CF round &mdash; there will be 5 problems in each of 2 divisions, and 2 hours to solve them.</s> Two divisions will compete together on the problem set with 7 problems, with 2 hours to solve them. I want to especially thank [user:I_love_Tanya_Romanova,2016-03-18] for testing the problems, [user:GlebsHP,2016-03-18] for help with making the CF round possible, and [user:MikeMirzayanov,2016-03-18] for his awesome attitude and for the Polygon system. Setters: [user:lewin,2016-03-18], [user:k790alex,2016-03-18], [user:Sokolov,2016-03-18], [user:Errichto,2016-03-18]. Testers: [user:I_love_Tanya_Romanova,2016-03-18], [use...

Полный текст и комментарии »

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

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

Полный текст и комментарии »

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

67.
Автор awoo, 4 года назад, перевод, По-русски
Codeforces Wrapped 2022 — Share your yearly statistics! Feliz Navidad, Codeforces! I'm a huge data nerd and an avid Codeforces user. I decided to combine these traits and make a service to provide everyone with some sort of their yearly statistics on this wonderful site in a neat form. My main goals were to make a report card that: - contains insighful statistics; - is not overloaded with information; - is easy to share. In persuit of that, I discarded multiple stats which were too boring, took too much space <s>or were hard to implement within the limitations of CF API</s>. I find the final choice of data really fun. I hope you like the result too! The service is pretty intuitive to use. Enter your handle (in case you changed it, enter the one you had throughout the year), get the report card and share it with the world by clicking "open as image". <spoiler summary="Disclaimer"> I'm not a professional web-designer, neither I'm at least an experienced one. Thanks to my friends from kbr discord server, I managed to fix ...

Полный текст и комментарии »

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

68.
Автор Rubanenko, 11 лет назад, перевод, По-русски
NBHEXT — Know Your Rating Few weeks ago there was yet another discussion about "omg why we wait for the rating updates so long!?!?!" in Russian version of CF. [user:MikeMirzayanov,2015-10-30] said that there are several reasons: 1. cheaters are checked manually; 2. rounds are usually held in the evening and Mike spends some time to get home from the University; 3. sometimes his little daughter asks him to play with her and Mike can't refuse of course After [user:meh,2015-10-30], [user:MaximM,2015-10-30] and me read the third reason, we started to think what can be done about it. After a little thinking we came up with a solution that seemed to make contestants and Mike's daughter happy. The solution was a creation of browser extension that maintains rating changes of a current scoreboard whenever you refresh the result page. Something like this: ![ ](http://s1.postimg.org/f3txyllb3/Screenshot_2015_10_30_19_09_19.png) Luckily, CodeForces provided us with all the tools to make it happen: an API a...

Полный текст и комментарии »

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

69.
Автор Gassa, история, 8 лет назад, По-русски
The D programming language in competitive programming Hi all! This post is inspired by a question [here](/blog/entry/51923?#comment-446901) which asks [user:yosupo,2018-07-28] how using the D progamming language compares to using C++. I regularly use D where possible in contests (and problemsetting) since 2014, with some success (for example, a program in D brought me victory in [AZsPCs: Alphabet City](http://azspcs.com/Contest/AlphabetCity/Standings)). So I'd like to share my experience. I'll try to focus on stuff which is important in competitive programming. The general feeling is as follows. You can write in D as in plain C when you need full control. You can also write more like in Python using the powerful standard library. However, D is a compiled language, so in both cases, the performance is similar to C++. Additionally, when the program is written, it is much easier to debug than a similar program in C++. For an example, let us look at two solutions of a [recent problem](/contest/1010/problem/A). [cut] ...
, there are a lot less bugs, but hitting another one is of course more probable than to find abug in

Полный текст и комментарии »

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

70.
Автор bicsi, история, 6 лет назад, По-английски
Personalized competitive programming ladders Hello Codeforces! For the past couple of years I have been developing a competitive programming platform that would aggregate solutions from different OJs. It was initially written for assigning tasks for my preparations (and some professors used it in our university for grading students in algorithmic courses). Recently I have been developing a "ladders" feature, because I wanted to train and realized that this would be the best way to do it. Now, I am excited to say that I have decided to "go public" with this feature and invite you to try it out. ### How it works Do the steps below: - Create an account at https://competitive.herokuapp.com - Add your handles to your profile (Codeforces/Atcoder/etc.) - Go to ladders and start solving problems - When you start a task, a 2-hour timer starts; you have to solve the task in this time limit - Tasks that are solved successfully are marked green, tasks that were unsolved are marked red - You can also see a leaderboard with...

Полный текст и комментарии »

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

71.
Автор adamant, история, 2 года назад, По-английски
CP-Algorithms: Hacktoberfest 2024 + call for contributors and maintainers Hi everyone! <img src="/predownloaded/82/15/821540e8f87d8a2b2d468377aacbba80b0aa1623.png" style="float:right;" width=100px> I'm posting this on behalf of **[CP-Algorithms](https://cp-algorithms.com/)**, a community project that [started off](https://codeforces.me/blog/entry/13198) in 2014 by [user:RodionGork,2024-10-13] as a translation of [e-maxx](http://e-maxx.ru/), a Russian go-to resource at the time by [user:e-maxx,2024-10-13] for learning core competitive programming algorithms. Since then, CP-Algorithms grew quite a lot (which also prompted a rename from original project name `e-maxx-eng`) and includes a lot of new, original articles, and a lot of translated articles were enhanced and/or extended or even completely rewritten, amounting to a total of 157 articles at the moment. At the moment, the project is largely maintained by [user:Jakube,2024-10-13] and [user:adamant,2024-10-13] (that's me), but as it happens, we don't have as much time to dedicate to it as we used...
- [GitHub issues](https://github.com/cp-algorithms/cp-algorithms/issues) marked with "bug" or

Полный текст и комментарии »

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

72.
Автор kostka, 8 лет назад, По-английски
Team dashboard Hey Codeforces! I made a thing and I want to share it with the community. We wanted to keep track of achievements and submissions in our team and using Codeforces status page is not really handy. Therefore, I introduce to you **Team dashboard**. ![ ](http://weaselcrow.com/pro/cf/team/example.png) Here you can find some kind of a timeline for each member of your team, showing last submissions, contests and even blog posts on Codeforces. Using this script is pretty easy, just specify up to 3 handles in the address, separated by semicolons (please check below). Also please keep in mind that this script was made in 3-4 hours, so there is almost certainly a handful of bugs. Also, the script asks a lot of queries to the Codeforces API, so sometimes not all requests are answered. You should wait a couple of seconds and try again. Visit right now and bookmark your team: http://weaselcrow.com/pro/cf/team/?h=Radewoosh;Errichto;kostka You can also compare yourself with you...
: fixed bug with blocked blogs. Upd3: you can now request as many days as you want, adding d, Upd2: fixed bug with blocked blogs.

Полный текст и комментарии »

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

73.
Автор dmkozyrev, 8 лет назад, По-русски
"The bug" — old brutal russian game for programmers On the Internet since 2004 there is a game ["Bug"](http://buglab.ru). This is in russian, but you can use the google translator for translate all page, or ask me if there is something that is not clear after translation. **Goal of game** &mdash; build a correct labyrinth 19 x 29 for bug. Result &mdash; number of bug's movements from start point to finish point. The results on the site are sorted by the amount of movement of the bug for the passage of the labyrinth. Algorithm of bug's movement: >>Bug always starts movement from the upper left corner, and the exit is always in the lower right corner. The bug is not moving optimally, but in the following way: he goes to where he was not yet, or was there less often. Passing every cell of the labyrinth, the beetle remembers: how many times he was in this cell and when thinking about the direction of his movement at some particular moment he looks: how many times he was in the cell from down side, how many from the right side, how man...
"The bug" — old brutal russian game for programmers, of the bug, and no algorithm for constructing the worst test was obtained., result of the bug's passing through its most difficult for bug labyrinth. I'm there, 5 th place with 10, **Goal of game** — build a correct labyrinth 19 x 29 for bug. Result — number of bug's, **UPD:** For speed up bug on the site for test your labyrinth you can open google chrome console on, >>Bug always starts movement from the upper left corner, and the exit is always in the lower right, On the Internet since 2004 there is a game ["Bug"](http://buglab.ru). This is in russian, but you, Those interested are invited to play the game "Bug", to generate labyrinths and research this

Полный текст и комментарии »

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

74.
Автор dmkozyrev, история, 4 года назад, перевод, По-русски
Invitation to Bug Game [marathon problem, mirror of buglab.ru] Hello Codeforces! **UPD.** [user:I_love_natalia,2023-04-18] crashed the checker by his maze with $10^9$ moves. The problem is resolved now and all of the solutions rejudged. Scoring is changed. [More info](https://codeforces.me/blog/entry/115144?#comment-1023668) **UPD 2:** The official site [https://buglab.ru/](https://buglab.ru/) was updated. See [comment](https://codeforces.me/blog/entry/115144?#comment-1024061). **UPD 3:** The checker has been speeded-up by [user:mfv,2023-05-01] in $2.2$ times (in comparison with my checker. The new speed is equal to $4$ seconds for a $10^9$ moves in codeforces "Custom Invocation"). Current standings: 1. $17\cdot 10^9$ &mdash; [user:sas4eka,2023-05-01]; 2. $14\cdot 10^9$ &mdash; [user:I_love_natalia,2023-05-01]; 3. $6.8 \cdot 10^9$ &mdash; [user:maxplus,2023-05-01] (on the buglab: $11.3 \cdot 10^9$). **UPD 4:** I updated the checker: now mazes up to $42$ billions are supported before checker got TL. Time limit of checker on codef...
Invitation to Bug Game [marathon problem, mirror of buglab.ru], faster? I'm happy to invite you to an unofficial mirror of [Bug Game](http://buglab.ru/). In this, **Official Russian site of Bug Game:** [click here](https://buglab.ru/), I'm happy to invite you to an unofficial mirror of [Bug Game](http://buglab.ru/). In this game you

Полный текст и комментарии »

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

75.
Автор mraron, история, 6 лет назад, По-английски
CEOI 2020 Online Mirror Hi Codeforces! The [27th Central-European Olympiad in Informatics](http://ceoi2020.inf.elte.hu/) takes place from 23-29 August in Nagykanizsa, Hungary. The mirror contests will be held on [contest_time:1402] and [contest_time:1403] (one day after each official contest day) here on Codeforces in the usual IOI format (it is _unrated_, the best scoring submission counts, scoreboard is not visible during the contest and there's full feedback throughout the whole contest). ![CEOI2020 logo](/predownloaded/7f/dd/7fdd51c47c48b966d43f95b5184fe54b76a487cc.png) In this year's CEOI, the 4 best problem solvers going to secondary schools of Austria, Croatia, Czech Republic, Germany, Hungary, Italy, Lithuania, Poland, Romania, Slovakia, Slovenia, Switzerland, and The Netherlands will compete. Due to the current situation, unfortunately not everyone will be able to make it onsite, but we hope the offsite participants will also enjoy the event, although without the magical week in Nagykanizsa....
Sorry for the issues with the queue and with the bug interactor of potion causing python solutions

Полный текст и комментарии »

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

76.
Автор phattd, 5 лет назад, По-английски
Introducing Arugo — A website that provides virtual rating while practicing on problemset Hello Codeforces users. Today I would like to introduce [Arugo](https://arugo.herokuapp.com/), which is a website that provides virtual rating while practicing on problemset. On this website, you can practice problems that are suggested through a suggestion system or by your custom choice. Each problem has a window of 80 minutes to solve and if you manage to solve it in time, please validate and you will earn virtual rating. However, if you gave up early or time runs out, you will lose rating eventually. Rating progress will be displayed at the homepage through a graph like in Codeforces and through it, you can visualize your progress and stay motivated to keep going. <spoiler summary="Rating progress preview"> ![Rating progress](/predownloaded/e2/88/e288e62832a048f2c01b55ec099b3e6c117a4d56.png) </spoiler> <spoiler summary="Challenge preview"> ![Challenge](/predownloaded/16/e1/16e1335d8a2b83093165ee629d45c2ea8ff65dd3.png) </spoiler> This site is inspired by my past t...

Полный текст и комментарии »

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

77.
Автор stevenkplus, история, 6 лет назад, По-английски
when you (think you) fix your bug exactly 1 second after the contest ends... (EDIT: I no longer require pity because it turns out my solution was much more wrong than I thought, and my "fixed" solution would've failed too) I had a 1 character bug on https://codeforces.me/contest/1396/problem/E in contest, and was just a tiny bit too slow to fix it. So now I'm sharing my story in hopes of collecting pity and contribution. See if you can find the bug faster than I did :) The submission I made: (timestamp 1:56:00) https://codeforces.me/contest/1396/my I found the fix & saved it at 2:00:01... ~~~~~ ~/codeforces/666div1 ls -lT e.cpp -rw-r--r-- 1 stevenhao staff 4107 Aug 30 09:35:01 2020 e.cpp ~~~~~ Here is the code, before the fix: ~~~~~ // ============= Solution ============= // int main() { int n; ll k; cin >> n >> k; vector<vector<int>> ed(n + 1); for (int i = 0; i < n - 1; ++i) { int a, b; cin >> a >> b; --a, --b; ed[a].push_back(b); ed[b].push_back(a); } vector<int> s...
when you (think you) fix your bug exactly 1 second after the contest ends..., I forget to check if k is too small. Fix can be applied, I forget to check that, , and my "fixed" solution would've failed too) I had a 1 character bug on https://codeforces.com, I had a 1 character bug on https://codeforces.me/contest/1396/problem/E in contest, and was just a

Полный текст и комментарии »

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

78.
Автор AmShZ, 3 недели назад, По-английски
Repovive SWE Round 1: Vive Market ($750 in Prizes!) Hello everyone! Have you ever wondered what a competitive programming contest for **real-world software engineering** would look like? Instead of writing code from scratch, imagine being given an existing project full of bugs, with the clock ticking and a live leaderboard showing everyone's progress. That's what we're building at Repovive! We're excited to announce **Repovive SWE Round 1: Vive Market**, a live debugging contest where your goal is to find and fix bugs in Python projects. You'll also have an **AI agent** working alongside you. The interesting part is that the agent knows what the software is supposed to do, but hasn't seen the actual implementation. More on that below! * Start Time: [Saturday, 14 November 2026, 14:35 (UTC)](https://www.timeanddate.com/worldclock/fixedtime.html?iso=20261114T1435&p1=1440&msg=Repovive+SWE+Round+1) * Duration: $3$ hours * Problems: $4$ Python projects * Registration: https://repovive.com/contests/swe1 * Rules: https://r...
* Each bug you fix earns you points. When you submit, every bug is checked using its own public and

Полный текст и комментарии »

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

79.
Автор Balajiganapathi, история, 10 лет назад, По-английски
Codeforces problem recommender Hi all, While practicing I always have difficulty choosing which problems to solve next. So, I coded a site to look at the user's submissions so far and recommend what all problems to solve next. Since the ICPC season is at peak now, it can also analyze multiple users and recommend practice problem for the whole team. View the site here: [Code drills](http://code-drills.com). So far, it only supports cf (EDIT: Now also supports codechef and spoj). I plan to add support for other sites later. Besides recommending, it will also show some statistics of your submissions so far. If you scroll down after entering your handle, you can view the practice recommendation. I will explain some of them here: **ICPC**: Best to use this with team i.e. enter all your teammates' handles too. It will try to select problems from different topics. This and all other recommendations are based on your past submissions. So, the difficulty of the set will vary according to your past submissions (i...

Полный текст и комментарии »

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

80.
Автор AksLolCoding, история, 14 месяцев назад, По-английски
Essential Tips for AI in Competitive Programming With the rise of AI in competitive programming, this blog aims to assist AI with essential tips to make it's submissions valid and acceptable on programming sites such as Codeforces. Following these is also essential for AI to blend in with human participants. This blog does NOT attempt to sabotage AI in any way. Feel free post more essential AI programming tips in the comments. 1. Use long variable names. Because AI can code extremely fast, these long variable names save time in the long term since they make code easier to adjust and debug. 2. Comment code thoroughly with long detailed and grammatically correct sentences. This makes code cleaner to read and more humanoid. Even if it doesn't seem necessary, such as after `i++`, it is still important to comment this code. 3. Always check if input variables such as `n` are positive. Many problems will have edge case tests where input variables are negative, even if the constraints say they are greater than or equal to $0$. This is n...

Полный текст и комментарии »

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

81.
Автор kpw29, 5 лет назад, По-английски
[ICPC blog series #0] My last ACM experience Disclaimer ================== This isn't really a first tutorial in the series. If you are interested in reading what participating in ICPC World Finals feels like, you can enjoy my <s>pathetic</s> behind-the-scenes story of the Cambridge silver-medal performance in WF2020. I tried to write a spoiler--free blog so that it contains minimum information about the problems. Motivation ================== In 2016 I have written a blogpost [My first ACM experience](https://codeforces.me/blog/entry/48082). It made sense to me to also close some chapter of the book by writing up about how my last serious contest went. I advise not to take the blog too seriously, it is just an honest stream of consciousness (some facts may not even be 100% accurate, though I will fix things people point me). Feel free to comment, praise, <s>or hate</s>. For a different perspective, check out [user:IBaloff,2021-10-07]'s [blog](https://codeforces.cc/blog/entry/95526). The hero and heroine of the story o...
a bug. She forgot some corner case in her solution. This definitely shouldn't have been the first, In the meantime, David got an accept on C after realizing that our library actually had abug in

Полный текст и комментарии »

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

82.
Автор djm03178, 2 года назад, По-английски
Blowing up unordered_map 2024 edition It is already well-known that using `unordered` series in Codeforces is super dangerous, and it is not recommended to use them at all unless you know how to prevent them properly (well, even if you know, just using a regular `map` or `set` is more beneficial in most cases). Thanks to [Blowing up unordered_map, and how to stop getting hacked on it](https://codeforces.me/blog/entry/62393), it is easy to access to the basics of hacking these hash-based structures. In this blog, I'm going to get into more details on how it works, and the ideas to hack them with various constraints on the variables. The basics ------------------ As mentioned in the linked blog, gcc implements its hash table simply by modding the key with certain primes, and these primes vary between different versions of gcc. So, basically the easiest way to make a hack case is to put numerous distinct multiples of these primes. However, an important thing to note is that it's a _list_ of primes instead of just one pr...
constructing a new object, i.e. `st = unordered_set();`. I wonder why they haven't fixed thisbug till, Another attack: the `clear()` bug ------------------ There has been a long-livingbug in gcc's

Полный текст и комментарии »

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

83.
Автор sevlll777, 22 месяца назад, По-английски
Codeforces Round 1004 (Div. 1, Div. 2) Hello again, Codeforces! I am glad to invite you to [contest:2066], [contest:2067], at [contest_time:2066]. In Division 1 you will be offered $6$ problems. In Division 2 you will be offered $7$ problems. One of the problems in Div.1 will be divided into 2 subtasks. Round duration is set to be **2 hours**. Also, both divisions contain _at least one_ interactive problem(s), so be prepared for those! [Guide for interactive problems](https://codeforces.me/blog/entry/45307) I would like to thank, - [user:FairyWinx,2025-02-09] for dedicated coordination, a lot of problemset discussion, and suggesting one of the problems idea. - Our testers: [user:Dart-Xeyter,2025-02-09], [user:I_love_kirill22,2025-02-09], [user:RP-1,2025-02-09], [user:larush,2025-02-09], [user:Wansur,2025-02-09], [user:furt1ve,2025-02-09], [user:Iura_Shch,2025-02-09], [user:SomethingNew,2025-02-09], [user:Gabbasov,2025-02-09], [user:glllll,2025-02-09], [user:domovonok,2025-02-09], [user:Error_Yuan,2025-02...
**UPD2:** We sincerely regret to inform you that we have discovered a bug in the interactor. A

Полный текст и комментарии »

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

84.
Автор Ashishgup, 5 лет назад, По-английски
India ICPC — Amritapuri 2020 Preliminary Round Hi Codeforces, **ICPC Amritapuri 2020 Preliminary Round** will be held on [Codedrills](https://codedrills.io/contests/icpc-amritapuri-2020-preliminary-round) today. ![ ](https://storage.googleapis.com/cdcontent/images/Amrita%20Banner.png) **Contest Details** * Contest Link — [ICPC Amritapuri 2020 Preliminary Round](https://codedrills.io/contests/icpc-amritapuri-2020-preliminary-round) * Date & Time — [7 August 2021, Saturday, 18:00 IST](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Amritapuri+Online+Round&iso=20210807T18&p1=438&ah=2&am=30) * Duration — **2.5 Hours** * There will be **6** problems to solve * Will follow standard ICPC scoring system (20 minutes penalty and 1 point per problem) * The questions may not be sorted by difficulty **Selection Criteria** * 700 slots are available for the regional (out of ~4400 teams registered for online round) * Top team from each institution is selected first, to compete in the regional round * Rest of the...
**Edit:** Due to the bug in the code editor during the contest, all penalties on duplicate

Полный текст и комментарии »

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

85.
Автор PrinceOfPersia, 12 лет назад, По-английски
Valentine Algorithm cUp 2015 Are you in love with algorithms? If you are don't miss this round and be algorithm's valentine ;) ![ ](http://assets.codeforces.com/images/girl-and-laptop.jpg) On the night before valentine's day ([exact time](http://www.timeanddate.com/worldclock/fixedtime.html?day=13&month=2&year=2015&hour=18&min=30&sec=0&p1=166)), Valentine Algorithm cUp 2015 is going to take place. There will be 6 problems and 3 hours to solve them. All of them are written by me([user:PrinceOfPersia,2015-02-05]). This competition is like surprise languages but too different. 3 days before the contest, I will publish tutorial of 5 new algorithm languages(not programming languages) with their compiler codes. Each language is going to be really simple to learn and have at most 6 or 7 commands (they're not like programming languages). Your program should print the code written in the language the problem says and checker will run it (pay attention that inputs are encoded, don't try to read form input, j...
**UPD3:** IDXT's compiler had some bug, you can download the correct source [here](http

Полный текст и комментарии »

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

86.
Автор cyand1317, история, 9 лет назад, По-английски
Codeforces Round #418 (Div. 2) _**418 I'm a teapot**_ Hi everyone! >///< I'd like to invite you to Codeforces Round #418 which begins at [15:05 MSK on 7 June](https://www.timeanddate.com/worldclock/fixedtime.html?day=07&month=6&year=2017&hour=15&min=5&sec=0&p1=166). Please note that the timing is unusual. This is my first round here! [user:KAN,2017-06-06] reviewed the contest and helped me through the preparation process, while [user:Alladdin,2017-06-06], [user:neckbosov,2017-06-06] and [user:Tommyr7,2017-06-06] tested all the problems, and [user:MikeMirzayanov,2017-06-06] and the awesome Codeforces and Polygon platforms made all this happen miraculously. This wouldn't have been possible without your efforts! The round is **rated** for the second division, and participants from the first division can take part out of competition. As usual, there are five problems and two hours to solve them. The problems will feature... Well, let's wait and see :) The scoring distribution will be announced later. H...

Полный текст и комментарии »

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

87.
Автор Jakube, 8 лет назад, По-английски
e-maxx-eng/cp-algorithms update + free shirts from Hacktoberfest 2018 I hope most of you know your project [**e-maxx-eng**](https://cp-algorithms.com/). If you heard about it the first time: there is this really awesome Russian website ([link](http://e-maxx.ru/algo/)) about algorithms used in competitive programming by [user:e-maxx,2018-10-02]. **e-maxx-eng** is a community project that translates the material, so that competitive coder from all around the world can read and learn from the incredible useful and detailed source. Currently we have a pretty good and huge number of articles about algorithms, data structure, their implementation, lots of applications and general useful tips. Here's a quick updates on what we achieved in the last year: * There are translations available to over 100 articles (about 71% of all articles). Last year it was only about 45%. * We published a couple of original articles (e.g. about the [Sqrt Tree](https://cp-algorithms.com/data_structures/sqrt-tree.html), [Convex hull trick and Li Chao tree](https://cp-algorith...

Полный текст и комментарии »

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

88.
Автор riadwaw, 12 лет назад, перевод, По-русски
JHelper 0.18 Hi, Codeforces. [Changelog](https://github.com/AlexeyDmitriev/JHelper/wiki/Changelog): * 0.18 * CopyAction now regenerates output file * 0.17 * Support for inline inlining for topcoder * 0.16.4 * Support for WSL * 0.16.3 * Support CLion 2020.1 * 0.16.2 * Support CLion 2019.1 * 0.16 * Auto switching to a file when changing task * Auto selecting task when changing a file JHelper is plugin for writing contests in C++. You may inline code from your own prewritten library so that you can submit only used code. Besides, it allows to test on tests you've added. it's planned that you'll be able to parse a problem/contest and have all samples tests automatically added. It's available for [CLion](https://www.jetbrains.com/clion/) Plugin is completely free. IDE price is 89$/year, but it's free for students, have 30-days free trial and often you can use EAP(smth like beta)-versions for free. You may download the plugin using JetBrains p...
Please post bugs and feature requests here or in [bug tracker](https://github.com/AlexeyDmitriev

Полный текст и комментарии »

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

89.
Автор ToxicPie9, 23 месяца назад, По-английски
It's almost 2025, why are you still choosing GCC 7 (32-bit)? This is my answer to https://codeforces.me/blog/entry/137484, in which [user:-is-this-fft-,2024-12-20] asked a bizarre question. This answer is too big for a comment so I made a blog post instead. ## The question The submission [submission:297353626] behaves normally with 180 MiB memory usage while [submission:297352244] got a runtime error due to stack overflow (with 256 MiB stack). Both submissions have identical code, don't seem to contain bugs, and an assertion exists to make sure the recursion is at most $2\times10^5$ layers deep. What's happening? ## TL;DR Notice that the solution with stack overflow uses GCC 7 (32-bit) while the accepted ones use GCC 13 (64-bit). This is not a coincidence. The main reason of unreasonable stack usage boils down to two points: GCC 7, and 32-bit. ## 32-bit First of all, the code is compiled and run in 32-bit mode. Compiling the submission with GCC 7.5 in 32-bit on [godbolt](https://godbolt.org/z/WT9WsdeW4) shows that the `lo...

Полный текст и комментарии »

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

90.
Автор maomao90, 5 лет назад, По-английски
Global Round 20 Editorial Hope that everyone enjoyed the round. Feel free to ask questions in the comments if you do not understand any part of the editorial [problem:1672A] Author: [user:errorgorn,2022-04-23] <spoiler summary="Hints"> <spoiler summary="Hint 1"> No matter what move each player does, the result of the game will **always** be the same. </spoiler> <spoiler summary="Hint 2"> Count the number of moves. </spoiler> </spoiler> <spoiler summary="Tutorial"> Let us consider the ending state of the game. It turns out that at the ending state, we will only have logs of $1$ meter. Otherwise, players can make a move. Now, at the ending state of the game, we will have $\sum\limits_{k=1}^n a_k$ logs. And each move we increase the number of logs by exactly $1$. Since we started with $n$ logs, there has been exactly $(\sum\limits_{k=1}^n a_k) - n$ turns. Alternatively, a log of length $a_k$ will be cut $a_k-1$ times, so there will be $\sum\limits_{k=1}^n (a_k-1)$ turns. If the...
> //change less to less_equal for non distinct pbds, but erase will bug

Полный текст и комментарии »

Разбор задач Codeforces Global Round 20
  • Проголосовать: нравится
  • +135
  • Проголосовать: не нравится

91.
Автор tmwilliamlin168, история, 6 лет назад, По-английски
My CP Course "Zero to Hero" is now open for pre-registration! Having had a ton of experience with CP, I have decided that I could share my knowledge the best with the world by making a course! This course currently has lessons designed for people of many levels, from newbies to low masters. Currently, I have opened pre-registration. I'm currently just trying to get an idea of how many people would be interested in such a course (and also to catch possible bugs on the website). Here is the course website: http://course.williamlin.io/ 100 lucky winners who pre-register will be given beta access to the course for free! Pre-registration won't be open for long though, so be sure to do it quick! **Update:** Thanks to every who pre-registered! The pre-registration assessment proved to be tough, and we decided to offer spots for beta access even for those who did not pass the test! Look out for an email from [email protected] for your decision letter, as well as solutions and more opportunities to gain beta access to the course! **Up...

Полный текст и комментарии »

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

92.
Автор jinlifu1999, 9 лет назад, По-английски
Codeforces Round #460 (Div. 2) Hello, Codeforces! It's my honor to invite you to Codeforces Round #460 (Div. 2), which takes place at [13:05 UTC, January 31st](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Codeforces+Round+%23460+%28Div.+2%29&iso=20180131T2105&p1=33&ah=2). The round will be **rated** for all division 2 participants. Also we warmly welcome those division 1 participants to join us out of competition. Note that round starts in the unusual time! :) ![ ](http://img.uoj.ac/utility/bear-thinking.gif) This round is prepared by me and my friend [user:wuminyan0607,2018-02-04]. Many thanks to my friend for helping me testing the round and generating testcases. Besides, many thanks to the Codeforces coordinator [user:KAN,2018-01-29] for giving me a chance to hold this round, testers [user:cdkrot,2018-01-29], [user:cyand1317,2018-01-29], [user:demon1999,2018-01-31], [user:glebodin,2018-01-29], [user:gritukan,2018-01-31], [user:neckbosov,2018-01-29] for testing this round and [user:MikeMirzay...

Полный текст и комментарии »

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

93.
Автор HosseinYousefi, история, 8 лет назад, По-английски
Competitive C++ Manifesto: A Style Guide # Competitive C++ Manifesto: A Style Guide There are many style guides for C++ out there, but we can't really use them as competitive programmers. We just want to write our code correctly as fast as possible! Trying to hack people here on codeforces, I realized there is a need for a style guide! Our goal is to write correct, fast, clear and consistent code. > #### Disclaimer > This is not a rulebook. You can integrate parts of it into your coding style. > Don't overthink it, especially during a contest! I'm going to use this guide for myself and to [teach my students](https://in.harbour.space/computer-science/modern-c-programming-hossein-yousefi/). I'm planning to make some good stuff in the future following these principles! Stay tuned! ## Compiler Make use of C++17. Use `-Wall -Wextra -Wshadow` flags for compilation, and try to eliminate all of the warning messages, this will prevent you from having some silly bugs. There are more debugging flags like `-fsanitize=un...
you to comment out a chunk of code with `/* */` while debugging, and `/* /* ... */ */` is abug!

Полный текст и комментарии »

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

94.
Автор Um_nik, история, 9 лет назад, По-русски
Randomized solutions vs Hacks I think that most of us know about situation with problem [problem:843B]. The intended solution (and it looks like all possible solutions) was randomized and it generates huge amount of hacks based on fixed randseeds. I want to mention that I'm not against good randomized problems and I even set one myself. But for me it seems that hacks can ruin such type of problems. The only thing author's solution is better than contestant's is that it is invisible during the competition. I can even imagine that some tester's solutions (maybe not the solution which is used to generate judge answers) was broken by some hacks. I think that it breaks the problem as art piece and breaks the contest format too. You solved the problem just like authors wanted and now... it depends on is there a hacker in your room. It also breaks the idea of hacking. There is no bug in my solution, why should I be hacked? And why should the guy get 100 points for hacking me? He didn't crack my solution, he abuse...
problems with multitests which allow to hack with only one test in multitest. There can be abug in, And for me it looks like authors didn't think about that bug/feature and now they try to protect

Полный текст и комментарии »

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

95.
Автор MikeMirzayanov, 15 лет назад, По-русски
Codeforces::Gym <p> We've made it! Or in any case, we are at least very close to it. </p> <p> On January 19, 2012 at 12:00 we open a sub-project called &quot;Gym&quot;. In short, its goal is to enable the Codeforces coders not only to participate in competitions and discuss them, but also to train and coach easily. </p> <p> In fact, despite the wide diversity of online judges in the world, a well thought-out training service system does not exist. So, the expectations from this system are: </p> <ol> <li>Collection of online contests, composed mainly of the past official contests. </li><li> Opportunity to integrate the final standings of past contests in the online contests to be able to train &quot;against&quot; the official participants. </li><li> Opportunity to participate in the training at any time whatsoever, without fear that something breaks down and the server will fall. In short, reliability. </li><li> Opportunity to write virtual contests and to solve the problems in a practice mode. </li...

Полный текст и комментарии »

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

96.
Автор oolimry, история, 6 лет назад, По-английски
Codeforces Raif Round 1 Editorial [problem:1428A] ------------------ Setter: [user:bensonlzl,2020-10-17] Prepared by: [user:errorgorn,2020-10-17] <spoiler summary="Hint 1"> Consider when $x_1=x_2$ </spoiler> <spoiler summary="Hint 2"> Consider when $x_1 \ne x_2$ </spoiler> <spoiler summary="Solution"> We consider 2 cases. The first is that the starting and ending point lie on an axis-aligned line. In this case, we simply pull the box in 1 direction, and the time needed is the distance between the 2 points as we need 1 second to decrease the distance by 1. The second is that they do not lie on any axis-aligned line. Wabbit can pull the box horizontally (left or right depends on the relative values of $x_1$ and $x_2$) for $|x_1-x_2|$ seconds, take 2 seconds to move either above or below the box, then take another $|y_1-y_2|$ seconds to move the box to $(x_2,y_2)$. </spoiler> <spoiler summary="Code (C++)"> ```c++ #include <bits/stdc++.h> using namespace std; int main(){ ios_base::...
> //change less to less_equal for non distinct pbds, but erase will bug

Полный текст и комментарии »

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

97.
Автор MikeMirzayanov, история, 11 лет назад, По-русски
User Lists Hello, We are launching new feature on Codeforces, in early beta mode. I hope it will be useful to many active users of the web-site. Now you can create, manage and use the "user lists". ![Menu](http://codeforces.me/predownloaded/90/70/9070387bafaea763209171cc550792d8da66f224.png) Partially, it is a kind of generalization of "friends." You can create a list of users interesting to you (you can create many lists) and, using the list, filter the results of rounds, quickly analyze what problems are solved in the problemset, etc. This feature is a helpful tool for coaching &mdash; I'm using it. By combining in a list of all practicing students, it is easy to pick up problems that have not been solved (and even not attempted) by any student. A user list has name and a pair of two relatively secret keys & mdash; one for view/usage and one for editing. For example, here is the key to view a list of ACM-ICPC students at Saratov State U for autumn of 2015: 15c68c2cf878267d59373d1...
will return to development and bug fixing after ACM-ICPC Regional Contest NEERC 2015.

Полный текст и комментарии »

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

98.
Автор Wxssim, 2 года назад, По-английски
From 0 to ICPC in 1 Year **Welcome to my first blog!!** <br> &nbsp;&nbsp;&nbsp;&nbsp; I'll be sharing my journey in the cp world and how I managed to qualify to ICPC 1 year and 3 months (sorry for the clickbait) into my cp career. If you're curious what it took to achieve this, or if you're looking for some motivation or inspiration, this blog is for you :) <br> A special thank you to [user:alnq417,2024-12-12] for helping me cook this blog <3 <br><br> ### _Starting My CP Career:_ _LCPC 2023 Fail_ &nbsp;&nbsp;&nbsp;&nbsp; One month before LCPC 2023 (Lebanese Collegiate Programming Contest), my university informed me about the competition. I was a second year student at that time so I quickly formed a team and registered, not knowing anything about the competition at all. I had high hopes, thinking it would be something similar to what I was studying at university and I assumed I'd do well. <br><br> &nbsp;&nbsp;&nbsp;&nbsp; Fast forward a month, I solved the easiest 4 problems in the competition and r...

Полный текст и комментарии »

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

99.
Автор Wandoka, 2 года назад, По-английски
Catching bugs using C++ on Windows NOT in Visual Studio I am on Windows, I don't want to use WSL or Visual Studio. I want the compiler to tell me about stupid bugs. But I cannot figure out a way to do it. The problem: I cannot figure out a way to catch both of the bugs below: ~~~~~ #include<iostream> #include<vector> #include<set> using namespace std; int main() { //case 1 vector<int> V(5); cout << V[10] << endl; //case 2 set<int> Set; cout << *Set.begin(); } ~~~~~ Using clang ------------------ Clang allows me to use sanitizers on windows. I was not able to find a way to make them work in mingw. Here are my flags: <spoiler summary="clang flags"> `clang++ -g -O0 -std=c++17 -Wall -Wno-sign-compare -Wno-unused-const-variable -Wno-logical-op-parentheses -Wno-keyword-macro -Wfloat-equal -Wshadow -Wno-conversion -Wno-sign-conversion -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=undefined,address,float-divide-by-zero,float-cast-overflow` </spoiler> I can successfully catch...
But I get no errors when I have the case2 bug.

Полный текст и комментарии »

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

100.
Автор hocln, история, 15 месяцев назад, По-английски
Welcome to Bingo-CP Hello Codeforces! Are you tired of only doing virtual contests? Want a more fun way to compete with friends, alone or on a team? Try Bingo-CP. ### What is Bingo-CP? Bingo-CP is a free web app that turns Codeforces practice into a quick social game. Problems are placed on an n×n bingo board. Teams of 1–4 players compete at the same time. The first team to complete any row, column, or diagonal wins. Try it: https://bingo-cp.vercel.app/home ### How to play **1.** Click "Create Match" as in the picture. **2.** Choose grid size (3×3 to 6×6), start time, duration, rating range, and mode. **3.** Add team members by Codeforces handle (1–4 each). **4.** Start the match. All teams solve at once. The first accepted submission claims the square for the team. **5.** First team to complete a row, column, or diagonal wins. Solves are detected automatically from Codeforces submissions, so no one needs to claim squares manually. ### Match options Start time and du...

Полный текст и комментарии »

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

101.
Автор BledDest, 7 месяцев назад, По-английски
Issue with checker in ER189E Unfortunately, I have found out that the checker for problem E of Codeforces Educational Round 189 did not correctly verify the case when a circle does not cover any points. I am very sorry for this issue &mdash; I was not the person writing that checker, but proofreading it and fixing all of the bugs is my responsibility as the coordinator of the round, and I failed. After discussing the issue with authors and analyzing the submissions, I have decided that dropping the constraint from the statement altogether, without any changes to verdicts during the round is the best course of action: **the amount of changes in the scoreboard, compared to the situation if checker were working correctly, is negligible (perhaps even zero)**. <spoiler summary="My reasoning for this"> There are two categories of people which might get affected by this decision: - people who have got Accepted without satisfying this condition. I believe (and this is corroborated by 10 random solutions I checke...
decision I've made ensures that the minimum possible number of people are affected by thisbug in checker.

Полный текст и комментарии »

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

102.
Автор Nanako, 4 года назад, По-английски
Good Bye 2022 -- Editorial ## [problem:1770A] Idea by [user:m_99,2022-12-30] <spoiler summary="Hint 1"> Exactly $n$ items out of of $a_1,\ldots,a_n,b_1,\ldots,b_m$ will remain on the whiteboard at the end. </spoiler> <spoiler summary="Hint 2"> $b_m$ will always remain on the board at the end. </spoiler> <spoiler summary="Hint 3"> Consider the case where $n=2$ and $m=2$. As we mentioned in hint 2, $b_2$ will always be written, but what about $b_1$? </spoiler> </details> <spoiler summary="Solution"> This problem can be solved naturally with a greedy algorithm &mdash; for $i = 1, 2, \dots, m$, we use $b_i$ to replace the minimal value among the current $a_1, a_2, \dots, a_n$. The time complexity is $O(nm)$ for each test case. Alternatively, we can first add $b_m$ to our final sum. For the remaining $(n+m-1)$ integers, we can freely pick $(n - 1)$ out of them and add it to our final sum. This is because if we want a certain $a_i$ to remain on the board at the end, we simply do not touch i...
> //change less to less_equal for non distinct pbds, but erase will bug

Полный текст и комментарии »

Разбор задач Good Bye 2022: 2023 is NEAR
  • Проголосовать: нравится
  • +243
  • Проголосовать: не нравится

103.
Автор prophet_, история, 6 лет назад, По-английски
Critical Bug in Codeforces: Broken AES encryption results in 403 Forbidden Error. (Solution) After investigating an issue resulting in a 403 error when trying to access codeforces as described in this blog: https://codeforces.me/blog/entry/80065 I believe I have found the issue and the solution. Codeforces uses a "slow aes" decryption function to require users to perform a non-trivial amount of computational work before they can access the site, presumably to protect against malicious users spamming the server. A parameter is given based on the user's IP address and the user must decrypt using this to generate a RCPC token in order to access the site. Those experiencing the 403 error likely are victims of a bug that causes the last 2 characters (last byte in binary) to be deleted. You can confirm this by checking your RCPC token in your cookies. This token should be 32 characters, but is only 30 if you experience this bug. The aes javascript implementation is from here: https://codeforces.me/aes.min.js I believe the issue is with the function "unpadBytesOut"....
Critical Bug in Codeforces: Broken AES encryption results in 403 Forbidden Error. (Solution), Those experiencing the 403 error likely are victims of a bug that causes the last 2 characters

Полный текст и комментарии »

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

104.
Автор OtterZ, история, 2 года назад, По-английски
Some bugs and features looks weird but really exists There are some bugs and features exists while compiling a c++ code,it looks weird but really exists on standard c++ compiler.I'll write down the bugs and features here to remind you to aware of them. # 1.stl::vector:fail to use operator "=". I was trying to implent the merge function of segment tree while solving [the task](https://codeforces.me/contest/1037/problem/H),and the initial code is <spoiler summary="here"> ``` int mrg(int x,int y,int l,int r){ if(x == -1 || y == -1) return x + y + 1; int u = sum.size(); sum.push_back(sum[x] + sum[y]); lc.push_back(-1); rc.push_back(-1); if(l == r) return u; int m = (l + r) >> 1; lc[u] = mrg(lc[x],lc[y],l,m); rc[u] = mrg(rc[x],rc[y],m + 1,r); return u; } ``` ... </spoiler> and found that it will get WA on test #6 using the language `C++14(GCC 6-32)`.Then I found out that the <spoiler summary="code"> ``` lc[u] = mrg(lc[x],lc[y],l,m); rc[u] = mrg(rc[x],rc[y],m + 1,r); ``` ... </spoile...
()` and the same as `rc[u]`,so the operator "=" might not work. The bug have been fixed since `C++17, The bug have been fixed since `C++17(GCC 7-32)`,but if you compile your code using language `C

Полный текст и комментарии »

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

105.
Автор adamant, история, 3 года назад, По-английски
Implementing Dinitz on bipartite graphs Hi everyone! if you read about [Dinic algorithm](https://cp-algorithms.com/graph/dinic.html) on CP-Algorithms, especially the [section](https://cp-algorithms.com/graph/dinic.html#unit-networks) about how it works on unit networks, you'll notice that its supposed runtime for bipartite matching is $O(E \sqrt V)$, where $E$ is the total number of edges, and $V$ is the total number of vertices of a bipartite graph. Let's try it out on the following problem: **[Library Checker &mdash; matching on Bipartite Graph](https://judge.yosupo.jp/problem/bipartitematching)**. Given a bipartite graph with $V, E \leq 2 \cdot 10^5$, find the maximum matching. The implementation of the Dinitz algorithm that I typically use looks as follows: <spoiler summary="code"> ```cpp struct unit_network { int n; vector<int> to, cap; vector<vector<int>> g; unit_network(int n): n(n), g(n) {} void add_edge(int a, int b, int cp) { g[a].push_back(size(to)); ...
Of course, there can simply be a bug in my Dinitz algorithm implementation, but after some checks

Полный текст и комментарии »

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

106.
Автор flamestorm, 5 лет назад, По-английски
EZ Programming Contest #1 Announcement ### Hello, Codeforces! I would like to invite you all to my first contest, [contest:103150]. It will be held on [contest_time:103150]. The round is not rated for anybody, since it is an unofficial contest. The contest has $n$ problems, where $n$ is an integer satisfying $7 \leq n \leq 11$. You will have 2 hours and 30 minutes to solve the problems. The problems are meant to be **about Div. 2 A, B, and C level**, and they will _not_ be sorted in order of difficulty. So, you can think of the problemset like if ICPC only went up to Div. 2 C. A huge thanks to my testers [user:wabadabakalakaboo,2021-06-19], [user:manish.17,2021-06-19], and [user:fishy15,2021-06-19]! I know you all are filled with questions, so I'll try to answer them all now. - Q: _Is it rated?_ - A: No. - Q: _Why did you write this contest?_ - A: I have a lot of ideas for easy Div. 2 A, B, and C level problems, not all of which can get into a contest. I thought it would be fun to compile them all into...

Полный текст и комментарии »

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

107.
Автор Qwerty1232, 19 месяцев назад, По-английски
Making NTT convolution 10x faster with avx2 > Text is also available on [github pages](https://piskareviv.github.io/blog_aux_ntt_1/) (formatting may look a bit cleaner there) > Thanks [user:alexxela12345,2025-05-05] for reviewing this blog Hello everyone! I want to share some of my thoughts and experiments on vectorizing NTT. I prefer NTT to real-valued FFT because of the imprecision of the latter. I use `avx2` because it is the most advanced vector extension supported by the majority of modern online judges (including Codeforces), as of 2024. And I have no idea how many bugs (already found two) and how much UB my code contains, at least it passes some kind of tests. ### Benchmark info All the benchmarks are performed on my `Ubuntu 22` `Intel i5-1135g7` laptop. I execute `cpupower frequency-set -d 3.0ghz -u 3.0ghz` before benchmarks to (attempt to) fix CPU frequency for better accuracy. Code is available at [github](https://github.com/piskareviv/blog_aux_ntt_1). You can try running all the benchmarks o...
number of `shrink`s (though we should be careful about it, it's very easy to place abug while

Полный текст и комментарии »

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

108.
Автор PurpleThinker, 6 лет назад, По-английски
How LEGENDARY programmers solve the A + B problem Hello, Codeforces! For many of us, the A + B problem was the first one we've solved and we think of it as just a really easy problem. But what if I told you there is a way to flex your programming skills by solving this problem _with style_? On this wonderful day of March 32nd, I will present a few ways to solve this interesting problem. I will only consider `a` and `b` strictly larger than `0`. Noob approach ================== ~~~~~ std::cout << a + b; ~~~~~ Almost-noob approach ================== Notice that we can interpret a + b as a incrementing a number `a` times, then `b` times. We get: ~~~~~ int ans = 0; for (int i = 1; i <= a; i++) ans++; for (int i = 1; i <= b; i++) ans++; std::cout << ans; ~~~~~ Slightly clever approach ================== Of course, we cannot stop there. A wise man once said: "every competitive programming problem is a dynamic programming problem if you try hard enough". So... let's be a little bit more imaginative! We define `dp[i][...

Полный текст и комментарии »

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

109.
Автор DNR, 2 года назад, По-английски
Dynamic Bitset Implementation #### Disclaimer: It might have bugs, don't send me death threats if you FST. I couldn't find a nice dynamic bitset template so I wrote one. It can be found [here](https://github.com/welcome-to-the-sunny-side/libra/blob/main/data/bitset.cpp). It has additional functionality as compared to `std::bitset` (you can answer many kinds of range queries on it, for example: "Find $k$-th set bit in range $[l, r]$). <spoiler summary="Some poor documentation"> #### General - It is used to store a 0-indexed boolean array. - Just like regular bitset, index 0 is the rightmost (sense of direction is important for `>>` and `<<`). - It uses $\lceil n/B \rceil$ blocks of size $B$ (which should be equal to bitwidth of $T$) to represent a boolean array of length $n$. Note that there may be some unused bits at the end of the last block. We will always have these unused bits set to 0. #### Functions For most functions, their use is obvious. For others: <spoiler summary="hel...

Полный текст и комментарии »

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

110.
Автор galen_colin, история, 6 лет назад, По-английски
Edge cases for Round 675 E I know a lot of people ([including myself](https://codeforces.me/contest/1422/submission/94699978)) have failed system tests on this notorious problem, and if you've been scratching your head for a while trying to figure out why, this (might be) the blog for you! (although it seems like there's more than 1 type of bug) One common fail was a wrong answer on test 46. This bug might be because you haven't checked that the two characters you're removing were actually consecutive in the initial string (for a test case like `deedc`) &mdash; this can be remedied by storing indices along with the characters of the string and making the appropriate checks. However, this may now lead you to a different wrong answer. What I found that broke my program was the following simple case: `ddeedc`. The assumption I made was that if two equal characters at the front of the string haven't been removed yet, then it's not optimal to remove any more of those characters in that "chain" of equal characters...
more than 1 type of bug)

Полный текст и комментарии »

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

111.
Автор wuhudsm, 3 года назад, По-английски
Codeforces Round 930 (Div. 1, Div. 2) Editorial Thank you for participation and we hope you enjoy this round :) #### [D2A &mdash; Shuffle Party](https://codeforces.me/contest/1937/problem/A) Idea : [user:chromate00,2023-08-27] <spoiler summary="Hint (for thinkers)"> If you think in terms of $k$, it might be hard to find the solution. Maybe it will be helpful if you fix $d$ and find the $k$ which will be swapped with $d$. </spoiler> <spoiler summary="Hint (for observers)"> Try bruteforcing for, say, $n \le 20$. Do you see a pattern? </spoiler> <spoiler summary="Tutorial"> On $n=1$, the answer is trivially $1$. On $n=2$, index $1$ and $2$ are swapped. The answer is therefore $2$. For $n>2$, let us assume the element $1$ is on index $a$ and it will be swapped with index $k$. Then, $a$ must be $k/2$. We will prove this by contradiction. Let us assume that there is no divisor greater than $a$, and $a$ is lesser than $k/2$. But then, as $a$ is a multiple of $2$ in the base condition, $k$ must be a multiple of $2...
#ifdef i_am_noob #define bug(...) cerr << "#" << __LINE__ << ' ' << #__VA_ARGS__ << "- ", _do

Полный текст и комментарии »

Разбор задач Codeforces Round 930 (Div. 1)
Разбор задач Codeforces Round 930 (Div. 2)
  • Проголосовать: нравится
  • +192
  • Проголосовать: не нравится

112.
Автор Everule, история, 4 года назад, По-английски
How to prove your solutions in Competitive Programming It seems many people struggle to understand what a proof even looks like, for greedy problems. The issue is the polarized forms of proof in CP and academic math, which may seem to be overly rigorous and difficult to during contest. However there is spectrum of what a proof even is. It is important to understand, that you cannot truly write and verify a proof within yourself, or within an entity (the entirety of codeforces for example). It is necessary to have judgement on what level of rigor is sufficient. If you want to tell yourself that you just don't have math background and therefore can't prove and will perpetually use it as excuse this blog is not for you. Academic proofs usually tend to be as rigorous as possible, and are carefully verified by other experts in the field, to be objectively certain of its correctness. Clearly that is not a level of rigor you need while solving a codeforces problem. You only need to prove it _to yourself._ For this, there are certain heu...

Полный текст и комментарии »

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

113.
Автор balbit, история, 5 лет назад, По-английски
Let's Solve Some More Hard Problems! Inspired by ivan100sic's [problem list blog](https://codeforces.me/blog/entry/98630), I'll pick 10 nontrivial-seeming recent POI (Polish Olympiad in Informatics) problems that I haven't solved and track my progress here. It seems to me that POI is better suited for this format as their editorials are quite difficult to find (if possible [at all](https://szkopul.edu.pl/problemset/problem/v2Y2_UW56ENMcbwP22tkTb7a/site/?key=statement)). While Ivan's original challenge was supposed to last an entire year, I'm not nearly as patient, so I won't look for editorials only until February 1st (in just over 2 weeks). Hopefully I'll have completed at least 80% by that time. Until then, GLHF!!! The List: 1. [Multidrink 2013](https://szkopul.edu.pl/problemset/problem/GyDCbdIgFY5FsMa9iIsBl3hf/site/?key=statement) [Solved Jan 15] <spoiler summary="Fun-ness:"> 5/10 <spoiler summary="Comments"> My thought process on this problem went like "ew this is disgusting implementation" => ...
- a[i]; a[i] = a[i-z] + d; } bug(i, a[i]); sig[i] = sig[i-1, ); } #ifdef BALBIT pii A = fast(); pii B = slow(); bug(A.f, A.s, B.s, // bug(ss, poo);, REP(i, SZ(pth)) { tp[i] = can; int v = pth[i]; dfs(v, -1); bug, ] == 0) { qq.push(u); } } } bug(SZ(doorder)); REP, bug((clock()-t)/(double)CLOCKS_PER_SEC); }, bug(A.f, A.s);, bug(df, ret);, bug(i, base);, bug(p.f, p.s, x, a); return {x, a}; }, build(); bug(tlist[0].oldid);, for (int x : pth) bug(x);, int bye = (*nxt).f.s; bug(bye); for (auto p : from[bye]) { int X, pii get(pii p) { int piff = p.f - p.s; bug(piff); int x = 0;, pii tmp = get(flip({m-1,1}, nowdir)); bug(tmp.f, tmp.s);, void upd(int l, int r, int v) { if (l > r || l == -1) return; bug(l,r,v); yo[l].pb

Полный текст и комментарии »

Теги pow, odz, eni, abh, ai
  • Проголосовать: нравится
  • +149
  • Проголосовать: не нравится

114.
Автор csacademy, 11 лет назад, перевод, По-русски
New Online Judge Platform — csacademy.com Hello, Codeforces! We are glad to invite all of you to test out our new Online Judge platform at [csacademy.com](http://csacademy.com). We're a Romanian based start-up that focuses on online education. Up until this point we've been working on creating a new environment for competitive programming contests. Our first beta round took place in January and it was an IOI-style contest of medium difficulty. You can have fun solving the problems in our [archive](https://csacademy.com/contest/arhiva/). Pay attention though, it is necessary to have an account in order to solve any problems on our website. You can connect via Facebook or Google+, or you can simply create a new account by providing a valid email address. Once you have an account you can choose a username, but all Codeforces handles are already reserved (so no [user:tourist,2016-03-02] for the locals :D). We have created for you the possibility of connecting your Codeforces user [here](https://csacademy.com/accounts/profile...

Полный текст и комментарии »

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

115.
Автор Golovanov399, 5 лет назад, По-английски
A tool for testing interactive problems Hello, codeforces! I have created a tool for testing interactive problems. If you do not know what it is, I recommend you to read [Interactive Problems Guide](https://codeforces.me/blog/entry/45307) before/instead of reading this blog. It is important to understand that this tool does **not** help, in any way, to solve interactive (and all other types of) problems, where by "solve" I mean "come up with the solution". Today's June Lunchtime introduced an interactive problem called [XOR, The Detective](https://www.codechef.com/LTIME109A/problems/XORDETECTIVE), where I used my tool and it helped me to debug my solution, so I would like to use this chance to show the tool in work. With all of this out of the way, let's begin. Debugging interactive solutions in general ================== I can't say about everyone, but for me personally debugging a solution to an interactive problem is much harder than to a non-interactive one. First of all, basic testing on samples is already no...
numbers differ, so I knew which part of my code was faulty. And indeed, after fixing abug I got this:

Полный текст и комментарии »

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

116.
Автор SHZhang, история, 6 лет назад, По-английски
Stop unrated users from sending talk messages! Today I received this incredibly offensive talk message from an unrated account (also with an offensive username), which attacks me based on my national origin: ![ ](/predownloaded/22/fd/22fd54c3adba355b78a573963edeff173fd2d755.png) I strongly suspect that I am not the only Codeforces user receiving such messages recently (I don't think I am particularly notable in any aspect as a Codeforces user, and I cannot think of a reason why I might be specifically targeted); if you received similar messages, let me know in the comments. I am aware of the "block user" feature and the ability to require a minimum rating for users to send messages to you, but it is not very well-known and is simply insufficient. **Update: after receiving the message, I set a "at least newbie" setting for users to send talk messages to me. However, two unrated users still managed to message me after the blog post was created. This seems to be a Codeforces bug.** I therefore request that unrated users...
. This seems to be a Codeforces bug.**

Полный текст и комментарии »

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

117.
Автор wmxwmx, история, 5 лет назад, По-английски
Discussion on a bug of mojibake(especially regarding Chinese) in the Ghosts uploading in gym Discussion on a bug of mojibake(especially regarding Chinese) in the Ghosts uploading in gym ================== Hello guys, I am the contest uploader of [contest:103366] and by the time I uploaded it, I encountered a serious bug of mojibake when uploading Ghosts containing Chinese characters. As it is at the middle of Chinese algorithm contests season, I find it necessary to discuss this bug in public as well as to provide a temporary solution to this bug for Chinese uploader or anyone who suffering from this bug. Discovery of the bug ------------------ In October $25^{th}$, after I upload the Ghosts for the [contest:103366] through FTP servers, all the Chinese characters in the team name became mojibake as the screenshot below. ![ ](/predownloaded/c0/22/c0223fa8bb45b090b4416c7d07ea8a76e6ab9e59.png) As I was convinced that gym supports the unicode display of team name in Ghosts, I consulted another uploader who have successfully uploaded team name with Chinese characters onl...
Discussion on a bug of mojibake(especially regarding Chinese) in the Ghosts uploading in gym, helps me a lot. Hope the bug will be fixed soon and Codeforces gets better in the future!, the bug. While fixing this issue, there is another bug/feature which is rather annoying that each, By that time I was just thinking that they may have just encountered the same bug during data, Discovery of the bug ------------------ In October $25^{th}$, after I upload the Ghosts for the, Reappearance of the bug ------------------ In November $1^{th}$, when [contest:103389] (China

Полный текст и комментарии »

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

118.
Автор Xellos, история, 7 месяцев назад, По-английски
C++ quirks: variable shadowing C++ is a very permissive language. It'll let you write basically anything on the assumption that you know what you're doing... or let you shoot yourself in the foot if you don't. For example: ```cpp class C { int a; public: C(int a) : a{a} {} }; ``` It's a fairly common pattern in simple class design that's perfectly fine until it's not. The class member and constructor argument (c.arg.) have the same name. This is known as shadowing and compilers will warn you about it, though you need to use a flag `-Wshadow` that isn't included among `-Wall` or `-Wextra`. Another example of shadowing is ```cpp for(int i = 0; i < t; i++) for(int i = 0; i < n; i++) ``` which is fine if the first `i` isn't used for anything except making a loop (such as over test cases) but otherwise it's a solid source of bugs, especially if you "fix" it into `for(int j = 0; j < n; i++)`. ### How does shadowing work? First off, when can one variable shadow another? The standa...

Полный текст и комментарии »

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

119.
Автор thecodingwizard, история, 6 лет назад, По-английски
USACO Guide: Curated Resources for Competitive Programming & USACO **11/7/2020 Update**: Now open sourced at https://github.com/cpinitiative/usaco-guide [![USACO Guide Banner](/predownloaded/cd/f4/cdf40be60dc184cc6d1cb18e13d508a2853f75eb.jpg)](https://usaco.guide/) Link: https://usaco.guide/ Recently, a group of experienced USACO contestants (led by the legendary [user:Benq,2020-07-21]) have put together a "USACO Guide" that's designed to take you from any division to Platinum and beyond. It can be accessed here: https://usaco.guide/. Though it's structured around USACO, it can still be used by non-USACO contestants! The guide provides a curated list of tutorial resources you can use to learn a particular topic, as well as a lot of practice problems for you to practice your implementation & application skills. It also comes with progress-tracking tools to help you stay motivated :) This guide is still in the **pre-release** stage: a large number of modules, particularly the more advanced ones, are still incomplete. **We are looking for ...
- If you have any suggestions, bug reports, or thoughts, please leave a comment for discussion

Полный текст и комментарии »

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

120.
Автор SHaF3Y, история, 6 месяцев назад, По-английски
A Sneaky C++ Bug: AC on Clang, WA on GCC **I used Ai to format the Blog** While solving the problem [TTM on SPOJ](https://www.spoj.com/problems/TTM/) using a Persistent Segment Tree, I ran into a very frustrating bug My code was logically correct, yet I was getting completely different verdicts depending on the compiler: * **Accepted** on `C++14 (Clang)` * **Wrong Answer** on `C++14 (GCC)` After a long debugging, the issue turned out to be caused by **unspecified evaluation order** [Code](https://ideone.com/uXMeOB) Here is the problematic line: ```cpp // 't' is the current version number of the Persistent Segment Tree if (op == 'C') { int l, r, d; cin >> l >> r >> d; --l, --r; // The fatal line: pst.roots[++t] = pst.update(t, l, r, d); } ``` ## What’s the Problem? In **C++14 and older**, the C++ standard does **not specify** the evaluation order of the operands of the assignment operator (`=`) That means the compiler is free to evaluate either: * the left-hand s...
A Sneaky C++ Bug: AC on Clang, WA on GCC, Segment Tree, I ran into a very frustrating bug, So this exact bug disappears in modern C++ standards.

Полный текст и комментарии »

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

121.
Автор chromate00, 9 месяцев назад, По-английски
Codeforces Round 1082 (Div. 1, Div. 2) Complete Editorial I hope you enjoyed the contest! <spoiler summary="Rate the contest!"> - Epic - Good - Moderate - Bad - Horrendous </spoiler> Editorials of all problems have been added. Also if you can explain your solution in the comments, please do so! That would be still very helpful for other participants. ## [problem:2202A] <spoiler summary="Editorial"> [tutorial:2202A] </spoiler> ## [problem:2202B] <spoiler summary="Editorial"> [tutorial:2202B] </spoiler> ## [problem:2201A1] <spoiler summary="Editorial"> [tutorial:2201A1] </spoiler> ## [problem:2201A2] Thanks to [user:Proof_by_QED,2026-02-24] for suggesting this subtask! <spoiler summary="Editorial"> [tutorial:2201A2] </spoiler> ## [problem:2201B] <spoiler summary="Editorial"> [tutorial:2201B] </spoiler> ## [problem:2201C] Thanks to [user:reirugan,2026-02-24] for writing the model solution w...

Полный текст и комментарии »

Разбор задач Codeforces Round 1082 (Div. 1)
Разбор задач Codeforces Round 1082 (Div. 2)
  • Проголосовать: нравится
  • +107
  • Проголосовать: не нравится

122.
Автор PrinceOfPersia, история, 10 лет назад, По-английски
Codeforces Round #366 (Editorial) [Here](https://gitlab.com/amirmd76/cf-round-366) are the solutions to all problems. ### Div.2 A Just alternatively print "I hate that" and "I love that", and in the last level change "that" to "it". ![ ](http://sl.uploads.im/t/Y0KJh.png) Time Complexity: $\mathcal O(n)$ ### Div.2 B First of all, instead of cycles, imagine we have bamboos (paths). A valid move in the game is now taking a path and deleting an edge from it (to form two new paths). So, every player in his move can delete an edge in the graph (with components equal to paths). So, no matter how they play, winner is always determined by the parity of number of edges (because it decreases by 1 each time). Second player wins if and only if the number of edges is even. At first it's even (0). In a query that adds a cycle (bamboo) with an odd number of vertices, parity and so winner won't change. When a bamboo with even number of vertices (and so odd number of edges) is added, parity and so the winner will cha...

Полный текст и комментарии »

Разбор задач Codeforces Round 366 (Div. 1)
Разбор задач Codeforces Round 366 (Div. 2)
  • Проголосовать: нравится
  • +164
  • Проголосовать: не нравится

123.
Автор dmkozyrev, история, 3 года назад, По-английски
[Tutorial] Quick start in solving problems on GPU + CPU Hello, codeforces! Do you have modern GPU and CPU and want to calculate something with them, but you don't know how to do it? Dont be upset, because you can read this blog and run your first GPU program on your AMD/Intel/NVIDIA GPU. I will describe an installation process and then we will dive into the C++ code. As an example, we will calculate a lot of mazes for [Bug Game](https://codeforces.me/blog/entry/115144) in parallel. For doing this in simple way, we will use library [Boost.Compute](https://www.boost.org/doc/libs/1_80_0/libs/compute/doc/html/index.html), which is a C++ STL-style wrapper over OpenCL library. [cut] ... Installation for MacOS (Apple M1 Pro) ================== As [user:Gosunov,2023-06-10] said, `OpenCL` and `g++` are pre-installed on `MacOS`. Everything that you have to do is install `Boost` with command `brew install boost`. After this you will be able to compile your program with command `g++ -std=c++17 -O3 -I/opt/homebrew/Cellar/boost/1.81.0_1/...
Fixing the bug in Boost.Compute 1.66 header by yourself -------------------, Lets start to solve Bug Game on GPU and we will see how it is implemented!, Solving Bug Game on GPU ==================

Полный текст и комментарии »

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

124.
Автор DNR, 17 месяцев назад, По-английски
RSHF — a Rating and Report System (Beta) # TL-DR ##### https://rshf.net/ (not adapted for mobile) ##### https://chromewebstore.google.com/detail/rshf/jmpohmlhicdbghkhageaiefhenmkdfcg (the most recent version will be available at https://github.com/welcome-to-the-sunny-side/rshf-extension) <br> # TS-DR <img src="https://i.ibb.co/NdgvgPLG/logo.png" alt="RSHF logo" style="float:right;width:300px !important;height:auto;margin-left:30px; margin-bottom:6px;"> Simply put, RSHF offers the ability for users to form groups that have their own self-contained rating, report and moderation systems. Deeper visual integration with the Codeforces website is offered through a browser extension. More details on each of these components follow: ### Groups Group members are partitioned into three tiers: 1. Admins 2. Moderators 3. Members Their roles and responsibilities closely match what you might think they do: Admins and Moderators process reports and take appropriate actions in response. Admins have additi...

Полный текст и комментарии »

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

125.
Автор ATSTNG, история, 21 месяц назад, По-английски
Undesired -fpermissive behaviour of CF GCC compilers Apparently $24$ hours without sleep and months of coding in scripting languages had the effect on me... During the contest I submitted this [submission:310073998] _Quick challenge: pause reading and find the bug in my solution_ ![ ](/predownloaded/0e/26/0e2631ab99e8f926b267a2b88710962ea2cf0f7e.png) [Link to original art](https://www.artstation.com/artwork/8elamx) When I found out that I failed a div3D on not properly using `int64_t` I was quite surprised, because I double checked that I did it right. I felt very stupid at first, but then I got surprised even more when I figured how exactly this happened. Take a look at the line $25$ ~~~~~ const& r = cr[i]; ~~~~~ It appears that GCC allows to declare variable references omitting type declaration completely when cv-qualifier is present. Yes, without invoking type deduction using `auto`. To be precise expression in form ~~~~~ <cv-qualifier> &<variable-name> = <value>; ~~~~~ appears to be well-formed an...
_Quick challenge: pause reading and find the bug in my solution_

Полный текст и комментарии »

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

126.
Автор michao, история, 14 месяцев назад, По-английски
CP trainer — a new tool for training Hello, <br/> I created a project for training and analyzing your performance during contests: [cp-trainer.com](https://cp-trainer.com). I believe it has some unique features non-existent in competitive platforms and can provide as a more sensible tool for training, especially for more experienced users, who have participated already in a bunch of contests. Below I will briefly discuss its functionalities: Problem recommender ------------------ In this section, we will discuss the heuristics used for problem recommender, the system offers for the user 10 problems with the highest value of this heuristics. First we need to introduce a couple of metrics: <ul> <li> <b> get_dict_accuracy </b> — Dictionary of form (<b>tag</b> : average number of submissions to accept problem with this tag during contest) </li> <li> <b> ratings_average_time_diffs </b> — Dictionary of form (<b>rating</b> : average time in seconds to solve the problem with this rating during contest) </li> <li...

Полный текст и комментарии »

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

127.
Автор yeputons, 16 лет назад, По-русски
One more GCC bug (#323) Test code that I've created on contest:<br><a href="http://pastebin.com/jvkUcZx3">http://pastebin.com/jvkUcZx3</a><br>I think that function should return the same results if it calles with byte-to-byte equas parameters.<br>But in this case they are distinct.<br><strike>There is one more test program from MaxBuzz:<br></strike><span class="comment-content-18020"><div class="from-renderer"><strike>#include &lt;cstring&gt;</strike><div><strike>#include &lt;cstdio&gt;</strike></div><div><strike><br></strike></div><div><strike>int f(int x) { return 1 &lt;&lt; x; }</strike></div><div><strike><br></strike></div><div><strike>int main() {</strike></div><div><strike><span class="Apple-tab-span" style="white-space: pre;"> </span>for (int i = 0, j = 42; i &lt; 1000000; ++i)</strike></div><div><strike><span class="Apple-tab-span" style="white-space: pre;"> </span>if (!memcmp(&amp;i, &amp;j, sizeof(int)))&nbsp;</strike></div><div><strike><span class="Apple-tab-span" style="white-space: pre;"> </sp...
One more GCC bug (#323), that 1 << 42 = 1024. This isn't a bug, because 1 << 42 is, Compiling with MSVC++ fixes this bug., UPD. I've tried it on CF servers. Bug is alive UPD2. There is additional

Полный текст и комментарии »

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

128.
Автор adamant, история, 21 месяц назад, По-английски
Geometric meaning of LP duality Hi everyone! Recently, linear programming (LP) duality was brought up in a Discord server, and it made me think again about how, whenever it is introduced, it's most often _very_ poorly motivated. Some examples that I've seen include: - Directly deriving it from general Lagrange duality (which I did myself in the past, and I like this method, but it's not best for LP); - Giving some vague economics-based explanation in terms of goods quantities and costs; - Making a very handwavy argument about approximating the target function with constraints; - Simply proving it symbolically without giving a good explanation to what and why we're doing. After some thinking, I would like to share a geometric interpretation to LP duality, that I think should very intuitively and directly explain what's the meaning of our actions, and why does it actually deliver the same result (and not just an upper bound) as the primal problem. **Tl;dr**. Both primal and dual LP problems find the **su...

Полный текст и комментарии »

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

129.
Автор okwedook, 4 года назад, перевод, По-русски
Codeforces Round #870 (Div. 2) Hi, Codeforces! I am glad to invite you to take part in [Codeforces Round #870 (Div. 2)](https://codeforces.me/contest/1826), which will take place on [contest_time:1826]. The round will be **rated for the participants with rating lower than 2100**. Participants from the first division are also welcomed to take part out of competition. You will be given **2 hours** to solve **6 problems**. All the problems were authored and prepared by me. One of the problems is interactive, please read [the guide of interactive problems](https://codeforces.me/blog/entry/45307) before the contest. I would also like to thank: <ul> <li> [user:Akulyat,2023-05-04] for excellent coordination and help improving the problems! </li> <li> [user:arzhantsev64,2023-05-04], [user:InversionSpaces,2023-05-04], [user:Aleks5d,2023-05-04], [user:PO3OBAR_Bblnb,2023-05-04], [user:DanWallgun,2023-05-04], [user:Dominater069,2023-05-04], [user:AlperenT,2023-05-04], [user:Sert,2023-05-04], [user:sdl,2023-05-04...
* Special thanks to [user:Sert,2023-05-04] for finding a crucial bug in one of the problems

Полный текст и комментарии »

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

130.
Автор WasylF, история, 10 лет назад, перевод, По-русски
CF-Predictor — Know your rating changes! <spoiler summary="UPD 2 Sep 2018"> I've deployed an update today. If you face any issues with CF-Predictor, please let me know :) </spoiler> Hi guys! As I mentioned on previous contest I'm working on tool that predicts rating changes. I'm happy to present it now! ![ ](https://github.com/WslF/CF-rating-prediction/blob/master/Files/icon1024.png?raw=true) A huge amount of your nerve cells die every time when you wait for a rating update on Codeforces. Stop this! From now you could use this service, it calculates approximate rating changes for every contestant. The most interested thing for you is extension. It partly modifies the contest standings page and shows approximate rating changes for every contestant. It is available for three browsers: [![ ](http://codeforces.me/predownloaded/da/65/da6525a67ce20846473316c363d3aeec418a90a2.png)](https://chrome.google.com/webstore/detail/rating-predictor-for-code/ocfloejijfhhkkdmheodbaanephbnfhn) [![ ](http://codeforces.me/pr...
[user:AlexDmitriev,2017-02-20]! He was close to find my bug in rating calculation:)

Полный текст и комментарии »

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

131.
Автор vovuh, история, 8 лет назад, По-русски
Codeforces Round #540 (Div. 3) Miss Div. 3 rounds? :) &lt;copy-pasted-part&gt; Hello! [contest:1118] will start at [contest_time:1118]. You will be offered 6 or 7 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. You will be given 6 or 7 (or 8) problems and 2 hours to solve them. Note that **the penalty** for the wrong submission in this round (and the followin...

Полный текст и комментарии »

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

132.
Автор Egor, история, 11 лет назад, По-английски
CHelper 4.4 I would really appreciate any new ideas of what new features to add I would also appreciate donations: [Yandex.Money](https://money.yandex.ru/embed/shop.xml?account=410011732687384&quickpay=shop&payment-type-choice=on&writer=seller&targets=CHelper&targets-hint=&default-sum=100&button-text=03&successURL=), [PayPal](https://www.paypal.me/CHelper) Seems like no one tried beta verion &mdash; I would really appreciate feedback **4.4.3b3** - All supported sites are updated - New Google Code Jam is now supported - You can now inline any file (feature best used for DCJ, which is not here this year, but I hope will return) ------ **4.4.1b2** Support for interactive tasks added. By default you would interact using user input, but you can write your own interractor ------ **4.3.1** Task format is changes to JSON. I would recomment backing up your project before updating ------ **4.2.2** - Critical bug fix - CHelper Beta is no longer supported. You can sel...
- Critical bug fix - CHelper Beta is no longer supported. You can select Beta channel of CHelper

Полный текст и комментарии »

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

133.
Автор majk, 8 лет назад, По-английски
Good Bye 2018 Problem G I realised I have too much contribution anyway, so I write this blog about G of today's contest. This problem was plagued by technical issues from start to finish. When you read some of them, you will probably ask yourself how the hell did I get red in the first place. Originally, the problem had $n$ a product of just $2$ primes. We then decided to raise it up to $10$ primes. I was really confused that I had two types of runs &mdash; either they passed with runtime 30ms, or they got TLE or ILE. I added time measurement to the interactor itself, and found out that the 30ms solutions in fact took more than couple seconds to run. The same solutions reported run time of couple seconds in Gym contest that we used for testing. During post contest discussions with [user:MikeMirzayanov,2018-12-30] I realised that I still don't understand how Polygon and Codeforces measure time for interactive problems. I am not the fastest duck in the pond, so I investigated my Tonelli Shanks impleme...

Полный текст и комментарии »

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

134.
Автор caterpillow, 2 года назад, По-английски
Build Your Own Treap! Hallo codeforcers, As some of you may know, the almighty treap is one of the most versatile data structures out there. It can serve as an ordered + indexed set, a lazy segment tree, and even a dynamic array — all at the same time. However, its immense versatility comes at a cost: there are so many different variations that making a one-template-fits-all is impossible. Alas, is fate such that we must write it from scratch — every, single, time? Fear no more! I present to you [BYOT: Build your own treap!](https://caterpillow.github.io/byot) Now, you can summon a hand-crafted treap to overkill your Div2D in mere _seconds_. Gone are the days of using your brain to come up with a clever solution — just go to the site, click on what you need, and enjoy your AC! To see how it is used, you can see some example implementations below. If you find any bugged configurations or have any suggestions, please leave a comment under this blog. Be warned, no rating refunds will be issued...

Полный текст и комментарии »

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

135.
Автор ToxicPie9, 4 года назад, По-английски
[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....
the bug is before I reveal the culprit as I tried to make this blog interactive. The codes that I

Полный текст и комментарии »

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

136.
Автор vaaven, 4 года назад, По-русски
Codeforces Round #857 Editorial [problem:1802A] ------------------ Idea: [user:Aleks5d,2023-03-13], Preparation: [user:vaaven,2023-03-13] <spoiler summary="Solution"> Let's show a construction that maximizes the number of likes. We need to first leave all the likes that we can put, and only then delete them. To minimize the number of likes, we need to delete the like (if we can) immediately after we post it. The code below implements these constructs. </spoiler> <spoiler summary="Code"> ~~~~~ #include "bits/stdc++.h" using namespace std; void solve() { int n; cin >> n; int likes = 0, dislikes = 0; for (int i = 0; i < n; i++) { int x; cin >> x; if (x > 0) likes++; else dislikes++; } for (int i = 1; i <= n; ++i) { if (i <= likes) cout << i << ' '; else cout << likes * 2 - i << ' '; } cout << '\n'; for (int i = 1; i <= n; ++i) { if (i <= dislikes * 2) cout << i % 2 << ' '; el...
for (int j = (int)s[e][i].size() - 1; j >= 0; j--) { // bug forget if (pid[e][i][j] == -1, if (g[a].pp != -1) { // bug ignore int id = g[g[a].pp].id; int bg = i + 1 - (int)s[0][id, if (g[a].term) { // bug always pid[e][i][j + 1] = g[a].id; } }, if (g[v].term) { // bug in c != -1 g[v].cnt = 1; }

Полный текст и комментарии »

Разбор задач Codeforces Round 857 (Div. 1)
Разбор задач Codeforces Round 857 (Div. 2)
  • Проголосовать: нравится
  • +125
  • Проголосовать: не нравится

137.
Автор galen_colin, 3 года назад, По-английски
THE OPTIMAL PRACTICE STRATEGY (**NOT CLICKBAIT**) Spoiler: it's clickbait. Sorry. Titles like those are fun. ...but, it's the same style of clickbait as my [roadmap](https://www.youtube.com/watch?v=bSdp2WeyuJY) [spoiler 2: if you haven't seen that, it markets itself as a standard roadmap (y'know, soulless and devoid of purpose), but then a few minutes in, says "ok but roadmaps are stupid and here's the advice that you really need" and completely changes the direction of the video]. That's my style of clickbait, and that's the vibe this blog goes for. [cut] <br><br> So... hear me out, please. The start ------------------ First, a couple meta-notes. I will likely exaggerate my tone a bit here for dramatic effect. Don't take it personally, please. Also, **this applies to almost all ratings**. At the very least, I recommend you process the main point of this blog and see whether or not you already do something similar (for most people... probably not?) The problem ------------------ I'm sure if you've looked at the...

Полный текст и комментарии »

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

138.
Автор Nickolas, 6 лет назад, По-английски
April Fools Day Contest 2021: editorial ##[problem:1505A] This problem described the task in quite a lot of detail. The main challenge was that it was interactive, so some effort was required to figure out the right sequence of reading from standard input, writing the answer and checking for end of file. Here is the code in Python: ```python while True: try: q = input() except EOFError: break print("no", flush=True) ``` ##[problem:1505B] As the problem statement strongly hinted, in this problem you had to calculate the **digital** root of the given number. The digital root of a given number is the (single digit) value obtained by an iterative process of summing digits, on each iteration using the result from the previous iteration to compute a digit sum. The process continues until a single-digit number is reached. ##[problem:1505C] YES or NO answer implies that you need to figure out whether the given word is a Fibonacci word. Similarly to the Fibonacci-style integer s...
6. Find a bug in the line 1150 and fix it by changing "-" to "+", then re-run.

Полный текст и комментарии »

Разбор задач April Fools Day Contest 2021
  • Проголосовать: нравится
  • +140
  • Проголосовать: не нравится

139.
Автор Rising-coder, история, 13 месяцев назад, По-английски
Complaining Again about Round 1056! **The blog doesn't interest you if you're not mentioned so skip reading to save your time!** As you might've read in [user:Mr.Pie,2025-10-20]'s [blog post](https://codeforces.me/blog/entry/147075), some users have got rating change despite them being Master ranked and unrated in **Codeforces Round 1056 Div.2**, these are:<br> [user:Rising-coder,2025-10-20] -me, [user:ivandasfs,2025-10-20], [user:saboten,2025-10-20], [user:konghaojie,2025-10-20], [user:GuilhermeCdM,2025-10-20], [user:yahia,2025-10-20], [user:CoderAbhi27,2025-10-20], [user:lyteabovenyte,2025-10-20] ### Why did this happen ? It appears all of us have registered to the round when we were Candidate-Master. That's still a bug of course because I did the same many times before but this didn't happen. ### Why am I posting this blog ? Well I tried contacting [user:MikeMirzayanov,2025-10-20], and the round coordinator [user:errorgorn,2025-10-20], and one of the authors [user:efishel,2025-10-20]. But they all read a...
-Master. That's still a bug of course because I did the same many times before but this didn't

Полный текст и комментарии »

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

140.
Автор Swistakk, 6 лет назад, По-английски
Setup for remote team competitions Hi. Remote team competitions/trainings became something we have to deal with nowadays and I think having a setup you feel comfortable with is something really valuable and nontrivial to achieve that you definitely should not neglect, effort put into this will quickly pay off. In our Polish Mafia team we already participated in many remote competitions and struggled with various technical problems and through trial and error we converged to a setup which I believe is close to ideal. Many of these pieces of advice are applicable to all kinds of remote collaboration, e.g. working on some university projects or research problems, however I felt the biggest need for it during these competitions since they are periods when I really need to be focused hard. 1) Communication <br> The most important part in remote collaboration is communication. I definitely recommend PUSH TO TALK (that is &mdash; an option where you talk if and only if you hold a specified key). Background noises of o...

Полный текст и комментарии »

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

141.
Автор wuhudsm, история, 16 месяцев назад, По-английски
Codeforces Round 1040 (Div. 1, Div. 2) Editorial Thank you for participation and we hope you enjoy this round :) <spoiler summary="How did you find the contest?"> - Great: - Good: - Average: - Bad: - Trash: </spoiler> <spoiler summary="Which problem is your most favourite?"> - D2A: - D2B: - D1A: - D1B: - D1C1: - D1C2: - D1C3: - D1D: - D1E: - D1F1: - D1F2: </spoiler> <spoiler summary="Which problem you hate the most?"> - D2A: - D2B: - D1A: - D1B: - D1C1: - D1C2: - D1C3: [likes:favorite,2039E3_...
#ifdef i_am_noob #define bug(...) cerr << "#" << __LINE__ << ' ' << #__VA_ARGS__ << "- ", _do

Полный текст и комментарии »

Разбор задач Codeforces Round 1040 (Div. 1)
Разбор задач Codeforces Round 1040 (Div. 2)
  • Проголосовать: нравится
  • +118
  • Проголосовать: не нравится

142.
Автор galen_colin, 3 года назад, По-английски
fix problem ratings pls (the rainboy effect) [The first few paragraphs of this blog, above the first spoiler, are just for story purposes and are irrelevant to the problem statement] One fateful day, a naive and young version of me from about 5 days ago had a dream. A dream to stop being so terrified of hard problems. A dream to conquer the most challenging stuff that CF ever had to offer. A dream to... ok, enough of that, that's so stupid. Basically, I've been grinding 3500s lately, mostly for fun (and my god, has it been fun). Two days prior, I found myself solving [1919G](https://codeforces.me/contest/1919/problem/G). That went fine, but after getting it, I noticed that despite G being 3500, it wasn't even the hardest problem in the contest &mdash; that honor went to the next problem, [1919H](https://codeforces.me/contest/1919/problem/H) (the subject of this blog), which had **no solves in-contest**. I concluded that I would have to be insane to try that, and moved on to other problems. Well, yesterday, I decided I...

Полный текст и комментарии »

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

143.
Автор Himalaya_, история, 10 месяцев назад, По-английски
I built a simple Grid Visualizer because I hate wasting paper Hello Codeforces! Like many of you, I struggle to visualize grid/coordinate geometry problems when I don't have a pen and paper handy. Debugging DFS/BFS paths or complex geometry on a blank screen is painful. I couldn't find a simple, lightweight tool that did exactly what I wanted, so I built CP Grid Visualizer. It's a single-file, browser-based tool to instantly plot points and lines on an infinite grid. Link: https://himalaya-pahar.github.io/cp-grid-visualization/ github repo: https://github.com/himalaya-pahar/cp-grid-visualization Features: - Infinite Grid: Handles negative coordinates and large ranges easily. - Fast I/O: Left-click to add points. Click any two points to draw a line. - Interactive: Click points to connect them with lines. - Precision Control: Switch between Snap-to-Grid (Integers) and Decimal Mode (Floats) instantly. - Safe Mode: Toggle "Allow Adding Points" OFF to lock the board and prevent accidental clicks. - Fast Edit: Right-...

Полный текст и комментарии »

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

144.
Автор SecondThread, история, 4 года назад, По-английски
Codeforces Regex bug for Java Submissions Codeforces appears to have a minor bug in the backend regex evaluation for determining which submissions are legal java code. When attempting to submit, if you have an open curly brace in a submission before your outer class, you receive the following error: `Source should satisfy regex [^{}]*public\s+(final)?\s*class\s+(\w+).*` This happens even if the curly brace is in a comment. Here's an example case it won't let you submit when really it should: <spoiler summary="Break case"> ~~~~~ /* { */ public class A { public static void main(String[] args) { } } ~~~~~ </spoiler> Here's the thing though: according to [regex101](https://regex101.com/) the regex is correct, and the above java code does indeed match (with PHP >=7.3 regex, the default). This makes me believe there's some bug in how CF is evaluating whether the regex matches, rather than with the regex itself. ### Why it matters Although it's not a super big deal, often times I will use a comment bloc...
Codeforces Regex bug for Java Submissions, there's some bug in how CF is evaluating whether the regex matches, rather than with the regex itself., Codeforces appears to have a minor bug in the backend regex evaluation for determining which

Полный текст и комментарии »

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

145.
Автор EnDeRBeaT, 3 года назад, По-английски
[Tool] Graph Debugger Hi, CodeForces! For the past 2 months I have been working on a Graph Debugging tool, which allows you to draw graphs like these with just **TWO** lines of code: ![ ](/predownloaded/42/15/4215be4db6122c5583244a262d651c2dc5ae6b81.png) This is similar to print debugging (when you got a crash somewhere, so you repeatedly recompile the code with `cout << "penis\n";` to see where it failed), but instead it creates a window with the graph, which you can change however you want. It is also a marginally better tool than graph editor from CSAcademy in my opinion, so I would love you guys to try it out. This is not compatible with MacOS because Apple deprecated OpenGL (and even if it wasn't, it would've been kinda annoying to use) ## Building First, build the code from the repo: https://github.com/EnDeRGeaT/graph-debugger If you write in Visual Studio (not Visual Studio Code), follow "For MSVC" part. If you write in anything else, you probably should follow "For GCC/...

Полный текст и комментарии »

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

146.
Автор Lyde, история, 3 года назад, По-английски
overwhelmed **Note: it's a mile-long wall of text about my story in the recent ICPC Regional Contest, which is my first time experiencing it, so if I wasted anyone's time, I'm truly sorry.** <spoiler summary="Backstory"> I kinda lost motivation in Competitive Programming for a while and decided to take a long hiatus since March. I had a lot of work to study and do, given semesters and stuff, and preparing to go to university (I'm 18). It wasn't fun back then. Fast forward to June, when everything was done, I had a bunch of universities to choose from, and it really messed up my mind. Every school felt, equal. It took like a whole 2 months before I chose Hanoi University of Science and Technology (HUST), most probably because it's well-known in Vietnam and has a long and successful history and stuff. I knew that it was really hard to not choose Vietnam National University (VNU), since it's a really good school and most of the strongest people in programming, especially CP, went there. My s...

Полный текст и комментарии »

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

147.
Автор Errichto, 10 лет назад, По-английски
CodeChef February Lunchtime — with Limak Hello Codeforces! Did you miss Limak? I’d like you to invite for [CodeChef February Lunchtime] (https://www.codechef.com/LTIME45) that will start at 19:35 IST / 17:05 MSK of 25-th February 2017 (check your time zone [here](https://www.timeanddate.com/worldclock/fixedtime.html?msg=CodeChef+February+Lunchtime&iso=20170225T1935&p1=44&ah=3)) and will last 3 hours. The contest starts 5 minutes later than usually to allow you to catch a breath after the [AtCoder Mujin Contest](http://codeforces.me/blog/entry/50457) that ends at 17:00 MSK. I am an author of problems and editorials, while [user:niyaznigmatul,2017-02-23] is a tester. I want to thank [user:PraveenDhinwa,2017-02-23] (who is a contest admin) and [user:suraj_sharma,2017-02-23] for their technical help. Translators: [user:CherryTree,2017-02-23] \(Russian), [user:huzecong,2017-02-23] \(Mandarin) and VNOI team \(Vietnamese). Language verification: [user:arjunarul,2017-02-23]. There is no registration required, anybody with...

Полный текст и комментарии »

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

148.
Автор accidentallygivenfuck, история, 11 лет назад, По-английски
Ineffable — simple command-line grader for personal use <center> <img src="http://codeforces.me/predownloaded/f4/3d/f43d1d912eca2f8c25b30418f592eb7717eaf88f.png"> </center> Hello Codeforces, I want to share with you a simple tool that I've been using for a while now that I named "Ineffable". # What is ineffable? Simple command-line grader for local grading of solutions for problems of competitive programming contests. It is written in Python and it uses `timeout` Perl library to limit resources (time and memory limits) of program being tested. It works on Ubuntu, and I guess it should work on any Linux/Unix system as long as Python and Perl are installed. # Screenshots ![ ](http://codeforces.me/predownloaded/a9/36/a936a7ff09cf8bd714f2321847676328a99f674d.png) ![ ](http://codeforces.me/predownloaded/23/ca/23ca3a3112a7b22ea5a809f6a4a1e5f0502475dd.png) (Original quote is "Success consists of going from failure to failure without loss of enthusiasm") # Installation Run the following commands on your terminal: ...

Полный текст и комментарии »

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

149.
Автор RezwanArefin01, 8 лет назад, По-английски
Checklist for OI Problems (WebApp) Hello Everyone, I guess everyone who is preparing for OI already know about this [Checklist for OI Problems](https://codeforces.me/blog/entry/59422) prepared by [user:ko_osaga,2018-11-01]. I've been using this for quite a long time, and it is really helpful! But since the checklist gets updated from time to time, I found it hard to migrate from the previous checklist to new checklist. So, I made the following web app for the same purpose! Now you don't need to worry about migrating, I can just add the problems to database and it'll update automatically! Link: [OI Checklist](https://oichecklist.pythonanywhere.com) Please find the features and changes to the main checklist bellow: Features and Changes ------------------ 1. First of all, now the checklist contains direct link to each problem, while the main checklist had link to some parent of the link. And clicking on a contest name will lead to the official "Task" page of that contest, which generally contains jud...

Полный текст и комментарии »

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

150.
Автор himanshujaju, история, 11 лет назад, По-английски
Counting Divisors of a Number in $O(N^{\frac{1}{3}})$ [tutorial] [Link to PDF (Latex Formatted)](https://www.dropbox.com/s/ny5nx5swg8bueth/divisors.pdf?dl=0) **Topic** : Counting Divisors of a Number **Pre Requisites** : Basic Maths , $O(\sqrt[]N)$ Factorisation , Primality testing **Motivation Problem** : There are $T$ test cases. Each test case contains a number $N$. For each test case , output the number of factors of $N$. $1 <= T <= 10$ $1 <= N <= 10^{18}$ _Note_ : $1$ and $N$ are also treated as factors of the number $N$. **Solution** : **Naive Solution** &mdash; _$O(\sqrt[]N)$ Factorisation_ The most naive solution here is to do the $O(\sqrt[]N)$ factorisation. But as we can see, it will surely receive the Time Limit Exceeded verdict. You may try to compute the prime numbers till required range and loop over them , but that too exceeds the usual limit of $10^8$ operations. Some optimisations and heuristics may allow you to squeeze through your solution, but usually at the cost of a few TLE's. Supposing you fit ...

Полный текст и комментарии »

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

151.
Автор vitux, 12 лет назад, По-русски
Codeforces Round #262 (Div. 2) Editorial [problem:460A] At this problem you need to model what written in statements. Also, it can be proved, that answer can be calculated using formula: $n + \lfloor\frac{n - 1}{m - 1}\rfloor$ , where $\lfloor x \rfloor$ is the integer part of $x$. [submission:7536107] [problem:460B] Obviously $S(x)$ can take only integer values and $ 1 \le S(x) \le 81 $. Let's check $S(x)$ from $1$ to $81$, and calculate $ B*S(x)^{A} + C$. After that if sum of digits of this number is equal to $S(x)$, it is positive and less than $10^9$, than it is a solution. There could be bug because of using C++ pow() function. [submission:7536153] [problem:460C] Note,that answer is positive integer not greater than $10^9+10^5$. Using binary search on answer, we will find answer. Really, we can check in $O(n)$ if some height is achievable. We go from left to right. For current flower we calculate how much times it need to be watered to stand not lower than checking value. If cuurent flower nee...
There could be bug because of using C++ pow() function.

Полный текст и комментарии »

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

152.
Автор MikeMirzayanov, 10 лет назад, По-русски
ACM-ICPC World Finals 2017 <center> <img src="/predownloaded/4d/47/4d475972ef3e14948e881152064cc208a4f83540.png"/> </center> ACM-ICPC World Finals 2017 will begin on <a href="https://www.timeanddate.com/worldclock/fixedtime.html?msg=ACM+ICPC+2017+World+Finals&iso=20170524T09&p1=1920&ah=5">May 24, 2017 at 15:00 (UTC)</a>. This event is the main event of the year in the world of sports programming! This year ICPC Regional participation included 46,381 of the finest students and faculty in computing disciplines from 2,948 universities in 103 countries on six continents. A record 50,145 students and 5,073 coaches competed in ICPC and ICPC-assisted competitions this year, setting new records in participation. Codeforces wishes the teams to show a vivid and interesting contest contest. We wish to find beautiful solutions, write without bugs and enjoy many accepted problems! Links: * <a style="font-weight: bold;" href="http://static.kattis.com/icpc/wf2017/">Current results</a> * <a href="https:/...

Полный текст и комментарии »

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

153.
Автор EvenImage, история, 10 лет назад, По-английски
My sad story When I was submitting the problem D in round #371, I clicked the "Choose File" button and selected my code. Before the submission, I read my code another time, found a bug in my code and fixed it. And then I clicked the "submit" button. But it turned out that my solution got wrong answer on pretest 4. I stress-tested my solution, and found it passed the big random data. I was really shocked. umm... Maybe my solution failed on some small testcases. So I tried many ways to generate testcases. But my solution was right on all the testcases I generated. After struggling for about 40mins, I gave up and submitted it again. It passed all the pretests. I compared two codes, and just found I submitted the old version (before fixing the bug) at first time. After asking my roommate, he said when you clicked the "Choose File" button, it would upload the file instead of recording the path. In the rest time of the contest, I tried to solve problem B and E but failed. <S>I think ...
Before the submission, I read my code another time, found a bug in my code and fixed it. And then I, I compared two codes, and just found I submitted the old version (before fixing thebug) at first

Полный текст и комментарии »

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

154.
Автор awoo, история, 8 лет назад, По-русски
Educational Codeforces Round 51 [Rated for Div. 2] On [contest_time:1051] [contest:1051] will start. Series of Educational Rounds continue being held as [Harbour.Space University](https://harbour.space/) initiative! You can read the details about the cooperation between [Harbour.Space University](https://harbour.space/) and Codeforces in the <a href="http://codeforces.me/blog/entry/51208">blog post</a>. This round will be **rated for the participants with rating lower than 2100**. It will be held on extented ACM ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally. You will be given **7 problems** and **2 hours** to solve them. The problems were invented and prepared by Roman [user:Ajosteen,2018-09-19] Glazov, Ivan [user:BledDest,2018-09-19] Androsov and me. Good luck to all participants! Our friends at Harbour.Sp...
**UPD:** There was a bug in testset and validator for problem F, we are currently fixing the issue

Полный текст и комментарии »

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

155.
Автор dalex, 13 лет назад, По-русски
Codeforces Round #222 — Problem Analysis [Link to announcement and discussion](/blog/entry/10138). And here is the problem analysis. #### A div 2: [problem:378A] Make three counters: for wins of both players and for a draw. Iterate over all six ways how they can throw a dice. For each way determine who wins or there is a draw and increment the corresponding counter. #### B div 2: [problem:378B] You can think a bit and understand that you should consider only corner cases: $k = 0$ and $k = \frac{n}{2}$. All other cases will be something between them. If $k = 0$, we should choose $n$ biggest elements from two sorted lists, one of the ways is to use two pointers method. And if $k = \frac{n}{2}$, we just mark first $\frac{n}{2}$ people in each list. #### A div 1 / C div 2: [problem:377A] Start BFS or DFS from any free cell. As the maze is connected, this search will visit all $s$ free cells. But we can stop the search when it visits $s - k$ free cells. It's obvious that these $s - k$ cells are connected to...
hardest bug. Who can fix it? It can be fixed by student whose skills is not less that this bug's

Полный текст и комментарии »

Разбор задач Codeforces Round 222 (Div. 1)
Разбор задач Codeforces Round 222 (Div. 2)
  • Проголосовать: нравится
  • +60
  • Проголосовать: не нравится

156.
Автор AnandOza, история, 6 лет назад, По-английски
Atcoder Beginner Contest 174 — Unofficial English Editorial Hi all, [Atcoder Beginner Contest 174](https://atcoder.jp/contests/abc174) was today. I wrote an unofficial English editorial. Hope it helps! ### [A: Air Conditioner](https://atcoder.jp/contests/abc174/tasks/abc174_a) We simply write an if statement. Runtime: $\mathcal{O}(1)$. <spoiler summary="Sample code"> ~~~~~ int x = in.nextInt(); out.println(x >= 30 ? "Yes" : "No"); ~~~~~ </spoiler> ### [B: Distance](https://atcoder.jp/contests/abc174/tasks/abc174_b) We can loop through all the points, and test each one. To avoid potential rounding errors, it's simplest to check $x^2 + y^2 \le D^2$, so we can keep everything in integers. Runtime: $\mathcal{O}(N)$. <spoiler summary="Sample code"> ~~~~~ int n = in.nextInt(); long d = in.nextInt(); d = d * d; Point[] points = Point.readPoints(in, n); int answer = 0; for (Point p : points) { if (p.x * p.x + p.y * p.y <= d) answer++; } out.println(answer); ~~~~~ </spoiler> ### [C: Repsept](h...

Полный текст и комментарии »

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

157.
Автор yevhenii_kanivets, история, 6 лет назад, перевод, По-русски
Codeforces WatchR 1.6.0: Localization, UX/UI polishes and bug fixes Last 4 weeks were dedicated to making the **final touches** for both [iOS](https://apps.apple.com/us/app/codeforces-watchr-contests/id1495591299) and [Android](https://play.google.com/store/apps/details?id=com.bogdan.codeforceswatcher) apps before introducing new shiny features. ![ ](/predownloaded/c2/8b/c28bd0a6f7d4e76e92bf153799003c565dbab538.png) Changes include, but not limited to: - new **rating dialog**, flawlessly embedded into Actions tab - new awesome **"Add User"** dialog - **rating changes** displayed on user's rating graph - **complete localization** of both apps to Ukrainian, Russian and Hindi (thanks [user:TiredOfLife,2020-06-04]) - many minor bug and crash fixes Upcoming features ------------------ We've noticed that **Actions** is one of the most popular features of Codeforces WatchR, and many users coming to the app to see more **coding and programming news**. Hence we decided to broaden its content by including other interesting sources. In part...
Codeforces WatchR 1.6.0: Localization, UX/UI polishes and bug fixes, Ukrainian, Russian and Hindi (thanks [user:TiredOfLife,2020-06-04]) - many minorbug and crash

Полный текст и комментарии »

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

158.
Автор Shayan, история, 22 месяца назад, По-английски
Codeforces Round 998 (Div 3) — Video Tutorial **Note: The text editorials will be provided by the authors of the round. This video tutorial acts as an additional resource for those who prefer video over text, not as a substitute for the text editorial.** ### [2060A &mdash; Fibonacciness](https://codeforces.me/contest/2060/problem/A) <spoiler summary="Video"> <iframe width="800" height="450" src="https://www.youtube.com/embed/uZEe-vnolf8?si=zUY2c35SmG_eyp2G&amp;start=439" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> </spoiler> ### [2060B &mdash; Farmer John's Card Game](https://codeforces.me/contest/2060/problem/B) <spoiler summary="Video"> <iframe width="800" height="450" src="https://www.youtube.com/embed/uZEe-vnolf8?si=zUY2c35SmG_eyp2G&amp;start=948" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clip...

Полный текст и комментарии »

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

159.
Автор I_love_Hoang_Yen, история, 11 лет назад, По-английски
Dogeforces (now available in Chrome extension!!) Of course, everyone loves Doge. That is why today, after miserably failing GCJ (yes, I have to rant here), I decided to write a Google Chrome extension that changes Codeforces to DogeForces. Here are some screenshots: ![ ](http://i61.tinypic.com/2uswlms.png) ![ ](http://i57.tinypic.com/2vxom8i.png) #### Why you should install this extension? - It is cool. - **Everyone** will now be red (in Dogeforces, everyone is the same, even admins or those who haven't participated in contests). - **Everyone** will now have high rating and high contribution (at least in profile page). - **Everyone** loves Doge. And of course, functionalities of Codeforces still works (but cooler). #### How to install: - Get codes from [my Github repo](https://github.com/ngthanhtrung23/DogeForces). If you don't know how to use git, just create a folder, and put all those files in that folder. - Go to [chrome://extensions/](chrome://extensions/) and tick on "Developer mode" - Click on "Load u...
**UPD2**: v1.2. Fixed a minor bug that affects profiles without email., **UPD3**: v1.3. Fixed bug that affects profiles without badge., **UPD4**: v1.4. Fixed bug that caused showing rating in user comments page.

Полный текст и комментарии »

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

160.
Автор Edvard, история, 11 лет назад, По-русски
Editorial of Educational Codeforces Round 5 ### [problem:616A] Note that solutions in Java with BigInteger class or input() function in Python2 will fail in this problem. The reason is the next: standard objects stores numbers not in decimal system and need a lot of time to convert numbers from decimal system. Actually they are working in $O(n^2)$, where $n$ is the legth of the number. To solve this problem you should simply read the numbers to strings and add leading zeroes to the shorter one until the numbers will be of the same length. After that you should simply compare them alphabetically. [С++ solution](http://pastebin.com/CxwWwxu5) [Python solution](http://pastebin.com/zz0aW9Ke) Complexity: $O(n)$. ### [problem:616B] Firstly you should find the minimum value in each row and after that you should find the maximum value over that minimums. It's corresponding to the strategy of Jack and Emma. [C++ solution](http://pastebin.com/mCZtkNx9) Complexity: $O(nm)$. ### [problem:616C] Let's enumerate...
Unfortunately my solution for this problem had overflow bug. It was fixed on contest. Even so I

Полный текст и комментарии »

Разбор задач Educational Codeforces Round 5
  • Проголосовать: нравится
  • +63
  • Проголосовать: не нравится

161.
Автор vovuh, история, 7 лет назад, По-русски
Codeforces Round #605 (Div. 3) &lt;almost-copy-pasted-part&gt; Hello! [contest:1272] will start at [contest_time:1272]. You will be offered 6 or 7 problems (or 8) with expected difficulties to compose an interesting competition for participants with ratings up to 1600. However, all of you who wish to take part and have 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. You will be given 6 or 7 (or 8) problems and 2 hours to solve them. Note that **the penalty** for the wrong submission in this round (and the following Div. 3 rounds) is **10 minutes**. [Remember] (/blog/entry/59228) that only the <i>trusted participants of the third division</i> will be included in the ...

Полный текст и комментарии »

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

162.
Автор vovuh, история, 8 лет назад, перевод, По-русски
Codeforces Round #540 (Div. 3) Editorial [problem:1118A] Idea: [user:MikeMirzayanov,2019-02-20] <spoiler summary="Tutorial"> [tutorial:1118A] </spoiler> <spoiler summary="Solution"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { #ifdef _DEBUG freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); #endif int q; cin >> q; for (int i = 0; i < q; ++i) { long long n; int a, b; cin >> n >> a >> b; cout << (n / 2) * min(2 * a, b) + (n % 2) * a << endl; } return 0; } ~~~~~ </spoiler> [problem:1118B] Idea: [user:MikeMirzayanov,2019-02-20] <spoiler summary="Tutorial"> [tutorial:1118B] </spoiler> <spoiler summary="Solution"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { #ifdef _DEBUG freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); #endif int n; cin >> n; vector<int> a(n); int ePref = 0, oPref = 0, eSuf = 0, oSuf = 0; for (int i = 0; i < n; ++i) { ...
bool can(int i) { long long sum = 0; // there can be a bug for (int j = 0; j < n; ++j) { sum

Полный текст и комментарии »

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

163.
Автор s-sireneva, история, 2 года назад, По-английски
Bypassing Cloudflare's "bot fight mode", or how I wrote a working JS interpreter in a weekend... ...for fun and absolutely no profit. # Part 0. Introduction It so happened that I haven't written any Codeforces contest in a few months. When I was logging into my account to leave a comment under some post (I ended up not doing that), I noticed something weird:[cut]&#32; `Please wait. Your browser is being checked. It may take a few seconds...` After about half a second, this screen disappeared, and the normal login page showed up. But since I'm maintaining a CLI client for Codeforces, this immediately caught my attention with an intrusive question: did Mike break my client once again? After firing up a shell and trying to login, the answer was clear: yes, he did. # Part 1. "What the heck?" At the first glance, this screen looked suspiciously like the Cloudflare "Checking your browser" screen. This would have been a dead end, as even "professional" scrapers prefer using headless browsers and such instead of relying on "Cloudflare bypasses". The idea of the CLI tool ...
this JS blob is actually solving a PoW challenge. The bug turned out to be simple: after fixing the

Полный текст и комментарии »

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

164.
Автор aryanc403, 2 года назад, По-английски
Codeforces Educational Round 169 Video Editorial (with Hints) (A-F) [Full Video on youtube](https://www.youtube.com/watch?v=2cx3MFmCXu8) [problem:2004A] <spoiler summary="Idea"> Can the answer be YES if $N \ge 3$? </spoiler> My submission &mdash; [submission:276684814] <spoiler summary="Video Editorial"> <iframe width="853" height="480" src="https://www.youtube.com/embed/2cx3MFmCXu8?start=140" title="Codeforces Educational Round 169 Solution Discussion | ABCDEF" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> </spoiler> [problem:2004B] <spoiler summary="Idea"> In one of the optimal answer all the removed edges will be in some continous range. </spoiler> My submission &mdash; [submission:276687609] <spoiler summary="Video Editorial"> <iframe width="853" height="480" src="https://www.youtube.com/embed/2cx3MFmCXu8?start=810" title="Codeforces Educational Round 169 Solution ...
Exercise find out the bug in [submission:276586233]. I'm not sure if its hackable or not.

Полный текст и комментарии »

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

165.
Автор snapdragon3101, история, 7 лет назад, По-английски
CP Editor 2.0.3 : Everything you wanted is here Check : https://cpeditor.github.io ================== Hi Guys ! Around a week ago, I released the first version of CP Editor. If you are reading about CP Editor for first time. I request you to read my [previous blog](https://codeforces.me/blog/entry/71673) first. Many user liked it and I got many suggestions about enhancements and some bug reports as well. I liked your over whelming response, it made me happy. Now it's time for me to make you happy. Enough talking, let's get into what's new in CP Editor 2.0. It is a big release and hence a long blog ;-) ##### Dark theme Last time there was a dark theme but it only made the editor dark. So, it wasn't truly dark theme. Now with this new release CP Editor packs a system-wide dark theme. Have a look here ![ ](/predownloaded/93/a7/93a753ce9aa084ae9ccb0f2dfb38f95eebad9c3a.jpg) ##### Dependency Updates Just like any other software, CP Editor also have a long acyclic dependencies, and over the weeks many were updat...
##### New Session had a bug

Полный текст и комментарии »

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

166.
Автор eatmore, история, 6 лет назад, По-английски
My experience with Microsoft Q# Coding Contest Here I want to tell my personal opinion of the [Microsoft Q# coding contest](/blog/entry/77614). First, I'd like to thank Microsoft Quantum team for making a great contest in an unusual format. All the problems were interesting (except D problems ‒ more about them below), and I'm looking forward to similar contests in the future. However, there is a number of issues that I'd like to see discussed and hopefully fixed. The tools --------- The first problem with Q# compiler that everyone trying to use it will see is that it is SLOW. On my machine, compiling a trivial Hello World program takes about 45 seconds. This is a well known problem, reported both on [GitHub](https://github.com/microsoft/qsharp-compiler/issues/436) and even [here on Codeforces](/blog/entry/77614?#comment-642186), and frankly it's a PITA to wait so much after every fix to know if your code still compiles (or still doesn't). But this is only a tip of the iceberg. Before the contest, I decided to read the sou...

Полный текст и комментарии »

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

167.
Автор wuhudsm, история, 2 года назад, По-английски
Codeforces Round 960 (Div. 2) Editorial Thank you for participation and we hope you enjoy this round :) Additionally, we sincerely invite you to join the unofficial round of TheForces Community tomorrow. Compete alongside many high-rated participants and earn your own rating in a our own rating system([TheForces Rating System](https://theforces.netlify.app/ratings))! For more details, pls read https://codeforces.me/blog/entry/131733. #### [A &mdash; Submission Bait](https://codeforces.me/contest/1990/problem/A) <spoiler summary="hint1"> For Alice, what if choosing the maximum value doesn't work? </spoiler> <spoiler summary="hint2"> Consider parity. </spoiler> <spoiler summary="solution 1"> Case $1$: When all values appear an even number of times, Alice will lose. This is because no matter which number Alice chooses, Bob can mimic Alice's move. Case $2$: When at least one value appears an odd number of times, Alice will win. Alice only needs to choose the maximum value that appears an odd number ...
#ifdef i_am_noob #define bug(...) cerr << "#" << __LINE__ << ' ' << #__VA_ARGS__ << "- ", _do

Полный текст и комментарии »

Разбор задач Codeforces Round 960 (Div. 2)
  • Проголосовать: нравится
  • +92
  • Проголосовать: не нравится

168.
Автор adamant, история, 15 месяцев назад, По-английски
CP-Algorithms: Discord server, donation campaign and more Hi everyone! <img src="/predownloaded/82/15/821540e8f87d8a2b2d468377aacbba80b0aa1623.png" style="float:right;" width=100px> It was a while since I [posted](https://codeforces.me/blog/entry/135081) last update about **[CP-Algorithms](https://cp-algorithms.com)**. As a general reminder, it is a community project that [started off](https://codeforces.me/blog/entry/13198) in 2014 by [user:RodionGork,2025-08-23] as a translation of [e-maxx](http://e-maxx.ru/), a Russian go-to resource at the time by [user:e-maxx,2025-08-23] for learning core competitive programming algorithms. Since then, CP-Algorithms grew quite a lot (which also prompted a rename from original project name `e-maxx-eng`) and includes a lot of new, original articles, and a lot of translated articles were enhanced and/or extended or even completely rewritten. In this blog, I would like to share a bunch of updates about the site, to make sure it's still in the collective memory &#128517; ### New maintainers ...
- **[GitHub issues](https://github.com/cp-algorithms/cp-algorithms/issues)** marked with "bug" or

Полный текст и комментарии »

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

169.
Автор GM_Dan4Life, 2 года назад, По-английски
[Tutorial] Solving Range (Chmin, Chmax, Add, Assign) + Point queries Hi Codeforces! This is my first attempt at a tutorial blog XD. Disclaimer: No headaches occured during the making of this blog Problem statement ----------------- Given an integer array $A$ of length $n$ and $q$ of the following 5 types of queries: 1. For all $i \in [l,r]$, change $A_i$ to $\max(A_i, v)$ 2. For all $i \in [l,r]$, change $A_i$ to $\min(A_i, v)$ 3. For all $i \in [l,r]$, change $A_i$ to $A_i + v$ 4. For all $i \in [l,r]$, change $A_i$ to $v$ 5. Output $A_i$ - $ 1 \leq n,q \leq 10^6 $ - $ 1 \leq l \leq r \leq n $ - $ -10^9 \leq A_i, v \leq 10^9 $ The above is solvable with techniques like [Segment Tree Beats](https://codeforces.me/blog/entry/57319) in $\mathcal{O}(n+q\log^2{n})$, but as a binary search enthusiast, you didn't learn segment tree beats? Don't worry, here's an easier, faster, and shorter solution that solves this particular problem in $\mathcal{O}(n+q\log{n})$ Prerequisites ------------- You should know the following t...

Полный текст и комментарии »

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

170.
Автор Bruteforceman, история, 4 года назад, По-английски
OI Duel Bot Hi, I made a duel bot where you can challenge other users in a OI styled duel. It is sort of like a combination of regular duel matches and lockout challenges. You can find the bot at [OIDuelBot](http://t.me/OIDuelBot). The bot is currently available only for Telegram, but I have plans to make one for discord as well. ### Rules You can challenge other users in a OI styled duel. In the duel, you have to race against time to solve the subtasks before your opponent. If your opponent solves a particular subtask before you, they gets the point for that subtask, and you won't get any points for it even if you solve it in the future. The player with more points at the end of the duel wins the challenge. ### How to use First, you need to add the bot in a telegram group. Here are the commands you can use in the bot `/register [oj.uz username]` &mdash; you have to register yourself in order to enter your duel `/challenge [telegram username]` &mdash; you can challenge other user...

Полный текст и комментарии »

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

171.
Автор BledDest, 4 года назад, По-английски
Sad story of one commit So, first of all, I would like to apologize for the issue with the problem B in today's ER. We tried to fix it as quick as possible, but unfortunately, still lots of submissions were made and this caused a big queue during the round. I am sorry for this. How did this all happen? Well, this is really a sad story about one commit. About three hours before the round, while writing explanations for the problem B statement, I noticed that the answers were different from the correct values by 1. I opened the model solution in another tab in Polygon, wrote +1 to the value I printed, clicked "Save" and then committed the changes (including the notes for the samples). But, unfortunately, that change in the model solution wasn't included in the commit. The cause was that the model solution didn't save in time for the commit (and actually never saved for some reason, maybe some bug in the browser or Internet connection issues). I didn't notice that, and while rereading the problem again,...
for some reason, maybe some bug in the browser or Internet connection issues). I didn't notice that

Полный текст и комментарии »

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

172.
Автор Xellos, 12 лет назад, По-английски
Codeforces Trainings Season 2 Episode 8: Editorial [Complete problemset + tests + original presentation of solutions.](http://www.bapc.eu/problemset.zip) [Official scoreboard](http://bapc.eu/scoreboards/bapc/), [public contest scoreboard](http://www.bapc.eu/scoreboards/public/), [used for training elsewhere](http://www.cs.ubc.ca/~acm-web/practice/2014-10-25/scores.php). Short hints first, more detailed solutions afterwards. ### A. Avoiding the Apocalypse (difficulty: medium-hard, [code](http://ideone.com/JQOMyq)) Maxflow in a suitably selected graph. Ford-Fulkerson is sufficient. <hr> The vertices of our graph need to correspond to states that one person can be in when traversing the original road network; the number of people moving in a group is then represented by flow along edges. Therefore, the most natural choice is to use vertices corresponding to states (location, time). The rules from the problem statement say that at most $c$ people can move along an edge $e=(u->v)$ in the original at any time. That me...
empty), just bug-prone. Nothing else to add, you can read my code to understand better.

Полный текст и комментарии »

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

173.
Автор enot110, история, 10 лет назад, По-русски
CSAcademy Round #9 + prizes Hello, Codeforces! I would like to invite you to participate in a new [csacademy](https://csacademy.com) contest. [Round #9](https://csacademy.com/contest/round-9/) will take place on [Tuesday, July/26/2016 16:00 (UTC)](http://www.timeanddate.com/worldclock/fixedtime.html?msg=CS+Academy+Round+9&amp;iso=20160726T16&amp;p1=1440&amp;ah=2&amp;am=30). I will be one of the problem setters of these round, together with [user:mgch,2016-07-25] and the CSA team. This round will also feature some money prizes, as follows: - First place: 125$ - Second place: 100$ - Third place: 75$ - Fourth and fifth place: 50$ - Two more special prizes, each consisting of 50$. The criteria for the special prizes is not chosen yet, but we will make it public after the contest. This round will also feature problem statements in Russian. Many thanks to [user:Yury_Bandarchuk,2016-07-25] for doing all the translation work! #### Contest format: - You will have to solve **7** tasks in **2** hours and ...

Полный текст и комментарии »

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

174.
Автор snapdragon3101, 7 лет назад, По-английски
CP Editor 5.0 : Submit to codeforces right from CP Editor Check : https://cpeditor.org ================== Hi Guys! CP Editor met Competitive Companion in 3.0, giving it the ability to parse contests from over 30+ online competitive programming websites. Now, with CP Editor 5.0, it met CF tools, a wonderful tool by [user:xalanq,2020-01-09] which can do all most everything in code-forces, even submit solutions. Read more about CF tools in his [blog](https://codeforces.me/blog/entry/66552). *If you are a pro-user and like vim keybindings, using cf-tools on your favorite terminal with tmux would give your more than what CP Editor has to offer but at the same time, it is very time consuming and difficult to setup on windows.* Let's dive into what is new for us in CP Editor 5.0 - **Submit solution to Codeforces from CP Editor**, you don't need to copy or upload your solutions manually. Let CP Editor do it for you with just one button click. This feature requires that you have `cf-tools` installed and you have correctly configured c...
- There are many other bug fixes and quality of experience improvements. There are some performance

Полный текст и комментарии »

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

175.
Автор ZhangShan, история, 8 месяцев назад, По-английски
[Tool] stress.ojcloud.net — a free online stress tester **TL;DR:** I built **[stress.ojcloud.net](https://stress.ojcloud.net)** — a free online stress tester for competitive programmers. Paste your `main`, `brute`, and `gen` into three tabs, hit Run, and it streams per-test verdicts and stops at the first counterexample with `Input / Main Output / Brute Output` side-by-side. No signup, no install, 8 languages (C++ 03/11/14/17/20, C, Python/PyPy, Java, Kotlin, Go, Rust). ## Hello, Codeforces! If you've been doing CP for more than a week, you already know the routine. You submit, you get `Wrong answer on pretest 2`, the test is hidden, and your solution is 300 lines long. You open a terminal, `mkdir stress`, write the same `while true; do ./gen > in; ./a.out < in > out1; ./brute < in > out2; diff out1 out2 || break; done` you've written a hundred times, realize you forgot to seed the generator, rewrite it, forget to recompile `brute`, finally see a diff, and now you're squinting at 2000 random numbers trying to minimize the counterexamp...
## Demo: finding a real bug in ~30 seconds, ## Feedback / bug reports / feature requests

Полный текст и комментарии »

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

176.
Автор e-maxx, 16 лет назад, По-русски
g++: a new, more severe bug <p>During the yesterday contest we were "lucky" enough to discover a new bug in the g++ (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48695">here</a> is the previous bug, which was discussed here some time ago).<br><br>The bug becomes apparent <strong>in complex recursive functions with -O2 option turned on.</strong><br></p><p>In our case it was a segment tree, and the bug lead to wrong answer even on the sample test case (though without -O2 everything works ok). Interestingly, if we try to add debug output to our program, it started working right :) Of course, these symptoms may signify that it's our bad solution, but, to all appearance, it is not.</p><p><br></p><p>So, after the contest I simplified the program, and <strong>this is a minimal version of our program to show the bugs: <a href="http://pastebin.com/T74w3wmC">at pastebin</a>.</strong><br></p><p>From debug-outputs we can see, that with -O2 options turned on, the auxillary() function is called twice, returning 1 and 0...
g++: a new, more severe bug, By this moment the bug is confirmed, and also it is confirmed that it exhibits on , During the yesterday contest we were "lucky" enough to discover a new bug in the g++ ( , The bug becomes apparent in complex recursive functions with -O2 option turned on.

Полный текст и комментарии »

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

177.
Автор dendi239, история, 6 лет назад, По-английски
Micro- and macro-management for your next cpp source: General tips'n'tricks Hello, Codeforces! In this series of articles, I would like to tell you about tips'n'tricks I use in C++ sources. Some of them require a strong C++ background, some not, but all of them are aimed to reduce the time you spend on basic things like reading input/debugging/etc, so it might be useful for your next template. This part is dedicated to some basic tips (and probably should've been the first part but it's not ¯\\_(ツ)_/¯). <spoiler summary="TL;DR"> Full code: ~~~~ #include <bits/stdc++.h> using namespace std; using i64 = int64_t; using f80 = long double; using Str = string; template <class T> using Vec = vector<T>; template <class K, class V> using UM = unordered_map<K, V>; template <class T> auto &operator>>(istream &is, vector<T> &xs) { for (auto &x : xs) is >> x; return is; } namespace io { template <class ...As> auto &read(As &...as) { return (cin >> ... >> as); } template <class ...As> auto &log(const As &...as) { return ((cerr << " " << as...
But there's bug here:

Полный текст и комментарии »

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

178.
Автор baizhorz, 2 года назад, перевод, По-русски
Olympath AI: Create Custom Codeforces Polygon Problems with Ease Hi everyone, during the summer I have been creating a website that I thought would be useful for codeforces using the hot topic of LLMs and AI. It uses my favorite site to create problems Codeforces Polygon! I tried to make it easier to create simple problems. Thank you for the amazing site of codeforces polygon! The best way to create custom problems. It might have some bugs, I wanted to share it though so I can get opinions) **Exciting Update!** I'm thrilled to share that we now have around 200 users on our platform! We've fixed numerous bugs (though a few were bypassed with slower solutions) and added support for most of the languages available in Codeforces Polygon (Chinese, Spanish, Japanese, Hindi and many more). This will be the final update for a while, but I'm always open to and appreciative of your feedback! My next goal is to reach 500 users , so please share the site with your friends! Thank you for your continued support! Please need more users, we have reache...
**Bug Fixes** I am aware that the site wasn't working and takes (1-2) minute to load. Please have

Полный текст и комментарии »

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

179.
Автор AlexSkidanov, история, 8 лет назад, перевод, По-русски
Codeforces Round #488 by NEAR **UPD** note that the score distribution has changed **UPD2:** [user:LHiC,2018-06-17] found a bug in the author solution of div1-F. We are working on the situation. **UPD3:** we found a correct solution for div1-F and both submissions made during the contest pass all the tests against the correct solution. The round remains rated. Hi, everybody, Codeforces round 488 for both divisions will take place on [contest_time:993]. The round will be 2.5 hours long (which is 30 minutes longer than usual). The contest is created by [NEAR](http://near.ai/blog) and its friends. NEAR is working on teaching machines to compete in programming competitions. Read [our blog post](http://codeforces.me/blog/entry/59746) to learn more about the state of the art in the program synthesis today, our vision, and how you can help us bring this vision to reality. The contest will feature 6 problems for each division, with 4 problems shared across them. The problems for the contest are from t...
**UPD2:** [user:LHiC,2018-06-17] found a bug in the author solution of div1-F. We are working on

Полный текст и комментарии »

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

180.
Автор mahmoudbadawy, история, 5 лет назад, По-английски
IOI scoreboard for codeforces Problem ----- Have you wanted to host an OI style contest on codefroces but faced the problem of different scoring methods between IOI and codeforces? codeforces takes the maximum score over all submissions while IOI takes the maximum score over all subtasks then sums the score of the subtasks. Another difficulty was when the subtask has test cases with partial scoring. IOI takes the minimum achieved score while codeforces sums the scores of all cases in the subtask. codeforces scoreboard ----- I created an app that uses the API of codeforces to get the submissions then gets the results of each submission then recreates the scoreboard It also supports showing names for domain group users. Prerequisites ----- 1. You need an account with manager access to the required contests 2. You need to have an API token and secret generated using this account. Refere to this link to know how: [here](https://codeforces.me/apiHelp) 3. The problems must be configured with groups and...

Полный текст и комментарии »

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

181.
Автор Endagorion, 12 лет назад, По-русски
Codeforces Round #283 Hi, Codeforces. Today, [on December 17 at 19:30 MSK](http://timeanddate.com/worldclock/fixedtime.html?day=17&month=12&year=2014&hour=19&min=30&sec=0&p1=166) regular, 283-rd Codeforces round will take place. Problems are authored by me, Mikhail Tikhomirov. Maxim Akhmedov ([user:Zlobober,2014-12-17]) helped me with discussing and preparing the problemset, Maria Belova ([user:Delinur,2014-12-17]) translated problem statements in English, and Georgy Chebanov ([user:gchebanov,2014-12-17]), Alexander Mashrabov ([user:map,2014-12-17]) and Niyaz Nigmatullin ([user:niyaznigmatul,2014-12-17]) tested the round and helped us with finding bugs and mistakes; let's give them a round of applause! The round will be for both divisions. The scoring is standard (not dynamic); score distribution is as follows: **Div. 1: 750-1250-1250-2000-2500** **Div. 2: 500-1000-1750-2250-2250** This is going to be my fourth round at Codeforces. I really hope it will go as good as [three](http://codeforces...

Полный текст и комментарии »

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

182.
Автор BledDest, 2 года назад, перевод, По-русски
Kotlin Heroes 11 — Editorial This round was prepared by [user:Neon,2024-10-01], [user:adedalic,2024-10-01], [user:awoo,2024-10-01], [user:shnirelman,2024-10-01] and me. Huge thanks to all of the testers: [user:ashmelev,2024-10-01], [user:KIRIJIJI,2024-10-01], [user:PavelKunyavskiy,2024-10-01], [user:soup,2024-10-01] and [user:Fanarill,2024-10-01]! Your feedback helped us balance this contest (and find a very stupid overflow bug I'm too ashamed to mention). Thanks for participation, we hope you enjoyed the contest! [problem:2011A] Idea: [user:BledDest,2024-10-01], preparation: [user:BledDest,2024-10-01] <spoiler summary="Tutorial"> [tutorial:2011A] </spoiler> <spoiler summary="Solution (Neon)"> ~~~~~ fun main() = repeat(readln().toInt()) { readln().toInt() val a = readln().split(" ").map { it.toInt() } println(if (a.dropLast(1).contains(a.last() - 1)) a.last() - 1 else "Ambiguous") } ~~~~~ </spoiler> [problem:2011B] Idea: [user:BledDest,2024-10-01], preparation: [user:...
helped us balance this contest (and find a very stupid overflow bug I'm too ashamed to mention).

Полный текст и комментарии »

Разбор задач Kotlin Heroes: Episode 11
  • Проголосовать: нравится
  • +22
  • Проголосовать: не нравится

183.
Автор potatoArmy, история, 6 месяцев назад, По-английски
Cheaters in Round 1100 ### [user:thegscrypto.bot,2026-05-24] Evidence ------------------ 1. Lots of WA1/RE1/Compilation Error submissions 2. AI commented codes: [submission: 375834481] [submission: 375825486] [submission:375825486]. Mostly all of his submission are like this **Do you think its a cheater?** Yes! No, (comment why you think this) ### [user:Harshaii,2026-05-24] Evidence ------------------ AI commented codes: [submission: 375846083 ] [submission: 375846083] **Do you think its a cheater?** Yes! No, (comment why you think this) ### [user:gopal.thecoder,2026-05-24] Evidence ------------------ [submission:375836893]... bruh (if you can't view this submission, here's the code) <spoiler summary="Spoiler"> ~~~~~ I completely understand how frustrating that is! My previous fix strictly resolved the C# compilation error (the variable naming conflict) so your code could finall...
### The Math Behind the Bug

Полный текст и комментарии »

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

184.
Автор slycelote, 17 лет назад, По-английски
Codeforces FAQ (unofficial) (This FAQ may be outdated. Please refer to official <a href="http://codeforces.me/help">help</a>).<br><br> I'm sure we won't need this post after Codeforces comes out of beta, but meanwhile it could be useful :) Feel free to suggest what should be added here.<br> <br><h3 align="center"><b>Competitions: general</b></h3><span class="comment-content-22873"><b>Q.</b> What are the rules of these contests?<div><b>A.</b> Read <a href="http://codeforces.me/blog/entry/456">this</a>.</div></span><br><div><b>Q. </b>What languages are supported? What are the compiler options and run command lines? What is the configuration of judge servers?<br> </div><b>A.</b> <span class="comment-content-11692">The judge machines are Core 2 Duo, 2.67 Ghz (E6750). </span>The full list of supported languages and compiler options can be found in <a href="../79">this post</a><br><br><b>Q.</b> How do I hack other's solutions?<br><b>A.</b> First lock your own solution in the main ('problems') tab. Then in you...
Miscellaneous Q. I've found a bug! When I upvote a post, its

Полный текст и комментарии »

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

185.
Автор I_love_Hoang_Yen, 12 лет назад, По-английски
Being good competitive programmer correlates negatively with being good on the job? What do you think? Today I came across [this article](http://www.catonmat.net/blog/programming-competitions-work-performance/), in which "Peter Norvig said that one thing that was surprising to him was that being a winner at programming contests was a negative factor for performing well on the job". Normally I don't care about these topics, but this is from Google &mdash; where they have good population of high rated competitive programmers and the claim is backed with data. The article mentioned one point: "programming contest winners are used to cranking solutions out fast and that you performed better at the job if you were more reflective and went slowly and made sure things were right". Though I don't think this is true. For example, being competitive programmer taught me: 1. bugs can be everywhere & we must code carefully 2. many problems have amazing solutions, and it's not a good idea to start coding anything that comes to mind. Some comments talked about how competitive programmers ...

Полный текст и комментарии »

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

186.
Автор Nickolas, 9 лет назад, По-русски
April Fools Day Contest 2018: editorial #### [problem:952A] JAPE riddle generator is a program which can produce question-answer puns. This problem has been inspired by one of the witticisms produced by it: What do you call a quirky quantifier? An odd number. All you had to do was to check whether the given "quantifier" was "quirky". #### [problem:952B] This problem was inspired by the awesome book "Surely You're Joking, Mr. Feynman!" In one of his stories Feynman asks a librarian to fetch him a map of a cat, having a zoological chart in mind. Of course, such a serious interpretation was unsuitable for my purposes :-) This was a perfectly straightforward problem: just pet the cat! [cut] If the reaction you get is "no", try a different spot, otherwise you can figure out what kind of a cat this is right away. Just make sure you're not carried away: both kinds of cats get bored after 7th attempt to pet them and send you away without letting you guess their kind. One thing I didn't take into account was ...
This problem is based on a real bug in the checker for problem [problem:784G]. Fortunately, we

Полный текст и комментарии »

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

187.
Автор Princ_iple, история, 2 месяца назад, По-английски
Codeforces Practice Tracker is back — Version 2.0.0 Hi everyone! I know the extension has been unavailable on Chrome for a while. The old version was built on **Manifest V2**, and Google stopped accepting those extensions on the Web Store, so I had to rebuild it from scratch for **Manifest V3**. Codeforces Practice Tracker version 2.0.0 is now available. For those who don't know it, Codeforces Practice Tracker adds a new Statistics tab to any Codeforces profile and helps you track your practice progress through customizable time phases. **You can install it here:** [Chrome](https://chromewebstore.google.com/detail/cnahgdhboflcnojgmeehhhfeoojifonm?utm_source=item-share-cb) | [Firefox](https://addons.mozilla.org/en-US/firefox/addon/codeforces-practice-tracker/) UPD: Firefox version is now updated to 2.0.1. All future updates will be released for both Chrome and Firefox. ![ ](/predownloaded/be/ce/beced392795e1902f97c2633db5660c6efe0d1c3.png) --- ## What's new in v2.0.0 - Fully rebuilt with Manifest V3 - Customizabl...
- [Bug Report](https://forms.gle/j6wV4m578Kij8GZ49)

Полный текст и комментарии »

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