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

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

Results

1.

Goes

Last visit:  4 years ago
Registered:  9 years ago
2.
By YouKn0wWho, 5 years ago, In English
The Ultimate Topic List (with Resources, Problems and Templates) This post took $4$ years to make. And this is the most significant thing that I have ever shared in my whole life. #### Story Hi, I have been doing CP for like $4$ years and from the very beginning what I have been feeling is a need for a comprehensive topic list that will contain all sorts of topics from easy to advanced with corresponding tutorials, problem lists and templates so that I wouldn't have to look at different sites, from here to there. So what do you do when you think something is missing from the world? Yeah, you create that thing! So here I am, sharing the ultimate topic list that you will need in CP. When I say that it took me $4$ years to make it, I genuinely mean it. I have been collecting them from the inception of my CP journey and yesterday I thought that it got its almost complete shape. You may not imagine the sheer excitement hidden under each of the characters of this post. #### Payment You can pay me just by upvoting this blog and by being a bet...
what you can imagine. Hope that my efforts won't go in vain. I am waiting to see you at the top of the, won't go in vain. I am waiting to see you at the top of the building that you made by the bricks of

Full text and comments »

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

3.
By Rhodoks, history, 4 years ago, In English
Codeforces Round #810 Editorial Sorry for the late editorial. May this editorial help you. If you have questions, feel free to ask. [problem:1711A] <spoiler summary="hint1."> The minimal weight is at least $1$ since $1$ divides any integer (so $1$ divides $p_1$). </spoiler> <spoiler summary="solution"> Since $k+1$ does not divide $k$, a permutation with weight equal to $1$ is: $[n,1,2,\cdots,n-1]$. </spoiler> <spoiler summary="code"> ~~~~~ #include <bits/stdc++.h> using namespace std; void work() { int n; cin>>n; cout<<n<<' '; for (int i=1;i<n;i++) cout<<i<<' '; cout<<endl; } int main() { int casenum=1; cin>>casenum; for (int testcase=1;testcase<=casenum;testcase++) work(); return 0; } ~~~~~ </spoiler> [problem:1711B] <spoiler summary="hint1."> See the party as a graph. </spoiler> <spoiler summary="hint2."> Divide the vertices into two categories according to their degrees' parity. </spoiler> <spoiler summary="solution"> Let's consider ...
chooses to move, the first player always has a vertex to go after that., matter how the second player chooses to move, the first player always has a vertex togo after that

Full text and comments »

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

4.
By MikeMirzayanov, 7 years ago, translation, In English
About the Failed Round 591/Technocup 2020 — Elimination Round 1 Hi Codeforces! Unfortunately, ill-wishers thwarted the round by making DDOS on our infrastructure. Neither the coordinator nor the writers of the round are subjects to blame for the failure. Please do not downvote the announcement of the round. I think that this situation is an additional reason to support the writers. They worked hard and prepared good problems! Apparently, such an attack should be regarded as a symptom of the fact that Codeforces outgrew the youth phase and entered serious adult life. Of course, we will respond with adequate measures to protect ourselves from such incidents. Fortunately, for almost 10 years of work, a large community has formed around those who care about Codeforces. We are not worried about possible additional expenses or efforts. We can do this. The rounds must go on. &mdash; [user:MikeMirzayanov,2019-10-06] **UPD 1:** All three of today's rounds will be unrated. **UPD 2:** Hooray! Today we've survived another DDOS attack. The round ...
or efforts. We can do this. The rounds must go on., . The rounds must go on. — [user:MikeMirzayanov,2019-10-06] **UPD 1:** All three of

Full text and comments »

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

5.
By MikeMirzayanov, 6 years ago, In English
Codeforces EDU: β-testing (Now in English!) <img src="/predownloaded/47/86/4786c2ec901c0b5b490794ca6fd5145f0dcdeae3.png" style="float:right; width: 400px; margin: 0 1em 1em 1em"/> Hello Codeforces! In February, in the Russian-language interface, we announced a new educational subsection of the website. It's time to go international! I am pleased to invite you to test the new section, which so far has the working title EDU. I hope that someday EDU will become a real educational hub for fans of programming competitions. It will be great to have in one place the collected educational content with text and video materials, with selected thematic problems. At the moment, its functionality is still under development, and here is the current progress and <i>β</i>-testing preview. Write your comments and suggestions in the comments here. <center style="margin:2.5em;"> <a href="/edu/courses" style="text-decoration:none; font-size:18px; background-color:#01579B; color:white; font-weight:bold; padding:0.5em 1em;">Go to EDU ...
interface, we announced a new educational subsection of the website. It's time togo international, website. It's time to go international!, ; background-color:#01579B; color:white; font-weight:bold; padding:0.5em 1em;"> Go to EDU →

Full text and comments »

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

6.
By MikeMirzayanov, 22 months ago, In English
Codeforces celebrates its 15th anniversary! <img src="https://assets.codeforces.com/files/codeforces15.jpg" style="width:250px; float:right; margin: 0 1em 1em 1em;" /> Hi, Codeforces! Around this time, 15 years ago, I was deploying the first version of Codeforces on a server, registering my account, and writing the first post. 15 years have passed. Well, happy anniversary to us! For me, this is the most exciting adventure — full of ups and downs, hard work, and moments of joy. What's amazing is that it was never a lonely journey. I've always had caring and reliable friends by my side! That includes the Codeforces team, coordinators and problem writers, our partners in various events, all community members, and, of course, our sponsors — steadfast supporters and helpers. Look at what we've accomplished together! Here are some of the key metrics over the years. There seems to be plenty to celebrate! <center> <img src="https://assets.codeforces.com/files/15/01-submissions.png" class="resource" style="width:300px;"/>...
now I'll go enjoy a piece of birthday cake. Mike **P.S.** I've often been asked about, That's all for now, I think. And now I'll go enjoy a piece of birthday cake.

Full text and comments »

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

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

Full text and comments »

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

8.
By Radewoosh, history, 6 years ago, In English
My opinion on how to practice competitive programming I'm not very often replying to questions about how to practice, but as I'm getting enough of them (and I've just seen another blog about practicing) let me tell you about it. Of course, every time when you ask someone good about how to practice, he/she will reply to you to "solve a lot of problems" and that's true, there's no other way. Anyway, I've thought about it and actually I'm able to tell a bit more. I know some people, I've seen many people practicing (including me) and I have an opinion. Many people practice in some organized way. High schools organize IOI/OI training contests every Saturday, universities organize ICPC training contests once a week, people try by their own to solve three problems each day, websites host rounds and so on. Here's a secret: it's a sh*t. Yep, that's true. If you want to be really good and to make it happen you compete in a training once a week, you do it only to be able to make excuses "but I'm training so hard" when you see no progress. ...
them and you want to just practice weekly, then better go and reconsider if you really want to be, Do you really want to get better and compete virtually in two 5-hour contests in a row? Great,go, Do you think that you are bad at combinatorics? Good, you see your weaknesses, go solve some such, Do you want to participate in a virtual round? Sure, go and do this. Don't do this if you are sure, Do you want to simply solve a few problems? Great, go and solve them as long as they are, I know that this blog may discourage some people, but they wouldn't go far with such an attitude. I, Want to go and participate in a training organized by your university? Of course, great idea &mdash

Full text and comments »

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

9.
By MikeMirzayanov, 7 years ago, In English
Codeforces Round #639: the round is rescheduled Hello, Codeforces! Unfortunately, I report that I decided to reschedule this round. I'm afraid that something might go wrong. Some strange database behavior has appeared, which leads to slow operation in completely unexpected places (it never was and should not be). I will work hard to fix it. My recent tests show that this can dramatically increase judging time (and leads to a huge queue). I don't want to risk the efforts of the writer, the coordinator, testers, and your time. Sorry about it, I was trying to fix it for many hours but I need more time. Hope it will be a great round! Mike. **UPD 1:** I temporarily rescheduled it on May, 6. But I'll discuss the date with the writer and coordinator and reschedule it again to the date they want. **UPD 2:** [user:Monogon,2020-05-04] approved that [contest_time:1345] is good new date and time for the round. See you in 3 days! **UPD 3:** It seems I've fixed the issue. It turned that it was connected with [week ago incident](htt...
that something might go wrong. Some strange database behavior has appeared, which leads to slow, Unfortunately, I report that I decided to reschedule this round. I'm afraid that something mightgo

Full text and comments »

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

10.
By MikeMirzayanov, 3 weeks ago, In English
Codeforces Round 1134 (Div. 4) Hello Codeforces! I am glad to invite you to [contest:2290], which will take place on [contest_time:2290]. After quite a long break, I have taken up problem setting again — this time working together with AI agents. For me, this is an experiment in getting back into problem writing, and we will see together how successful AI turns out to be as a partner in this work. I am looking forward to seeing both Div. 4 participants competing officially and everyone else joining out of competition! <div style="height:1em;"></div> <spoiler summary="Why I decided to author this round (a bit of lyrics and rambling)"> Yes, I am dictating these words into my phone right now, to put them into shape for you a bit later. We live in an amazing time when so many things are changing. I have been programming for more than 25 years now, and throughout almost all of this time I wrote code every day and solved problems every day. At first, these were mostly programming contest problems — ...
peak moments some of them now go to the aux fleet, leaving the main farm freer for everything else, prepare problems, go through this whole process, and look at it from the inside. I worked on most of, to any other form of cheating. Instead, let's go through this intellectual holiday together — me, with and prepare problems, go through this whole process, and look at it from the inside.

Full text and comments »

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

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

Full text and comments »

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

12.
By MikeMirzayanov, 7 years ago, In English
Goodbye 2019. Hello 2020! <img src="/predownloaded/85/58/8558df7ac8a1c33d501ea8fd9b18dd3d95886b90.png" style="width:290px; float:right; margin: 0 1.5em 1.5em 1.5em"/> I am happy to wish you a Happy New Year! I wish you a great, bright, interesting New Year! Just believe that it can become so: difficulties will be left behind, and ahead of you will be a joy of victories and discoveries. I wish all of us new interesting problems, records and achievements! Set new goals and be sure to try to achieve them! And do not go far, we will try to make your 2020 year more fun! I thank with all my heart for the contribution to the community of coordinators, problem writers, testers, and those who wrote interesting posts and comments. Many thanks to the sponsors, partners and customers: you help the community not to stand still, give the opportunity to hold interesting events. Thanks to all visitors to the website and just not indifferent. See you in the new year! &mdash; [user:MikeMirzayanov,2019-12-31]
try to achieve them! And do not go far, we will try to make your 2020 year more fun!, go far, we will try to make your 2020 year more fun! I thank with all my heart for the

Full text and comments »

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

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

Full text and comments »

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

14.
By Um_nik, history, 5 years ago, In English
Things I don't know I'm just in a mood to shitpost. Don't take it too seriously. Things that I have heard of, but don't know (imagine how many things I haven't even heard of): - Li-Chao Segment Tree - Segment Tree Beats - RMQ in $O(n)$/$O(1)$ - Any self-balancing tree except treap - Link-cut tree - Wavelet tree - Mergesort tree - Binomial heap - Fibonacci heap - Leftist heap - Dominator tree - 3-connected components in $O(n)$ - $k$-th shortest path - Matching in general graph - Weighted matching in general graph - Preflow-push - MCMF in $O(poly(V, E))$ - Minimum arborescence (directed MST) in $O(E \log V)$ - Suffix tree - Online convex hull in 2D - Convex hull in 3D - Halfplane intersection - Voronoi diagram / Delaunay triangulation - Operation on formal power series (exp, log, sqrt, ...) (I know the general idea of Newton method) - How to actually use generating functions to solve problems - Lagrange Inversion formula - [...
learning useless algorithms, go and solve some problems, learn how to use binary search., . Stop learning useless algorithms, go and solve some problems, learn how to use binary search.

Full text and comments »

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

15.
By Radewoosh, history, 8 years ago, In English
Blogewoosh #1 Hello, codeforces! The community wants so the community gets it! :D Here it is, my very first blog about tasks and algorithms. At the beginning I've decided to post my entries on codeforces, maybe I'll switch to something different if it becomes uncomfortable. To pour the first blood I decided to choose a task from one of the old ONTAK camps. Task's name is "different words" ([you can submit here](https://szkopul.edu.pl/problemset/problem/wTy-sxQCIKry0Ml-6RvM0L78/site/?key=statement)). The statement goes as follows: You are given $n$ words ($2 \leq n \leq 50\,000$), every of length exactly $5$ characters. Each character can be a lowercase letter, an uppercase letter, a digit, a comma... basically, it can be any character with ASCII code between $48$ and $122$ (let's say that $k$ is the number of possible characters). A task is to find all pairs of indexes of words which are $\textbf{really different}$. Two words are $\textbf{really different}$ if they differ at all $5$ corres...
ones to characters. We should assign them to pairs $(character, position)$. Then everything willgo, some way, but I won't go deeply into this solution, cause it isn't interesting and $k$ is of course, , but I won't go deeply into this solution, cause it isn't interesting and $k$ is of course bigger

Full text and comments »

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

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

Full text and comments »

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

17.
By TLE, history, 8 years ago, In English
Linear Recurrence and Berlekamp-Massey Algorithm **#IjustWantContribution** It seems there isn't any blog about Berlekamp-Massey Algorithm around here, so I decided to go on a try. :P Acknowledgement: Hats off to matthew99 for introducing this algorithm. #### What is 'linear recurrence'? Assuming there is a (probably infinity) sequence $a_0,a_1...a_{n-1}$, we call this sequence satisfies a linear recurrence relation $p_1,p_2...p_m$, iff $\forall i \geq m,~a_i=\sum_{j=1}^m a_{i-j}p_j$. (Obviously, if $m\geq n$ any $p$ can do :P) #### How to calculate k-th term of a linear recurrence? For a polynomial $f(x)=\sum_{i=0}^{t} c_ix^i$, we define $G(f)=\sum_{i=0}^{t} c_ia_i$. Obviously $G$ satisfies $G(f)\pm G(g) =G(f \pm g)$. Because $a_i=\sum_{j=1}^m a_{i-j}p_j$, if we let $f(x)=x^m-\sum_{j=1}^m x^{m-j}p_j$, then $G(f)=0$. Also $G(fx),G(fx^2)...=0$. So $G(fg)=0$ (g is any polynomial). What we want is $G(x^k)$. Because $G(f\lfloor x^k/f\rfloor)=0$, then $G(x^k)=G(x^k \bmod f)$. [cut] We can calculate $x^k \b...
here, so I decided to go on a try. :P Acknowledgement: Hats off to matthew99 for introducing, sequence at current position $t$ (from 1 to n). If we got $a_t$, then it's still good,go on. Assume, trips, for every trip he will start from some node, make at least one step (i.e.go through at least, It seems there isn't any blog about Berlekamp-Massey Algorithm around here, so I decided togo on a

Full text and comments »

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

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

Full text and comments »

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

19.
By Um_nik, history, 2 years ago, In English
On AI ruining "solving math problems with computer" You all went crazy. Instead of arguing with every opinion separately, I just want to ask one question: Why are you doing competitive programming? Is it to get to 1600 rating and put it on the resume? If so, please use AI, cheat, and do everything possible to get to 1600 as soon as possible and get the f**k out of this platform. And if you are (not) a normal person and do competitive programming because it is fun to solve problems, do you think it is fun to copy the problem statement into an AI model prompt and then copy the code it spews to submit? And why do you assume that everyone else will do that if there will be such an opportunity? The same goes for cheaters. Yes, some people do not do this as a sport, for fun. Why do you care? I do think that AI is ruining competitive programming. By proxy. And that proxy is all of you who are running around yelling "We will all die, somebody do something about AI". I have seen a couple of comments saying "authors/coordinators must make s...

Full text and comments »

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

20.
By Error_Yuan, history, 3 years ago, In English
Goodbye 74TrAkToR + Problem A~E: The problems themselves are good and typical A~E. Indeed I like problem D. The pretest for A is a bit weak, and it's not a big problem yet. + Problem F: The problem has an origin. :) See the link: [click](https://www.luogu.com.cn/problem/P9394). The problem in contest is only a weakened version of the one in Luogu. + Problem G: It's said that our great coordinator had not proved the time complexity of the intended solution is correct :) If the authors did, please share it in the editorial. (although this problem is completely beyond my ability :) ) + Problem H: Oh dear [user:74TrAkToR,2023-12-30], could you please OEIS the sequence before you use the "several-integer-input" problem in rounds next time? Anyone who copied the first example and opened [https://oeis.org/A286331](https://oeis.org/A286331) could quickly get the formula. And the problem itself is not so hard imo. Anyway, it should not be used in contest, especially for the last problem. For me pers...

Full text and comments »

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

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

Full text and comments »

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

22.
By -is-this-fft-, history, 5 years ago, In English
Self-deception: maybe why you're still grey after practicing every day I generally don't like to give much advice on "how to practice", but recently I have been thinking a lot about this and I realized that there is something that I believe affects a lot of people (though it is admittedly hard to tell) that barely gets talked about: self-deception. Self-deception is a devious thing. It can be very hard to detect, yet can be fatal to improvement. This blog is mainly directed to greys, greens and cyans that can't get out of these categories. Most examples are given with that in mind. That being said, I believe others have something to think about as well. This is my first blog on such "psychological issues" and I don't know if I'll ever make another one. It's certainly a difficult topic to write about because for most of the blog, the message is "your practice is not as good as you think it is" or even "you aren't as good as you think you are" which can of course be a hard thing to hear. Thus, I have to somehow be very gentle while getting the poin...
to think. If you go deep into every problem, you might see yourself being able to come up with that, you are depriving yourself from the part of practice that teaches you to think. If yougo deep into

Full text and comments »

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

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

Full text and comments »

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

24.
By NXIST_buster, history, 6 years ago, In English
Corruption, Cheating at ICPC Yinchuan This blog is about Corruption and Cheating at ICPC YinchuanRegional. ICPC Yinchuan Regional is one of the ICPC regional contests for students competing in the geographic area of Asia East Continent. I. Background: General Info ------------------ Ningxia Institute of Science of Technology, or NXIST is a higher education institute in China. Since 2019, NXIST has held two regional contests. The and both were considered by many participants as jokes, yet until today participants are unaware of the NXIST's extent of evil. Zhihu is a Chinese website similar to Quora, and I will refer to this website for information. II. Background: Before 2021 ------------------ Regional competitions in China consists of two stages: The online selection contest and the onsite regional contest. As there are many contestants in China, the online contest is considered serious and rules are usually strictly enforced, with entire universities where some participant cheats disqualified from attend...
400 teams. With most strong teams unwilling to go to the "Joke" regional, weak teams advanced to WF, regional of over 400 teams. With most strong teams unwilling to go to the "Joke" regional, weak teams

Full text and comments »

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

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

Full text and comments »

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

26.
By Enchom, 12 years ago, In English
Who sorry_dreamoon really is Hello everybody. So I was really bored tonight and looked at so many comments being like "[user:sorry_dreamoon,2015-02-18] is X" and then people arguing and disagreeing. Since I had nothing better to do, I decided to finally unravel the truth of who he actually is. Here is the full case and how I actually got to him, hope you enjoy! :D Selection ------------------ Let's start by the obvious. He managed to get first place in Div2 and he got second in Div1 (would've been first if the scores were static). So what we know is that he is really good. Let's look at the past 10 Div1 contests. It turns out that only 8 times it happened that someone with a rating of less than 2500 got in top5. This is 8 times out of 50 people being in top5. But he was second and almost first, so he is better than that. It turns out actually, that in the past 10 Div1 contests, only 2 times it happened that someone with rating less than 2500 got in top3. Combining this information with [user:sorr...

Full text and comments »

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

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

Full text and comments »

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

28.
By SanguineChameleon, 19 months ago, In English
Seems like a notorious coincidence #### _1 minute before contest starts_ Alright, this is it. The round is starting soon. I hope everything goes well! #### _9 minutes after contest starts_ ...What? Someone solved H already? Uh oh. Okay, maybe they are just really good at XOR problems. #### _40 minutes after contest starts_ Oh! An LGM solved it. Let's look at their submission... ~~~~~ // https://yukicoder.me/problems/no/2990 ~~~~~ Oh. Oh no. Oh no no no no no. --- Hi, so to me seems like a notorious coincidence. I was the author of problem H, and unfortunately, it exactly coincides with [No.2990 Interval XOR](https://yukicoder.me/problems/no/2990) on yukicoder. Just to be **absolutely clear**, I had the idea for H long before that: - I thought of problem H in January 2024. - The problem was proposed in February 2024. - The problem was approved in October 2024. - The problem on yukicoder was released in December 2024. Here are some obligatory evidence screenshots: <spoile...

Full text and comments »

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

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

Full text and comments »

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

30.
By antontrygubO_o, 6 years ago, In English
Some thoughts on recent discussions Hello everyone! I finally decided to write some response/explain my view after all recent discussions of my problems and rounds I coordinate, and I would like to make a few points. **1.** After some recent contests there were a lot of comments saying that Data structure problems should appear as easy problems (say, D2A-D2D in a Div2 of $6$ problems) ![ ](https://i.imgur.com/fmA8zgE.png) ![ ](https://i.imgur.com/m4pJLv6.png) ![ ](https://i.imgur.com/JsryG77.png) I don't think I agree with this. To begin with, I don't think that having Data Structure problem is a requirement for a good contest at all, not just in first few positions. ![ ](https://i.imgur.com/VWAOgxg.png) However, for positions D2A-D2D, I just don't see a way to properly include data structure problems. Take some Data Structure problem, it consists from two parts: <ul> <li> Knowing/implementing the Data Structure </li> <li> Actually thinking about the problem, and how this Data Structure...

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

33.
By zscoder, history, 7 years ago, In English
[Tutorial] Generating Functions in Competitive Programming (Part 1) Hi everyone! Inspired by the recent [Codeforces Round 641](https://codeforces.me/contest/1349), I decided to write an introductory tutorial on generating functions here. I am by no means an expert in generating functions so I will write about what I currently know about them. [user:MiFaFaOvO,2020-05-15] has written a really interesting [blog](https://codeforces.me/blog/entry/76447) here on Codeforces about more advanced applications of generating functions, but I think there is no English tutorial on the basics of this topic yet (or at least on CP sites). Thus, I would like to share about this topic here. I plan to split this tutorial into two parts. The first part (this post) will be an introduction to generating functions for those who have never learned about them at all, and some standard examples and showcases of generating functions. The second part will be a collection of several applications of generating functions in CP-style problems. If you are already familiar with ge...
There are many other similar applications of the Snake Oil Method but I won't go into detail here

Full text and comments »

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

34.
By tourist, 4 years ago, translation, In English
Codeforces Round #844 (Div. 1 + Div. 2) Hello! Welcome to the [contest:1782] that will start on [contest_time:1782]. It will be a combined rated round for both divisions and open to everyone. This round is a mirror of VK Cup 2022 Elimination — annual programming championship for Russian-speaking competitors organized by VK. VK Cup [started in 2012](https://codeforces.me/vkcup2012) and has grown to be a five-track competition in competitive programming, Mobile, ML, Go, and JavaScript. All the problems are authored and prepared by me. Thanks to [user:KAN,2023-01-13], [user:errorgorn,2023-01-13], [user:lperovskaya,2023-01-13], [user:dario2994,2023-01-15], [user:Monogon,2023-01-15], [user:Arpa,2023-01-15] for making this round better. You will be given 8 problems and 3 hours to solve them. **UPD**: [Editorial](https://codeforces.me/blog/entry/111783) Congratulations to the winners: 1. [user:orzdevinwang,2023-01-24] 2. [user:noimi,2023-01-24] 3. [user:Radewoosh,2023-01-24] 4. [user:gamegame,2023-01-24] ...
competitive programming, Mobile, ML, Go, and JavaScript. All the problems are authored and, has grown to be a five-track competition in competitive programming, Mobile, ML,Go, and JavaScript.

Full text and comments »

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

35.
By Luqman, history, 9 years ago, In English
Teams going to ACM ICPC World Finals 2018 I think it's good time for collecting teams that are going to WF this year. Let's complete the table together :) Europe ====== | Count | Country | Region | University | Member 1 | Member 2 | Member 3 | | ----- | ------- | ------ | ---------- | -------- | -------- | -------- | | 1 | Belarus | NEERC | Belarusian State University | [user:progmatic,2018-04-12] | [user:Fedosik,2018-04-12] | [user:vilcheuski,2018-04-12] | | 2 | Estonia | NEERC | University of Tartu | [user:oml1111,2018-04-12] | [user:hoomas,2018-04-12] | [user:k__mas,2018-04-12] | | 3 | Kazakhstan | NEERC | Kazakh-British Technical University | [user:Zharaskhan,2018-04-12] | [user:AeonHQ,2018-04-12] | [user:NurlashKO,2018-04-12] | | 4 | Russia | NEERC | Moscow Aviation Institute | [user:mingaleg,2018-04-12] | [user:SirRembocodina,2018-04-12] | [user:i.trofimow,2018-04-12] | | 5 | Russia | NEERC | Moscow Institute of Physics & Technology | [user:Golovanov399,2018-04-12] | [user:Kostroma,2018-04-12] | [user:I_hate_A...

Full text and comments »

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

36.
By Um_nik, history, 5 years ago, In English
How to practice Competitive Programming [Um_nik version] CP is about solving problems fast. And as absurd as it may sound, I believe that <span style="color:blue">SOLVE</span> and <span style="color:red">FAST</span> are very different and almost independent parts, and you need to practice them separately. Let’s look at some <span style="color:red">contest</span>, like a CodeForces round. For the sake of simplicity let’s assume that every problem has some *difficulty*, which is a numerical value denoting how hard it is, bigger values correspond to harder problems (it is not true, but it is an ok-ish approximation, at least if we consider subjective difficulty for a fixed person). Contests are made for a wide range of participants, and problemsetters strive to make contests interesting for a wide range of participants, which means having a *smooth difficulty gradient*. Well... as smooth as it is possible with 5-6 problems. <spoiler summary="Graph 1"> ![ ](https://s3.us-west-2.amazonaws.com/secure.notion-static.com/677e0ae2-a8df-4874-aff...
to do that? The answer is rather simple: go to a place that has a lot of problems of various

Full text and comments »

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

37.
By arsijo, 7 years ago, translation, In English
Технокубок 2020 — Отборочный Раунд 1 (и открытые рейтинговые раунды Codeforces Round 591 Div.1, Div.2) Добрый день! <p><a style="float:right;margin:0 0 1em 1em;" href="http://codeforces.me/technocup2020"><img src="http://assets.codeforces.com/images/technocup-narrow-logo.png"/></a> В [contest_time:1223] состоится <a href="/contests/1223">Отборочный Раунд 1</a> олимпиады для школьников <a href="http://codeforces.me/blog/entry/70187">Технокубок 2020</a>. Раунд будет длиться два часа, участникам будут предложены 7 задач. По его результатам лучшие участники (но не более 45% от общего числа участников раунда) будут приглашены на финальный этап в Москву. Для регистрации на раунд и участия перейдите <a href="http://codeforces.me/contests/1223">по ссылке</a>. Не забудьте заранее зарегистрироваться на раунд! Для опоздавших будет открыта дополнительная регистрация. <p style="text-align:center"> <a style="font-size:20px;" href="http://codeforces.me/contests/1223">Зарегистрироваться на Отборочный Раунд 1 &rarr;</a> <br/> <small>Соревнование открыто для всех в виде отдельных ...
:3195513], [submission:3794163] | | D | D | [submission:5482410], [submission:2060057] | |Go | Go, ], [submission:3794163] | | D | D | [submission:5482410], [submission:2060057] | |Go | Go

Full text and comments »

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

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

Full text and comments »

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

39.
By bicsi, history, 6 years ago, In English
I might get stigmatized for this, but here it goes Recently, Moscow Fall Workshops has taken place (it ended about one week ago), and I wanted to address some issues that came into my mind during that period. As you might notice, it took me some time to build the courage and get in the right mindset to write about this. First of all, I want to say that I am a huge supporter of programming camps and, in general, initiatives to enhance the joy of doing competitive programming and I respect the efforts of building communities around CP. I have always had a kind of excitement when thinking about participating in programming camps (Petrozavodsk, Moscow Workshops, etc.) and their “hardcore” style with lots of contests. I therefore appreciate the immense efforts of organizers, problem setters, and testers, when preparing this camp. ### Main point Coming towards the main point of the blog, I felt that the last programming camp was a bit… underwhelming. Moreover, I’m having a hard time trying to justify the costs of doing such a camp,...

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

42.
By MikeMirzayanov, 5 years ago, In English
I am Mike Mirzayanov. AMA! <img src="/predownloaded/3f/31/3f31c3ac1f7b4e53128fc9708f5736eea40d7b94.jpg" style="width:250px; margin:1em 0 0 0; float:right;"/> But why not! Many people here seem to know me. Or maybe not quite? I am ready to answer your questions. Ask me anything! I plan to spend no more than 3 hours on answers. Sorry if I can't answer all the questions. Let's more or less follow the rules from here https://www.reddit.com/r/IAmA/wiki/index Below is actually a quote from the rules. The interviewee begins the process by starting a post, describing who they are and what they do. Then commenters from across the internet leave questions and can vote on other questions according to which they would like to see answered. The interviewee can go through and reply to the questions they find interesting and easily see those questions the internet is dying to have the answer to. Because the internet is asking the questions, they're going to be a mix of serious and lighthearted, and you'll ...
would like to see answered. The interviewee can go through and reply to the questions they find, The interviewee can go through and reply to the questions they find interesting and easily see

Full text and comments »

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

43.
By MinakoKojima, history, 11 years ago, In English
My sad story Teams advancing to 2016 WF Phuket in Asia have been announced recently. This announcement is undisputedly tantamount to a death sentence for me. I am the one waiting anxiously, refresh Dr. Hwang's blog everyday. But it seems that for years, our training was meaningless. I think many of us dedicate our passion to programming contests because we see them transparent, fair and without any corruption. And I also believe that as contestants, what we should do is only focus on the practice. And I thought those political business should never come to bother me one day. But sadly, it is my team who is going to become one of the sacrifices of a succession of the dissension. What happened so far ------------------ The quarrel between the Asia director and the local community is [a long story](http://blog.sina.com.cn/s/blog_b946da100101q21y.html) to tell. But it has never been as serious as it was in the past season. Now reflecting on this, I know on the surface everything is going okay...
far as I know, there is no team in our region in history which get 2nd place but cannotgo to final, place but cannot go to final. And the logic is the same as what he has done on the [Chennai flood, . As far as I know, there is no team in our region in history which get 2nd place but cannotgo to

Full text and comments »

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

44.
By errorgorn, 3 years ago, In English
Confession: I sent problem H to goodbye Going to be 100% honest here, I sent problem H to goodbye. I feel really bad to authors of Goodbye 2023 for ruining their round, it seems the round would have been better by just removing H. As much as the community is out here roasting [user:74TrAkToR,2023-12-31], I also had a part to play in this contest. I wish to be as transparent as I can here without saying any classified information (apologies to [user:KAN,2023-12-31] and [user:74TrAkToR,2023-12-31] if anything here shouldn't be disclosed). To give some context, here is what went down in goodbye round from my perspective: - 13 days before contest: KAN asks me if I can source a 1E for goodbye. I asked traktor to send me the testing gym so that I could gauge how hard the 1E should be. He told me he will send me after he translates the statements. (UPD: Note that the IMO 1986 problem was already removed before this stage which is why a new 1E was needed, I never saw this IMO problem) - 11 days before contest: traktor send it...
However, it seems that these days there are simply too little div 1 rounds to go around for the

Full text and comments »

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

45.
By tourist, history, 7 years ago, In English
Codeforces Global Round 5 Editorial Enjoy! <spoiler summary="A. Balanced Rating Changes"> [tutorial:1237A] <spoiler summary="Solution by tourist"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; int flag = 1; for (int i = 0; i < n; i++) { int x; cin >> x; if (x % 2 == 0) { cout << x / 2 << '\n'; } else { cout << (x + flag) / 2 << '\n'; flag *= -1; } } return 0; } ~~~~~ </spoiler> </spoiler> <spoiler summary="B. Balanced Tunnel"> [tutorial:1237B] <spoiler summary="Solution by tourist"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int> a(n), b(n); for (int i = 0; i < n; i++) { cin >> a[i]; --a[i]; } for (int i = 0; i < n; i++) { cin >> b[i]; --b[i]; } vector<int> pos(n); for (int i = 0; i < n; i++) { pos[b[i...
+ 2 * n, psum + 1); pair2 ans = {inf, -1}; for (int j = 0; j < maxk; j++) go [j][2 * n, curans = 0; for (int j = maxk - 1; j >= 0; j--) if (go[j][cur].fi <= to, ]; ll psum[2 * maxn]; pair2 go[maxk][2 * maxn]; map lst[maxn]; int id[2 * maxn, ll a[2 * maxn]; ll psum[2 * maxn]; pair2 go[maxk][2 * maxn]; map lst[maxn]; int

Full text and comments »

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

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

Full text and comments »

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

47.
By Radewoosh, history, 8 years ago, In English
Blogewoosh #2 Hello, codeforces! All signs in the sky and on the ground indicate that you've enjoyed my first blog, so here is the second one. I've decided to choose a Polish task again, as there are plenty of interesting ones. This time we'll take a look at the "plot purchase" ([you can submit here](https://szkopul.edu.pl/problemset/problem/hwbyoUkNFPXQLOPcw3x5huTR/site/?key=statement)), which is a bit easier, but a few years ago I was very proud of myself when I solved it. The statement goes as follows: You are given a square $n \times n$ grid ($1 \leq n \leq 2000$). In every cell, there is a number from the range $[1, 2 \cdot 10^9]$. You are also given an integer $k$ ($1 \leq k \leq 10^9$). A task is to find a subrectangle of this grid such that the sum of values in this subrectangle lies in the range $[k, 2\cdot k]$ (or report that there is no such subrectangle). Just print coordinates of its opposite corners. [cut] $ $ If the problem would be more difficult, and we'd be asked to fi...
$(1, 1)$. Secondly, for each cell, we know how far can we go down until we meet either a forbidden, \cdot k$, then we need to try a smaller one. Here comes idea which most of the people wouldgo through, how far can we go to the down in each of the columns. Then, if we have some interval of columns, $, then we need to try a smaller one. Here comes idea which most of the people wouldgo through while

Full text and comments »

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

48.
By MikeMirzayanov, history, 4 years ago, In English
Automatic Translation of Problem Statements in Polygon Hello, Codeforces. I have implemented automatic translation of problem statements in Polygon (yes, yes, through ChatGPT). Here's an example of how to use it: <img src="/predownloaded/5e/bb/5ebb50faa4876d45dd8d7dab3640e6ac598d96a3.png" style="float:right; margin: 0 1em 1em 1em; max-width: 500px; width:500px;"/> * Suppose we have a problem statement only in Russian and we want to have it in English as well. * Create an empty problem statement in English. * Go to the bottom of the problem statement and click on "Add automatic translation." * In the popup window, you can choose the original language for translation (we only have Russian, so there's nothing to choose) and the section of the problem statement to translate (by default, it usually selects the appropriate option &mdash; translate everything). * Click the "Translate" button. * Wait for ChatGPT to translate the text (it may take up to a couple of minutes). * When the translation is ready, it will be loa...
in English as well. * Create an empty problem statement in English. * Go to the bottom of the, * Go to the bottom of the problem statement and click on "Add automatic translation.", There are a few more ideas on how to use ChatGPT for peaceful purposes. Don't go too far.

Full text and comments »

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

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

Full text and comments »

50.
By -is-this-fft-, history, 5 years ago, In English
[Tutorial] Collection of little techniques #### Introduction There are a number of "small" algorithms and facts that come up again and again in problems. I feel like there I have had to explain them many times, partly because there are no blogs about them. On the other hand, writing a blog about them is also weird because there is not that much to be said. To settle these things "once and for all", I decided to write my own list about about common "small tricks" that don't really warrant a full tutorial because they can be adequately explained in a paragraph or two and there often isn't really anything to add except for padding. This blog is partly inspired by [user:adamant,2022-03-15]'s [blog](48417) from a few years ago. At first, I wanted to mimic adamant's blog structure exactly, but I found myself wanting to write longer paragraphs and using just bolded sentences as section headers got messy. Still, each section is short enough that it would not make much sense to write separate blogs about each of these things. A...
A first attempt at solving might go like this. As always, we maintain an active segment. We keep a, ~~~~~ 1 # we go from large to small so that the already updated dp values won't affect any

Full text and comments »

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

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

Full text and comments »

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

52.
By HosseinYousefi, 12 years ago, In English
C++ Tricks I see lots of programmers write code like this one: ~~~~~ pair<int, int> p; vector<int> v; // ... p = make_pair(3, 4); v.push_back(4); v.push_back(5); ~~~~~ while you can just do this: ~~~~~ pair<int, int> p; vector<int> v; // ... p = {3, 4}; v = {4, 5}; ~~~~~ [cut] [This](http://codeforces.me/blog/entry/10124) is a great C++11 tutorial for those who want to know more about C++11. #### 1. Assign value by a pair of {} to a container I see lots of programmers write code like this one: ~~~~~ pair<int, int> p; // ... p = make_pair(3, 4); ~~~~~ while you can just do this: ~~~~~ pair<int, int> p; // ... p = {3, 4}; ~~~~~ even a more complex `pair` ~~~~~ pair<int, pair<char, long long> > p; // ... p = {3, {'a', 8ll}}; ~~~~~ What about `vector`, `deque`, `set` and other containers? ~~~~~ vector<int> v; v = {1, 2, 5, 2}; for (auto i: v) cout << i << ' '; cout << '\n'; // prints "1 2 5 2" deque<vector<pair<in...

Full text and comments »

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

53.
By tourist, history, 10 years ago, translation, In English
VK Cup 2017 Round 3 + Codeforces Round #412 -- Tutorial Here is the tutorial of VK Cup 2017 Round 3 and Codeforces Round #412. Enjoy! <spoiler summary="Is it rated?"> [tutorial:807A] <spoiler summary="Code"> ~~~~~ n = int(input()) results = [] for i in range(n): results.append(list(map(int, input().split()))) for r in results: if r[0] != r[1]: print("rated") exit() for i in range(n): for j in range(i): if results[i][0] > results[j][0]: print("unrated") exit() print("maybe") ~~~~~ </spoiler> </spoiler> <spoiler summary="T-Shirt Hunt"> [tutorial:807B] <spoiler summary="More efficient code"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { int p, x, y; cin >> p >> x >> y; for (int s = y; ; s++) { if (s % 50 != x % 50) { continue; } bool me = false; int i = s / 50 % 475; for (int j = 0; j < 25; j++) { i = (i * 96 + 42) % 475; if (i + 26 == p) { me = true; ...
<< st2; preparefft(st2); go(A / 2); cout << answer << endl; return 0, void go(int A) { if (A == 1) { even[0] = 1; odd[0] = 0; odd[1

Full text and comments »

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

54.
By GlebsHP, history, 4 years ago, In English
Nebius Welcome Round (Div. 1 + Div. 2, rated, t-shirts!) Hello, Codeforces! [user:Zlobober,2023-03-09] and I are glad to invite you to compete in Nebius Welcome Round (Div. 1 + Div. 2) that will start on [contest_time:1804]. The round will be rated for everyone and will feature 8 problems that you will have 2 hours to solve. I feel really thrilled and excited about this round as this is the first time I put so much effort in a Codeforces contest since I quit being a round coordinator in December 2016 (wow, that was so long ago)! We conduct this round to have some fun and we also hope to find some great candidates to join Nebius team. Solving 5+ problems in our round will be a good result and will count as one of the coding interviews. Apart from that top 25 contestants and 25 random contestants placed 26-200 will receive a branded Nebius t-shirt! <img style="float: right; margin: 0 1em 0.5em 1em; width: 400px;" src="/predownloaded/40/37/403770e78d9c8962d0bc0c20a9e1c45d0e3c5df9.png"> Some information about Nebius. I have join...
joining Nebius as a full-time employee, go on and fill the [form](https://codeforces.me/userForm, Special thanks go to:

Full text and comments »

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

55.
By ATSTNG, history, 7 years ago, In English
[Tutorial] Matroid intersection in simple words **[This article is also available in [Russian](https://codeforces.me/blog/entry/69287?locale=ru)]** Hello, CodeForces. I think that matroids are beautiful and powerful concept, however, not really well known in competitive programming. I’ve discovered matroids at 2019 Petrozavodsk Winter Training Camp. There was a problem that clearly cannot be solved using usual techniques I knew, editorial for this problem was just these three words “just matroid intersection”. Back then it took me more than 2 days of upsolving to find all the information and details I need and implement solution that gets Accepted on this. And it took way longer to actually understand why does it work and exactly how does it work. (I still hesitate in some details.) Of course, it is not hard to google up all the definitions and some related articles, but in my opinion they all are focused more on mathematical part of theory, strict proofs in some not really obvious but short ways, and observing only ke...
(C_1 + C_2))$. That is already good enough for some problems, but we can definitelygo further this, vector of each color. Here we go with linear independence on one and unique colors on the other., , here we go with breadth-first search. Runtime is $\mathcal{O}(V + E) = \mathcal{O}(n + r \cdot n, Now we established the way of increasing size of $S$ by one. So we can start with empty $S$ andgo

Full text and comments »

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

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

Full text and comments »

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

57.
By neal, 8 years ago, In English
Don't use rand(): a guide to random number generators in C++ Don't use `rand()`. Why? Let's jump right into some code. What value will the following code print, approximately? ~~~~~ #include <cstdlib> #include <iostream> using namespace std; const int ITERATIONS = 1e7; int main() { double sum = 0; for (int i = 0; i < ITERATIONS; i++) sum += rand() % 1000000; cout << "Average value: " << sum / ITERATIONS << '\n'; } ~~~~~ Should be about 500,000, right? Turns out it depends on the compiler, and on Codeforces it prints 16382, which isn't even close. [Try it out yourself](http://codeforces.me/contest/1025/customtest). ### What's happening here? If you look up [C++ documentation on `rand()`](https://en.cppreference.com/w/cpp/numeric/random/rand), you'll see that it returns "a pseudo-random integral value between `0` and `RAND_MAX`." [Click again on `RAND_MAX`](https://en.cppreference.com/w/cpp/numeric/random/RAND_MAX) and you'll see that "This value is implementation dependent. It's guaranteed that th...

Full text and comments »

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

58.
By Errichto, 8 years ago, In English
Sums and Expected Value — part 1 part 2: https://codeforces.me/blog/entry/62792 Watch my lecture-stream tomorrow (Thursday) at [14:00 CEST](https://www.timeanddate.com/worldclock/fixedtime.html?msg=EV+lecture+1&iso=20181025T14&p1=262) &mdash; <s>[https://www.youtube.com/watch?v=qdlPY37MBPo](https://www.youtube.com/watch?v=qdlPY37MBPo)</s> [https://www.youtube.com/watch?v=U_h3IjreRek](https://www.youtube.com/watch?v=U_h3IjreRek). I will go through theory and problems from this blog. The only prerequisite is knowing what is probability. The next (harder) part on Monday. The video will be available later, with timestamps for each problem &mdash; so you don't have to watch everything. ### Definition of EV Let's say we bought a lottery ticket for 2$. We will win 10$ with probability 10%, and 20$ with p-bility 2%. On average, it gives us $0.1 \cdot 10 + 0.02 \cdot 20 = 1.4$, so we are worse off after buying the ticket. The computed average is called the expected value. The expected value (EV, expecta...
=U_h3IjreRek](https://www.youtube.com/watch?v=U_h3IjreRek). I will go through theory and problems from

Full text and comments »

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

59.
By Vladik, 6 years ago, translation, In English
Petition on the flag of Belarus Greetings to all belarusians who actively, or not so actively, participate in this amazing community we have on Codeforces. I would like to ensure that we have your support to initiate changing the flag of Belarus on this website to the historical [white-red-white flag](https://ru.wikipedia.org/wiki/%D0%91%D0%B5%D0%BB%D0%BE-%D0%BA%D1%80%D0%B0%D1%81%D0%BD%D0%BE-%D0%B1%D0%B5%D0%BB%D1%8B%D0%B9_%D1%84%D0%BB%D0%B0%D0%B3), since the current official flag of Belarus has become strongly associated with crimes against humanity, with the brutality, torture, ferocity and human rights abuses which have, sadly, become commonplace in the past few months in our beautiful country. <html> <body> <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Flag_of_Belarus_%281918%2C_1991%E2%80%931995%29.svg/500px-Flag_of_Belarus_%281918%2C_1991%E2%80%931995%29.svg.png" style="display: block; width:30%; margin: 0 auto; border: 1px solid black"> </body> </html> Outside of public ...

Full text and comments »

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

60.
By neal, 8 years ago, In English
Blowing up unordered_map, and how to stop getting hacked on it C++ has always had the convenient data structures `std::set` and `std::map`, which are tree data structures whose operations take $O(\log n)$ time. With C++11, we finally received a hash set and hash map in `std::unordered_set` and `std::unordered_map`. Unfortunately, I've seen a lot of people on Codeforces get hacked or fail system tests when using these. In this post I'll explain how it's possible to break these data structures and what you can do in order to continue using your favorite hash maps without worrying about being hacked [cut] . So how are they hackable? We always assume hash maps are $O(1)$ per operation (insert, erase, access, etc.). But this depends on a key assumption, which is that each item _only runs into $O(1)$ collisions on average_. If our input data is completely random, this is a reasonable assumption. But this is no longer a safe bet when the input isn't random, especially so if someone is adversarially designing inputs to our code (a.k.a. hacking ph...

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

64.
By Golovanov399, 7 years ago, In English
C++ tips and tricks Hello, codeforces. I would like to tell you about some tricks and constructions I use in C++. They are not hidden or anything, moreover, most of them are from stl or maybe well known among software engineers, but I often see codes where something is done by hand in, say, 5 lines, while in stl there is a function which does the same. The things below are filtered by my personal sense of non-popularity (so no `__builtin` functions) and usage frequency (so there almost surely are similar things I don't know about) and are not really sorted in any reasonable order. Let's begin. [cut] <hr> - ### `all(x)` This may be an exception to the rule of non-popularity -- this is quite widely used, but some next items will depend on `all(x)`, so I define it here. So, I talk about ```[c++] #define all(x) (x).begin(), (x).end() ``` Now sorting a vector looks like `sort(all(vec))` instead of `sort(vec.begin(), vec.end())`. However, it's not all about this define. Imagine you nee...
doesn't have a constructor of vector, you may go write a loop with an ok face, like:

Full text and comments »

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

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

Full text and comments »

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

66.
By -is-this-fft-, history, 2 years ago, In English
Things you should know before you discuss cheating Cheating has been discussed a lot lately. I'm writing a blog post about it with actual data (mainly, I want to know if there is an actual increase). However, in the many discussions that have ensued both here and on Discord servers, I noticed several recurring misconceptions. I wrote a section to debunk them and it grew kind of long, long enough to be a post in itself. So while my scripts are running, we can treat this as a kind of teaser. ### Things you should know before you write a comment about cheating Vocabulary: - _To plagiarize_ [means](https://dictionary.cambridge.org/dictionary/english/plagiarize) to use someone else's work while passing it off as yours. It refers to the act itself, **not** to its detection or punishment. "jrandomcoder plagiarized all of his solutions in round 987" is a meaningful statement. "jrandomcoder cheated in round 987 but he still hasn't gotten plagiarized, I request [user:MikeMirzayanov,2024-08-16] to look into this" is not. - _Plague_ is a...
- Pick contest from a few months to a year or so old. - Go to the Status tab and filter for, As I'm writing my actual blog, it has become clear to me just how much effort does in factgo, When you go visit some profiles, you might very well be greeted with this message.

Full text and comments »

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

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

Full text and comments »

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

68.
By Um_nik, history, 14 months ago, In English
On AI ruining "solving math problems with computer" [a year later] I guess you were right in the part "a year from now LLMs will solve problems on your level". You were also saying something along the lines of "you'll change your mind when it starts affecting you". In this part, you were wrong. Cheaters always existed, and they always will. LLMs make it easier to cheat, true. There is no way of completely preventing LLM cheating (or any other kind of cheating) in online competitions. I just coordinated the round everyone is buzzing about, so I can with confidence say that in the CF rules for coordinators and authors, there isn't anything about making problems LLM-proof. Not for easy problems, not for hard problems, nothing. And I doubt any such rules will appear. LLMs are forbidden by the rules, that's that. So we, as honest participants (yes, I will assume that you are an honest participant, otherwise this blog is not applicable to you and I don't care about you), will have to accept that some problems in the future rounds will be LLM-able, ...

Full text and comments »

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

69.
By Kuroni, history, 3 years ago, In English
Codeforces Global Round 25 Xin chào Codeforces (・ω・)ノ We are pleased to announce the resumption of the Global Rounds. Thanks to XTX Markets for supporting the initiative! In 2024, we will hold 4 such rounds. The series results will take into account the best 3 participations out of 4. On [contest_time:1951] we will host [contest:1951]. **<img src="/predownloaded/2e/e2/2ee2f0f95f05aae6ca6f47812dae2dc2aabf277b.png" style="width: 200.0px;float: right;margin: 0 1.0em 1.0em 1.0em;max-width: 100.0%;max-height: 100.0%;">** Codeforces Global Round 25 marks the first round in the 2024 series of Codeforces Global Rounds. These rounds are open and rated for everyone. The prizes for this round are as follows: - The top 30 participants will receive a t-shirt. - 20 t-shirts will be randomly distributed among participants ranked between 31 and 500, inclusive. The prizes for the 4-round series in 2024: - In each round, the top-100 participants get points according to the [table](https://pastebin.com...
Our sincerest gratitudes go to:

Full text and comments »

Announcement of Codeforces Global Round 25
  • Vote: I like it
  • +605
  • Vote: I do not like it

70.
By Intellegent, 6 months ago, In English
Spectral::Cup 2026 Round 2 (Codeforces Round 1100, Div. 1 + Div. 2) <center> <img src="https://i.imgur.com/lPGWfOR.png" style="width: 300.0px;max-width: 100.0%;max-height: 100.0%;"></center> <center> <h1> Greetings Codeforces! </h1> </center> [user:sammyuri,2026-05-18], [user:myst-6,2026-05-18] and I are absolutely chuffed to bits to invite you all to have a go at Codeforces Round ${12}_{10}$ ([contest:2229]), kicking off at [contest_time:2229]. There will be **9** absolute cinema problems for you to solve over the course of **3 hours**, some problems will have multiple parts. This round will be combined for Division 1 and Division 2 and will be rated for everyone. I’d like to raise a glass to the following brilliant minds for making this whole thing possible: - [user:dominater069,2026-05-18] for splendid coordination. - [user:um_nik,2026-05-18] for preliminary review. - The fine assembly of testers: [user:arvindf232,2026-05-18], [user:evenimage,2026-05-18], [user:geothermal,2026-05-18], [user:sana,2026-05-18], [user:wansur,20...
you all to have a go at Codeforces Round ${12}_{10}$ ([contest:2229]), kicking off at [contest_time

Full text and comments »

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

71.
By ace5, 3 years ago, translation, In English
It's unfair Today I got this message: <spoiler summary="Spoiler"> ![ ](/predownloaded/0a/0b/0a0bd878d9a61bd3ad9c646d5adddf6612a0ad51.png) </spoiler> When looking at the solutions of the listed participants on the problem [1951B](https://codeforces.me/contest/1951/problem/B) I saw that all these solutions completely (or with a change of variables) same as mine, so it's not just a coincidence, solutions copied from mine. Since I didn't give my solution to anyone, and didn't keep the code publicly available, this could only happen if one of the participants blocked this task, copied my code, and sent it to the others. Indeed, it turns out that in my room only one participant blocked task B &mdash; [user:_Untrackable_,2024-04-12](the nickname speaks for itself). He blocked this task at 1:44, and if you look at the submissions of participants from the list, you can see that many of them earlier sent code for this task that was completely different from mine (some even in other languages!), ...

Full text and comments »

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

72.
By MikeMirzayanov, 5 years ago, In English
Codeforces Round #743 Is Unrated: Investigating the Reason Hello. Sorry for it. Actually, right now I don't have any idea why testing is so slow now. Obviously, it doesn't work as expected. It is not because of problems. So please don't blame writers or coordinators. I'm investigating the reason, but don't see it now. I myself am very upset and I apologize to the authors, coordinator, and participants. I will do my best to find the cause and fix it. Surprisingly, we haven't made any big changes to this part of the system lately. But something went wrong. Mike. **UPD:** https://codeforces.me/blog/entry/95081#comment-841873

Full text and comments »

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

73.
By errorgorn, 2 years ago, In English
[RANT] Warning to other coordinators about Wuhudsm Hi again, it is me. I want to preface this blog by saying that I am totally aware that it is not good netiquette to screenshot private messages and publish them publicly. But honestly, I can't care anymore now. Below is an unorganized rant. Sorry, I'm too pissed to write the things below concisely. And here: I'm pinging him: [user:wuhudsm,2024-07-21]. In an ideal world, I could probably just tell him privately to stop doing it. But I already did. So I think I need to write this blog to either stop him from doing this again or just soft-ban him from authoring more rounds by telling everyone about it. Let me just preface this blog with a fact of coordination -- it is very possible that problems from contest A will be used in contest B even after testers from contest A have seen those problems. So there are indeed (many) testers who could possibly be affected by this. Some examples of this happening (where I was involved): - Contest problems based on on-site contests were quit...
participate in ICPC). I just wish to go back to being a humble competitor of competitive programming., I wouldn't pay $1000 to go to Croatia onsite for OCPC Fall 2024 if I thought it was a joke, right?, Now, I will go into one of the main points. Coordinating rounds involves reviewing problem ideas

Full text and comments »

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

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

Full text and comments »

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

75.
By MikeMirzayanov, history, 11 years ago, translation, In English
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!)

Full text and comments »

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

76.
By Radewoosh, history, 8 years ago, In English
Blogewoosh #4 Hello, codeforces! It's time to continue the series of Polish tasks. I've decided to write about my own task one more time. Its name is "cook" ([you can submit here](https://szkopul.edu.pl/problemset/problem/9NFtPM59qGWa7wdn570ifuP0/site/?key=statement)). The task isn't very hard, but it uses cute (in my opinion) trick. The statement goes as follows: There is a cook in a restaurant. He has $n$ ($1 \leq n \leq 10^6$) orders which he must fill. Every order is a piece of paper, and all orders are speared on a spindle (sharp stick with pierced pieces of paper) in a fixed order which cannot be changed. Normal cook would just take orders one by one from the top of the spindle and fill them in this order, but the cook in this task has supernatural cooking powers and can combine orders to fill them faster. In particular, if at some moment there are $k$ out of $n$ orders still on the spindle, he can choose one of three options: $---$ He can take the topmost piece of paper and fill this...

Full text and comments »

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

77.
By Zhdun, 6 years ago, translation, In English
When will Codeforces end? The last mark in the updated ranking history As you know, Codeforces recently added the ability to scroll through the user's rating history. I decided to take this opportunity to find out how long this wonderful service plans to exist. To do this, I went to my page, looked at my rating <spoiler summary="Spoiler"> and began to cry </spoiler> ![ ](https://i.imgur.com/OiqVw9V.png) Next, I began to zoom out as much as possible. At one point, I got something that looked like the flag of Indonesia. ![ ](https://i.imgur.com/3l6jaCv.png) After zooming out a bit more and scrolling a bit to the right, I found that at some point new divisions stop being added. To be more precise, this is about the 251st millennium: ![ ](https://i.imgur.com/H4y7S10.png) It seems that we are close to a solution! It remains only to zoom in to see a more accurate value. ![ ](https://i.imgur.com/h1StXcZ.png) So, 275760 is, apparently, the last year of Codeforces' existence! Let's zoom in even more to get the accuracy up to a mont...

Full text and comments »

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

78.
By -is-this-fft-, history, 7 years ago, In English
[Tutorial] The DFS tree and its applications: how I found out I really didn't understand bridges #### Introduction This is a tutorial/exploration of problems that can be solved using the "DFS tree" of a graph. For a way too long time, I didn't really understand how and why the classical algorithm for finding bridges works. It felt like many tutorials didn't really explain how it works, kind of just mentioned it in passing and quickly just moved on to implementation. The day someone explained what the DFS tree is, I finally understood it properly. Before, it took me ages to implement bridge-finding properly, and I always had to look up some detail. Now I can implement it at typing speed. But more importantly, I began to see how the same techniques can be used to solve graph problems that have more or less nothing to do with bridges. The thing is, when you have a black box, you can only ever use it as a black box. But if you have a box that you understand well, you can take it into pieces, repurpose the pieces for completely different things, all without getting lost...
depth-first traversal doesn't go to $v$ from $u$ using $uv$, then $v$ was already visited when the, - if the traversal doesn't go from $u$ to $v$, it means that the traversal already visited $v

Full text and comments »

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

79.
By ko_osaga, history, 4 years ago, In English
OR Convolution for Common People Several years ago, a wise person told me that a convolution on a bitwise operator is possible: Given $A, B$ of size $2^N$, you can compute $C[i] = \sum_{j \oplus k = i} A[j] B[k]$ $C[i] = \sum_{j \land k = i} A[j] B[k]$ $C[i] = \sum_{j \lor k = i} A[j] B[k]$ in $O(2^N N)$ time. Cool! I asked a wise person, how such things are possible. A wise person replied, _"Of course you know how FFT works, let's begin with Fast Welsh-Hadamard Transform..."_ I said, No. I don't know how FFT works. Thank you. Then I just threw it into my ICPC teamnote. Years have passed, I still don't know how FFT works, and while writing some stupid essay, a random idea came to my mind. I wondered, "Does nobody really know this? Why anyone didn't explain OR convolution this way?". I searched on Google, and nobody was telling things this way, so this is certainly not a common explanation. But why? It should be. Let me use my time to change things for good. ## Sum of Subsets For convenience, I'll...

Full text and comments »

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

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

Full text and comments »

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

81.
By SlavicG, 5 years ago, In English
How to use Codeforces [GUIDE] I see a lot of newcomers struggling to use the website to it's fullest, so I decided to write a blog that has all important information about how to use Codeforces in a single place. I will update it with time, so feel free to write your suggestions/questions in case I missed something and I will be glad to add it to the post! I would like to thank [user:_Vanilla_,2022-02-05] and [user:mesanu,2022-02-05] for helping me write the blog, and [user:Monogon,2022-02-05], [user:down,2022-02-05] and [user:AlperenT,2022-02-05] for proofreading and giving suggestions. #### Navigating through pages ![ ](https://media.discordapp.net/attachments/705371983650619454/928235498487570442/bandicam_2022-01-05_12-36-00-134.jpg?width=991&height=110) It's possible to navigate through most pages of Codeforces using the bar on the top, I will talk about what each tab does more in depth below: #### The Help Page The help page contains the answer to a lot of questions about Codeforces, such as rati...
. You can make hacks during the round if you solve a problem and lock it. After locking, you cango in, Another way is to go to the contest's page, the same way mentioned in "How to view others, Once you pick the problem you want to solve and go into it's page you can see: it’s title, it’s

Full text and comments »

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

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

Full text and comments »

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

83.
By huangzirui, history, 4 years ago, In English
Codeforces Round #796 Hi Codeforces! Happy Dragon Boat Festival! We are glad to invite you to our first Codeforces Round [contest:1687] and [contest:1688] which will be held on [contest_time:1687]. This round will be rated for participants of both divisions. Participants in each division will be offered 6 problems and 2 hours to solve them. The two divisions will share 3 problems. In this round, as the best friend of the characters in Touhou Project, you are going to help them solve the problems they meet. The problems are prepared by [user:xiaoziyao,2022-05-30], [user:Yakumo_Ran,2022-05-30], [user:SSerxhs,2022-05-30], [user:Cocoly1990,2022-05-30], [user:LilyWhite,2022-05-30], [user:Elegia,2022-05-30] and me. We hope you will enjoy this round. Great thanks to: - [user:74TrAkToR,2022-05-30] for good coordination of this round and translating all statements to Russian, - [user:Yakumo_Ran,2022-05-30] for providing most tasks, - [user:SSerxhs,2022-05-30] for preparing most tasks, - [user:L...

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

87.
By DanAlex, history, 11 years ago, In English
How to sweep like a Sir ### Cutting to the chase Clearly you don't need a PhD in Computing to sweep in the yard , but one might be useful in order to know linear and radial sweep algorithms. So , what's all about ? It's just what it sounds it is , sweeping linear ( up to down , for example ) or radial ( making a 360 degrees loop ). How this can help? [cut] Well... ### Linear sweep Suppose you a set of objects in an Euclidean plane. We need to extract information about some objects. The method of linear sweeping takes a line and moves it on a fixed direction. Usually the line taken would be vertical and the direction would be left to right or up to down. ![ ](https://upload.wikimedia.org/wikipedia/commons/2/25/Fortunes-algorithm.gif) Quite abstract for the moment , huh ? Let's go to a more specific example. #### Rectangle union area This example is well known. You have a set of rectangles with edges parallel to the OX and OY axes. What is their union area. Well , first of all , let'...
segments ) and add to the result the `distance between sweep lines * above mentioned sum`. As wego , we, you want ) Put the angles in an array. Now go through the array and count the number of points with, Basically , it would go like that:, Now as we established that the sweep can go. We will "move" an imaginary line from left to right, Quite abstract for the moment , huh ? Let's go to a more specific example.

Full text and comments »

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

88.
By Radewoosh, history, 8 years ago, In English
Blogewoosh #5 (with images from now) Hello, codeforces! Because after Round #507 sad men in suits visited me in my flat, this time I won't write about any task from the future. Instead, this blog will be about my own trick. I said "my own," but probably some of you have already heard about it or even figured it out, but I've developed it by myself, so I consider it as my own. In particular, it's **GEOMETRY TIME!!!**. But please, don't escape already. I also don't like this topic so much, that's why I really like this trick. Let me tell you a story from one onsite Polish contest, which took place a few months ago. I was thinking about one of the problems, and I've figured out that I had to do some binary-search (on doubles) and then check if a set of half-planes has a non-empty intersection. The answer would tell me in which direction should I turn in the binary search. Firstly, I grabbed my head, because I've never written an intersection of half-planes. I had my acm library with [user:Errichto,2018-09-07]'s code...

Full text and comments »

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

89.
By defnotmee, 2 years ago, In English
Catching the Mole II(Hard Version) (Psychotic_D cheating case aftermath) This is a part 2 of [my other blog](https://codeforces.me/blog/entry/131821) on the [user:Psychotic_D,2024-07-23] situation. I highly recommend you see it before this one for context. If you don't care that much, here is a quick recap of what was covered in the other blog before we get started: [user:Psychotic_D,2024-07-23] had a ridiculously good performance on his friend's ([user:wuhudsm,2024-07-23]) round. This let many people become suspicious of whether he achieved this legitimately. Then multiple accusations were thrown around and I did my blog doing my own investigation and compiling the most compelling evidence I found. The takeaway was that [user:Psychotic_D,2024-07-23] was probably cheating along [user:EndlessDreams,2024-07-23], who would give him code for [user:Psychotic_D,2024-07-23] to copy. [user:Psychotic_D,2024-07-23] would alter them heavily to avoid plagiarism, but it was clear beyond a reasonable doubt that he was cheating. Well, I finished writing that blog, ...

Full text and comments »

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

90.
By Dominater069, 2 years ago, In English
Analyzing how good O1-Mini actually is I would like to thank [user:redpanda,2024-09-13] and [user:qmk,2024-09-13] for their great help in writing and reviewing this blog. They are also the users who queried O1-mini for all the following problems. We tried O1-mini on several problems, from a variety of sources. Let's list the results first. **Note** : - Some of the WA verdicts here actually means that the AI just "stopped thinking" which means the AI thought for a long enough time without any useable results so it ran into an error. - All ratings mentioned are Codeforces ratings, the Atcoder ratings have been converted to codeforces rating. To measure the approximate codeforces rating of the atcoder problems mentioned here, you can use https://kenkoooo.com/atcoder/#/table/ + https://silverfoxxxy.github.io/rating-converter. <h4> D2ABs </h4> - [problem:1762B] [<a class="rated-user user-gray" title="Gray">1100</a>] <a class="rated-user user-green" title="Green AC">AC</a> - [problem:1998B] [<a class="rated-...
- Div1 people are completely unaffected (for now at least). Some extra care needs togo into, We are mostly fine. Some amount of care needs to go to build easy problems which AI can't solve but

Full text and comments »

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

91.
By zscoder, history, 7 years ago, In English
[Tutorial] Generating Functions in Competitive Programming (Part 2) Welcome to Part 2 of my tutorial on generating functions. The [first part](https://codeforces.me/blog/entry/77468) focused on introducing generating functions to those without any background in generating functions. In this post, I will demonstrate a few applications of generating functions in CP problems. Let us start with some relatively straightforward examples. Note: Unless stated otherwise, all computations are done modulo a convenient prime (usually $998244353$). Also, $[n]$ denotes the set $\\{1,2,...,n\\}$. ### Blatant Applications in Counting Problems **Problem.** [AGC 005 Problem F](https://atcoder.jp/contests/agc005/tasks/agc005_f) You have a tree $T$ with $n$ vertices. For a subset $S$ of vertices, let $f(S)$ denote the minimum number of vertices in a subtree of $T$ which contains all vertices in $S$. For all $1 \le k \le n$, find the sum of $f(S)$ over all subsets $S$ with $|S| = k$. Constraints: $n \le 2 \cdot 10^{5}$. <spoiler summary="Solution"> First, ...
compositional inverse of $F(x)$. Let's go through a few examples., generalization of power series where the powers can go negative., How do we expand the terms quickly? We can use dp! Go through the brackets one by one, and maintain

Full text and comments »

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

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

Full text and comments »

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

93.
By .o., 12 years ago, In English
Good Bye 2014 Hi, Codeforces! Welcome to the last Codeforces Round of 2014, **Good Bye 2014**! This round is *very unusual*; First, the round starts at **[December 30th, 18:00 MSK](http://www.timeanddate.com/worldclock/fixedtime.html?msg=Good+Bye+2014&iso=20141230T18&p1=166&ah=2&am=30)**. Second, the round lasts for **2.5 hours**. And lastly, the round will be **division combined**, which means Div1 contestants and Div2 contestants won't be separated. The problems are prepared by me ([user:tncks0121,2014-12-29]) and Seunghyun Jo ([user:ainta,2014-12-29]). This is our second round at Codeforces. Because our first round caused(?) [the Black Day](http://codeforces.me/blog/entry/10683), we hope this round won't cause any errors like before :D Thanks to Won-seok Yoo([user:ainu7,2014-12-29]), who tested our round and gave us comments about the problemset. We'd like to thank some people who were necessary to make this round: Maxim Akhmedov ([user:Zlobober,2014-12-29]) gave us great help prepar...

Full text and comments »

Announcement of Good Bye 2014
  • Vote: I like it
  • +758
  • Vote: I do not like it

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

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

97.
By I_love_Hoang_Yen, 11 years ago, In English
Teams going to ACM ICPC World Final 2016 With many regionals around the world finished, I think it is time to start collecting teams that are going to World Final this year. Please help me adding information to the tables :) --- Europe ====== | **Region** | **Country** | **University** | **Member 1** | **Member 2** | **Member 3** | | --------- | ----------- | -------------- | ------------ | ------------ | ---------- | | NEERC | Russia | Ural Federal University | [user:Um_nik,2016-05-15] | [user:Umqra,2016-05-15] | [user:Merkurev,2016-05-15] | | NEERC | Russia | SPb State University | [user:Copymaster,2016-05-15] | [user:-XraY-,2016-05-15] | [user:ershov.stanislav,2016-05-15] | | NEERC ...

Full text and comments »

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

98.
By -is-this-fft-, history, 4 years ago, In English
On "is this greedy or DP", forcing and rubber bands #### Introduction When it comes to "problem-solving techniques", there are roughly 3 levels: 1. Concrete algorithms (Kruskal's algorithm, Li-Chao tree, fast Fourier transform) 2. General patterns (dynamic programming, greedy, square-root decomposition) 3. Meta-strategies ("how do I even go about solving this problem?") There is some grey area, but in general this classification works well. [Many tutorials](https://codeforces.me/catalog) have been written about ideas that fall into 1 or 2. But very little has been written about the third category. On the catalog, I think the only blogs that really qualify are [this](62730) and [this](20548). There is also [this](92248?#comment-809401) valuable comment. As to why there is so little written, I think I can identify two reasons. - Most strong contestants don't really consciously think about these. After solving a problem with FFT, it's hard not to know you used FFT. If you used DP, even if you did it without thinki...
at the beginning. It's not possible to find this greedy unless you go through a thought process, can make the first $n - b + 1$ values whatever we want to. Simply go from left to right, if the $i, patterns (dynamic programming, greedy, square-root decomposition) 3. Meta-strategies ("how do I evengo, stuck. Because that's not what this problem is. Greedy may also seem enticing — go along the

Full text and comments »

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

99.
By -is-this-fft-, history, 5 years ago, In English
[Tutorial] The command line: how to read input from file without #ifdef and much more #### Introduction Instead of algorithms and math, I'll be doing something completely different here. There is something that has bothered me for a long time: people not understanding the tools they use to participate in contests and thus failing to take real advantage of them. And it all goes back to not understanding the command line. Some of you might say, "well surely, the command line is something obsolete and you're only clinging to it because you [insert ridiculous amateur-psychology here]?" No! The command line is not obsolete, and unless competitive programming becomes so mainstream that software vendors start writing professional-grade tools aimed specifically at us, it won't be. [cut] $~$ What is the command line? Any of these: ![ ](/predownloaded/bd/b6/bdb6c157b9b3ce5ae046c9064e469e0081f8c0fe.png) As you can see, it comes in many background colors and fonts, but the basic idea is always the same. It's a box you can type commands in, which it will ...
should we go about it? Here are a few guidelines., - `cd some_folder` to go to a folder called `some_folder` located in the current folder. - `cd, . But I will go through other necessary commands anyway., As far as text editors go and what I've seen people use to write code, there are basically four

Full text and comments »

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

100.
By chromate00, 22 months ago, In English
Codeforces Round 1000 (Div. 2) Hello Codeforces, and the legends of across $999$ and more rounds! ------------------------------------------------------------------ --- [user:wuhudsm,2024-12-25], [user:Yugandhar_Master,2025-01-15], and I are *beyond excited* to invite you to [contest:2063] at [contest_time:2063]. <b style="color:red;">Please note the unusual time of the round ($\color{red}{2.5}$ hours before the usual time)!</b> The contest contains $6$ carefully crafted tasks, one of them divided into two subtasks, to be solved in $2$ hours. You will solve tasks themed around Little John and his shenanigans aimed towards getting his own dream home (featuring, probably, galvanized square steel). This round could not exist without the thankful help of these so many people: - ~FairyWinx,2025-01-15 for <strike>rejecting more tasks than are used in the final problemset,</strike> coordinating the round and translating the problems; - ~rewhile,2025-01-15 for some very important "technical assistance"; - ...

Full text and comments »

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

101.
By -is-this-fft-, history, 4 years ago, In English
PSA: don't use these functions unless you really, really need to When solving problems in competitive programming, it is almost never a good idea to use the following inbuilt C++ functions. You **will** be hacked or fail a pretest or worse, a systest. Why? Because they use floating-point numbers. They are designed to be used with a floating-point input and a floating-point output. The issue is that on a floating-point number, the result may not be exact. Worse, floating-point numbers may not be able to accurately encode the integer. ##### To calculate $\lfloor \frac{a}{b} \rfloor$ for positive integers $a$ and $b$: * **Don't** use `floor((double) a / (double) b)` or similar. * **Do** use `a / b`. It will round down. * **Warning:** be careful with negative numbers. The answer depends on whether we should round down or towards 0. ##### To calculate $\lceil \frac{a}{b} \rceil$ for positive integers $a$ and $b$: * **Don't** use `ceil((double) a / (double) b)` or similar. * **Do** use `(a + b - 1) / b`. * **Warning:** the same caveat ...

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

104.
By adamant, 9 years ago, translation, In English
Codeforces Round #453 (Div. 1 & Div. 2) Hi everyone! Missed me? I bet no! In either way, here goes another one round which I dared to spoil by my participation in problemsetting. Welcome to the world of extremely unoriginal problems, awkwardly long and boring statements and trifling jokes in anouncements. This time round was prepared by Ildar Gainullin ([user:gainullin.ildar,2017-12-18]) and me (I'm ashamed to place link of such color here, you know who). We want to thank Vladislav Isenbaev ([user:winger,2017-12-18]), Konstantin Semenov ([user:zemen,2017-12-18]), Alexey Shmelev ([user:ashmelev,2017-12-18]), Ivan Smirnov ([user:ifsmirnov,2017-12-18]) and Alex Fetisov ([user:AlexFetisov,2017-12-18]) for testing problems and help in preparation. Also special thanks goes to Nikolay Kalinin ([user:KAN,2017-12-18]) for his help as coordinator and, of course, [user:MikeMirzayanov,2017-12-18] for polygon and codeforces. We hope that you will enjoy the problems, good luck and have fun! **UPD**. Also thanks to [user:akv...

Full text and comments »

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

105.
By pajenegod, history, 3 years ago, In English
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...

Full text and comments »

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

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

Full text and comments »

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

107.
By ButColinOrzInAllWays, history, 7 years ago, In English
How I went from 1500 to 2147 in less than 4 weeks Hello guys, because of this trend that's going on, I really felt the peer pressure to share my **EXTREMELY INSPIRATIONAL AND MOTIVATING SUCCESS STORY**. ![ ](/predownloaded/94/83/94833e58d81b48a2c86c5803f665b11f131360d4.png) To some this might seem unachievable but it's actually quite easily achievable, I'm gonna share the steps to do it. **Prerequisites:** Be orange already **Step 1:** Make a new account on codeforces **Step 2:** Reach orange in 3~4 contests **Step 3:** Brag See that's how easy it is. I would like to add that if you're already red on codeforces, you can use a simple variation of this technique to reach red quickly (the only difference will be in step 2). **Frequently Asked Questions:** _"What if I'm not already orange?"_ **Answer:** You are the reason why the Step 3 above makes any sense.

Full text and comments »

108.
By teraqqq, 23 months ago, translation, In English
Hello 2025 by T-Generation Hello to all fans of competitive programming and Codeforces enjoyers! We're happy to invite you to participate in [contest:2057], which will take place on [contest_time:2057]. We, [user:teraqqq,2025-01-03], [user:dope,2025-01-03], and [user:induk_v_tsiane,2025-01-03], have prepared **8 problems** for you, and you’ll have **2 hours and 30 minutes** to solve them. One of the problems is divided into 2 subtasks. The round will be **rated** for all participants. Huge thanks to [user:MikeMirzayanov,2025-01-03], [user:geranazavr555,2025-01-03], and [user:KAN,2025-01-03] for great systems Polygon and Codeforces! Special thanks also go to: - [user:FairyWinx,2025-01-03] for coordinating this round, finding testers, and providing moral and technical support. - [user:turmax,2025-01-03], [user:LeoPro,2025-01-03], [user:Kapt,2025-01-03], [user:sevlll777,2025-01-03], [user:Pechalka,2025-01-03], [user:Adam_GS,2025-01-03], [user:evjeny_23,2025-01-03], [user:Iura_Shch,2025-01-03], [user...
Special thanks also go to:

Full text and comments »

Announcement of Hello 2025
  • Vote: I like it
  • +433
  • Vote: I do not like it

109.
By Bredor, history, 11 years ago, translation, In English
Unbelieveable story of success at ACM ICPC final Preparing to contest ==================== For long time I haven't been writing stories about my life. As Nietzsche said &mdash; Bredor died, and I don't feel so good myself. You might be thinking that I went into booze. Actually, I have really been drinking so much all this time, but I had more important activities: once upon a time I came to my college to find a company to drink. There I saw an advertisment about programming competitions, but I found that competitive programming is sense less in school and it didn't attract my attention. Soon, I was summoned to the dean, and the dean told me: "mr. Rudolph Gotov, there is noone except you who can win this contest!". I refused him at first time certainly, but then he offered me hard choices such as to continue winning all contests or to stop to arrange night parties at college campus. The choice was not great, and I went looking for a team. Because of stupid rules I could not invite my friends from Bratsk into the team, so I had t...
Jaguar and warm socks into the bag, and then I was ready to go., Unfortunately, hardly accustomed to the good life, we had to get up at 6 am and go to contest

Full text and comments »

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

110.
By peltorator, 18 months ago, In English
"Algorithms in Depth" Stream Series: Kicking Off With FFT Hi Codeforces! I’ve long believed that it's _really_ worth revisiting the same competitive programming topics multiple times. The first time, you’re just trying to survive and maybe grasp the basics. The second time, you’ve solved some problems, you know where you got confused, and you're ready to absorb more. By the third time, you’ve seen and solved enough to start appreciating the subtleties — the tricks, advanced applications, deeper meaning. But most lectures I’ve seen are designed as a one-size-fits-all — trying to cover everything from scratch _and_ dive into the advanced stuff in one go. That’s rarely optimal. Take binary search. I once talked about it for six hours straight. A beginner at that lecture would’ve probably quit CP immediately. And that’s ok. Beginners don’t need all that. But the truth is, there _is_ that much depth to explore even in seemingly simple topics like binary search — once you're ready. Yet many people only see the beginner version once and mo...
them by hand, you're good to go., -all — trying to cover everything from scratch _and_ dive into the advanced stuff in onego. That’s

Full text and comments »

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

111.
By pwned, 2 years ago, In English
Codeforces Round 987 (Div. 2) Hello Codeforces! We ([user:pwned,2024-11-08], [user:ACGN,2024-11-08], [user:HappyPacMan,2024-11-08], [user:maomao90,2024-11-08], [user:AverageDiv1Enjoyer,2024-11-08], and [user:trunkty,2024-11-08]) are thrilled to invite you to [contest:2031] on [contest_time:2031] **(note the unusual time)**! After more than two years of preparation and nearly thirty problems on our shortlist, our contest is finally here for your enjoyment! In this round, you will help Penchick as he embarks on a world trip through the Philippines, Indonesia, and even through the Australian beaches and attempt six problems in two hours! The score distribution will be as follows: $500-1000-1500-2000-2500-3000$. This round would not be possible without the support of everyone behind this round: - [user:maomao90,2024-11-08] and [user:KAN,2024-11-08] for their excellent coordination and problem setting, - [user:pwned,2024-11-08], [user:ACGN,2024-11-08], [user:AverageDiv1Enjoyer,2024-11-08], and [user:trun...
**UPD: Editorial has been posted, [go check it out!](https://codeforces.me/blog/entry/136260)**

Full text and comments »

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

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

Full text and comments »

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

113.
By ACGN, 5 years ago, In English
What if tourist goes rainboy mode? (Simulation) DISCLAIMER: NO TOURISTS AND RAINBOYS WERE PINGED Ah yes, two names that most people on Codeforces have heard -- <b>t<span style="color:red;">ourist</span></b> and <b><span style="color:purple;">rainboy</span></b>, one known as the CP Legend, and one as the user who does everything reverse. Such a great idea to put them together &mdash; a hypothetical user with the same ability as <b>t<span style="color:red;">ourist</span></b>, and solves problems the <b><span style="color:purple;">rainboy</span></b> way. _For those unaware of the "rainboy way", it means solving the problems in reverse order. In particular, if he cannot solve the final problem, he solves no problems in the contest._ Unfortunately, <b><span style="color:purple;">rainboy</span></b> had not yet reached red, peaking at 2398 rating. How far can this user go? We shall simulate this user through all the contests that tourist and rainboy took part in comparably, which adds up to 60 contests from [contest:745] to [cont...
at 2398 rating. How far can this user go? We shall simulate this user through all the contests that

Full text and comments »

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

114.
By twosquares, 11 months ago, In English
Good Bye 2025 Editorial We'd like to thank you all for participating in the contest, and hope you enjoyed it. Any feedback would be appreciated! <!-- You lost the game. --> <spoiler summary="Rate the contest"> - Great contest: - Good contest: - Average contest: - Bad contest: </spoiler> --- <spoiler summary="Did Franklin (from problem D) succeed in massacring a village of innocent elves like Frieren and Dilhan (from problem E)?"> The official lore is that he got lost in a forest of oddly colored Christmas trees (from problem F) and decided instead to write this editorial. </spoiler> <!-- ########### --> <!-- #PROBLEM A# --> <!-- ########### --> <h2>[problem:2178A]</h2> <spoiler summary="Did you like the problem?"> - Great problem: - Good problem: - Average problem: - Bad problem: - Did not solve: ...
consider the chords in order (i.e. you're not allowed to go backwards to compute the number of chains

Full text and comments »

Tutorial of Good Bye 2025
Tags sus
  • Vote: I like it
  • +697
  • Vote: I do not like it

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

Full text and comments »

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

116.
By MikeMirzayanov, 9 years ago, translation, In English
Codeforces: Results of 2017 <img src="/predownloaded/e4/09/e40915ee54c5991b91098756a90270d94be893b3.jpg"/> Happy New Year, Codeforces! I hasten to wish the whole community (and including me) correct programs, sudden insights, beautiful ideas and interesting problems! I hope that you have met the new year at least as fun as I am. Have you had enough sleep after New Year's Eve? This year, the traditional post summarizing the past year, I sat down to write only on January 1, 2018. I hope that I will not have to sum up the whole year. This post is important to me, since it draws a line to all the work done by the Codeforces team and the entire community in 2017. Many thanks to the team: all of the achievements listed below are the result of joint efforts. We did an excellent job! The community must know its heroes. In 2017, [user:MikeMirzayanov,2018-01-02], [user:KAN,2018-01-02] (problem coordinator), ~gritukan,2018-01-02 (second problem coordinator), ~netman,2018-01-02 (ex-second problem coordinator), ~k...
. Tests autorenumeration so that the examples go exactly first. 1. Improved renumeration of tests with

Full text and comments »

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

117.
By MikeMirzayanov, 11 years ago, translation, In English
The Second Revolution of Colors and Titles Over the last several months the Codeforces team has been looking anxiously at the inflation in the rating caused by both an influx of new users and the imperfect calculating formulas. In the end it lead to noticeable shifts in colors and titles. For example, getting red in 2015 became much easier than in 2013. We conducted a [survey about the way to introduce the color bounds](/blog/entry/20629). We are happy to announce the updated colors and titles! A summary of the main changes goes like that: * a new color: greenish-blue color or cyan &mdash; just like the name implies, this color takes its place between green and blue, now the participants of the second division will be better differentiated; * all the colors shift upwards along the rating scale &mdash; see the table below. Now reaching the top positions will be harder; * the legendary grandmaster &mdash; the new title and color for those who reached the sky high rating 2900. The cold colors (gray, green, cyan an...

Full text and comments »

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

118.
By M.Mahdi, 10 years ago, In English
Codeforces Round #360 Hi! We're glad to invite you all to participate in [Codeforces Round #360(Div. 1 and Div. 2)](http://codeforces.me/contests/687,688) which will take place on Wednesday, 29 June, 20:05 Moscow time. [Check it in your timezone!](http://www.timeanddate.com/worldclock/fixedtime.html?day=29&month=6&year=2016&hour=20&min=5&sec=0&p1=166) The problems are designed by [user:ParsaA,2016-06-27] (Parsa Abdollahi) and me. It's our first Codeforces round and we hope you enjoy competing it as much as we enjoyed preparing it! (^◡^) Our special thank goes to [user:JeBeK,2016-06-27] (Peyman Jabbarzade) who helped us a lot in preparing and testing the round. Many thanks to [user:GlebsHP,2016-06-28] (Gleb Evstropov) for his help in preparing the contest, and [user:MikeMirzayanov,2016-06-28] (Mike Mirzayanov) for great platforms Polygon and Codeforces. We also want to thank [user:Zlobober,2016-06-28] (Max Akhmedov) for testing our round. We wish (and expect!) you all many Accepted solutions! ( ...

Full text and comments »

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

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

Full text and comments »

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

120.
By ko_osaga, history, 2 years ago, In English
Rumination on AI and competitive programming An OpenAI model can now achieve a rating of 1800 in Codeforces. That made me wonder about the future of competitive programming and why we do this. I came up with some opinions, which I'll be glad to share with you. ## AI killed the competitive programming? I don't think that's happening, because competitive programming is useless! Some people might think CP is less interesting because AI can solve CP problems &mdash; but come on, problemsetter can solve those problems, unless they are really bad. Many people still play Chess just fine, and I recently enjoyed participating in Sudoku competitions, although I was completely aware that computers would wreck me in a second. It didn't matter, and I didn't see how it could. CP problems are not "open problems" &mdash; if they are, the problemsetters are to blame. So, you are not contributing anything to the world by solving CP problems; it all comes down to personal interest. As long as CP is fun for people, they will do it. ## Flag...

Full text and comments »

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

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

Full text and comments »

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

122.
By SlavicG, history, 4 years ago, In English
The Toxic Mindset in Competitive Programming and How to Fight It #### Introduction Rating is a great measure of skill and a nice way to observe progress by comparing yourself to your past self and seeing where you stand in the community. As great measure as it is, there are a lot of problems that come with it. They have nothing to do with how the rating system works but rather with how human beings function. In this blog post, I will talk about some of the most pressing personal problems that come up with rating and try to provide some advice on how to solve them, speaking from personal experience and from the experience of a lot of other people I know. #### Associating self-worth to rating This is, in my opinion, the most significant problem people face, and it also pretty much contains all the following problems as a subset. It's extremely easy to fall into this rabbit hole since, as a competitive programmer, it only feels natural to associate our rating with intelligence and, respectively, our intelligence with self-worth. Why is this su...
- Take a small break from competitive programming. It doesn't have to be long. Justgo on a holiday

Full text and comments »

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

123.
By dario2994, 6 years ago, In English
Editorial of Global Round 11 #### General comments Broadly speaking, problems A-B-C-D were "div2 problems", while F-G-H were "strong grandmaster problems" (with E staying in the middle). I did not expect anyone to solve all the problems and thus I decided to give the scoring F+G=H (so that maybe someone would have solved H). <br><br> Many of the problems (A, C, D, E, G) admit multiple solutions. Sometimes the core of the solution is the same (C, D) and sometimes the solutions are truly different (A, E, G). <br><br> If you are an experienced participant, I would like to hear your opinion on the problems. Feel free to comment on this post or send me a private message. <br><br> <spoiler summary="Overview of the problemset" > The easiest problem of the contest, *A-Avoiding Zero*, is about rearranging an array of numbers. It is intended as a very easy problem that still requires to think. Then, in *B-Chess Cheater* an intuitive (but nontrivial to prove) greedy approach is the way to go. *C-The Hard Work of P...
Cheater* an intuitive (but nontrivial to prove) greedy approach is the way to go. *C-The Hard Work of, the way to go. *C-The Hard Work of Paparazzi* is a classical dynamic-programming problem with a, \le 500$). If $j>i + 2r$ then it is possible to go

Full text and comments »

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

124.
By chenjb, 3 years ago, In English
The 2nd Universal Cup Semifinal & 2024 Summer Summit Announcement <center> <img src="/predownloaded/a6/3b/a63b8b0dc4b18f3e18c316abc22d4677aa075fd8.png" style="height: 262.0px;max-width: 100.0%;max-height: 100.0%;"> </center> **UPD:** **We plan to host the 2024 Universal Cup Summer Summits in Cancún, Mexico. The event has been scheduled from June 19 to June 23. The detailed schedule, materials, and list of the invited teams will be announced in the future. The 2nd Universal Cup Semifinals will be held on June 23, 2024. The contest will start at 17:00 (UTC +8) and end at 22:00 (UTC +8). Please note that there will be no extra time windows on the semifinals contest &mdash; all the teams must start in the only official time window. You may check the event time on your local timezone here: [Link](https://www.timeanddate.com/worldclock/fixedtime.html?msg=The+2nd+Universal+Cup+Semifinals&iso=20240623T17&p1=33&ah=5). The onsite participants will participate in the semifinals on June 22nd (one day before the online participants)** Hello everyone, w...
their wonderful contests with us. We are also planning to design souvenirs and prizes which willgo to

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

127.
By pajenegod, 3 years ago, In English
Shallowest Decomposition Tree Hi Codeforces! Today I want to tell you about a really cool and relatively unknown technique that is reminiscent of Centroid decomposition, but at the same time is also completely different. The most common and well known decomposition tree algorithm out there is the centroid decomposition algorithm (running in $O(n \log n)$). It is a standard algorithm that is commonly used to solve tons of different kind of divide and conquer problems on trees. However, it turns out that there exists another closely related decomposition tree algorithm, that is in a sense optimal, and can be implemented to run in $O(n)$ time in around $30$ lines of code. I have chosen to call it the _Shallowest Decomposition Tree_. This blog will be all about the shallowest decomposition tree. Something I want to remark on before we start is that I did not invent this. However, very few people know about it. So I decided to make this blog in order to teach people about this super cool and relatively unknown tec...

Full text and comments »

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

128.
By Sprdalo, history, 16 months ago, In English
[IOI 2025] Travel Log: 68 Hours, 0 Luck, 1 Chicken Dear CP and IOI community, This is my first time leading the team at the IOI! However, after this experience, I will be having a long, hard look in the mirror before ever considering it again. TL;DR: Every single step went wrong — even the ones you thought _couldn't_. Part of the Serbian team (two contestants and a guest) was traveling with me, while the rest traveled separately with the deputy, due to a training camp. Failing before even departing ----------------------------- Our intended route was: Belgrade → Zurich → São Paulo → Santa Cruz, followed by a separate domestic flight to Sucre. We planned to depart on the 26th and arrive on the 27th. However, a major storm hit Europe that day, and many flights to/from Zurich were delayed — including ours. Because of that delay, we missed our connection to São Paulo, and consequently all following flights. _The other part of the delegation did not have this problem._ Logistic problems ----------------- We were re...

Full text and comments »

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

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

Full text and comments »

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

130.
By MinaRagy06, 17 months ago, In English
Help Egypt Fly to IOI 2025 **UPD: WE ARE FLYING TO THE IOI! Thanks to everyone who donated and all organizations that supported our journey!** We got support for our international flights from several organizations and the raised money through the crowdfunding will go towards funding our domestic flights and IOI registration. Hello Codeforces, I, along with [user:contee,2025-06-24], [user:is-this-dp,2025-06-24], and [user:3omar_ahmed,2025-06-24], am a member of Egypt's IOI 2025 team. For the past few years, the Ministry of Communications and Information Technology has supported the Egyptian IOI team to attend the competition. However, this year we are not receiving any institutional or government support. We worked hard over the past year to get ready for the competition. The cost of attending the IOI for the Egyptian delegation, which includes our flight tickets, visa, and registration costs, is difficult for us to cover, especially given the current economic situation in Egypt. We have reached out to ...
raised money through the crowdfunding will go towards funding our domestic flights and IOI registration.

Full text and comments »

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

131.
By errorgorn, 6 years ago, In English
Tutorial on Permutation Tree (析合树) So my O level Chinese exam is in 2 days so I decided to learn a data structure that I can only find [resources](https://oi-wiki.org/ds/divide-combine/) for in Chinese. I thought I might as well write a tutorial in English. This data structure is called 析合树, directly translated is cut join tree, but I think permutation tree is a better name. Honestly, after learning about it, it seems like a very niche data structure with very limited uses, but anyways here is the tutorial on it. Thanks to [user:dantoh,2020-06-16] and [user:oolimry,2020-06-16] for helping me proofread. ### Motivation Consider this [problem](https://codeforces.me/contest/526/problem/F). We are given a permutation,$P$ of length $n$. A good range is a contiguous subsequence such that $\max\limits_{l \leq i \leq r} P_i - \min\limits_{l \leq i \leq r} P_i = r-l$. This can be thought of the number of contiguous subsequence such that when we sort the numbers in this subsequence, we get contiguous values. Count the...
query, we go to a arbitrary node that is contained in the query then using binary lifting, jump to the

Full text and comments »

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

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

Full text and comments »

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

133.
By Bakry, history, 4 years ago, In English
Egyptian team is likely not going to IOI. Again. Hello Codeforces, I'm a member of the Egyptian IOI 2022 team, and I'm not sure yet if we are going to IOI. Historically, the Ministry of Communication and Information Technology (MCIT) sponsored the Egyptian team to travel to IOI. However, this year, there is no confirmation from the MCIT's side at all. Our tickets are not booked until now, and MCIT doesn't either confirm or deny that they will sponsor us this year. Now, there are fewer tickets left, and the cost of traveling increases as we approach IOI. We all have been practicing really hard for IOI for the past few months. Now, there is very little time for us to make alternative plans to participate onsite. Note that MCIT provides training and sponsors the team every year so we expected more from the MCIT side. AASTMT has supported us with a part of ticket expenses In an attempt to collect the remaining part, we created a crowdfunding campaign. Please donate [here](https://gogetfunding.com/iiot-fundraising/). UPD: W...

Full text and comments »

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

134.
By SecondThread, history, 5 years ago, In English
"Teams" going to the 2021 Facebook Hacker Cup Finals, with tourist factors Good Morning! I'm no [user:Laggy,2021-11-24], but I thought I would continue the tradition of making a "Teams" list for the 2021 Facebook Hacker Cup Finals, since I always found the ICPC World Finals lists fun. So here goes! Facebook Hacker Cup 2021 Finalists ================== <table> <thead> <tr> <th>Rank</th> <th>Handle</th> <th>Country/Region</tb> <th>Codeforces Rating</th> <th>Hacker Cup R3 Place</th> <th>[user:tourist,2021-11-24] factor*</th> </tr> </thead> <tr> <td>1</td> <td>[user:tourist,2021-12-06]</td> <td>Belarus</td> <td>3870</td> <td>1</td> <td>50.00%</td> </tr> <tr> <td>2</td> <td>[user:Retired_MiFaFaOvO,2021-12-06]</td> <td>China</td> <td>3681</td> <td>13</td> <td>25.20%</td> </tr> <tr> <td>3</td> <td>[user:Radewoosh,2021-12-06]</td> <td>Poland</td> <td>3418</td> <td>2</td> <td>6.90%</td> </tr> <tr> <td>4</td> <td>[user:Petr,2021-12-06]</td> <td>Switzerland</td> <td>3...

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

138.
By Enigma27, history, 2 years ago, In English
ICPC : GO FOR GOLD Announcing GO For Gold Campaign (Powered by NST) ---------------------------------------------------- ![ ](/predownloaded/73/25/7325e581ded85161dadf5db1850f01addfd00938.png) #### Greeting Indian ICPC contestants !! -------------------------------- India is home to some of the brightest minds in the world, and our potential is undeniable. Yet we have a long way to go regarding Competitive Programming at ICPC. While Indian teams have shown great promise by reaching to World Finals but getting a medal is still something which we are still trying to achieve. But with our current talent and potential, we can and will achieve this. At NST, we believe the potential exists, and what’s needed is structured guidance, consistent mentorship, and a platform to hone these skills under expert supervision. That’s why we created Go For Gold, a program focused on building a culture of competitive programming excellence in India, not just for one college or a year, but as a long-term init...
ICPC : GO FOR GOLD, have a long way to go regarding Competitive Programming at ICPC. While Indian teams have shown great, initiative of Go For Gold will cover strategies to reach the programming and competitive problem culture, mentorship, and a platform to hone these skills under expert supervision. That’s why we createdGo For, Announcing GO FOR GOLD Camp ------------------, Announcing GO For Gold Campaign (Powered by NST) ----------------------------------------------------

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

141.
By Swistakk, history, 8 years ago, In English
Ultimate guide to TopCoder plugins Hi, I wanted to present to you guide on how you should set up TopCoder Arena in order to make competing in TC much more pleasant experience. Or at least guide how to do the same thing as I did which seem very comfortable to me compared to this big pain of competing in bare default Arena. In case you want to grab easy upvotes please leave here some joke about how I am jealous about ~Radewoosh,2018-08-16 getting insane boost in his contribution by writing his blogs, but the real reason is that I screwed my setup recently and needed to go through this painful and magical setup once again and it seems this information is very nontrivial and not available publicly in a known place (which I believe is one of reasons TopCoder is losing its popularity, but I hope thanks to this post I can give slight boost to it by settling up Arena problems once and for all for many people), so I wanted to share it with others. I want to express my sincere thanks to [user:tomasz.kociumaka,2018-08-16] for guid...
2) Go to Arena, log in and go to Options->Editor->Add and fill this accordingly:, 5) Restart you Arena and you are ready to go! Go to some practice room and do Div2 250 to, So let's go to the point of how we should go about setting this up:

Full text and comments »

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

142.
By Sol1, 4 years ago, In English
Unofficial tutorial to Codeforces Round 844 (A-G) Seems like the official editorial has not been released for a long time, I'll try to provide an unofficial one for those who are tired of waiting. But I'm too weak to understand the solution to H by reading others' code :(. If you know the solution, I'll appreciate it if you can explain it to me. Implementation can be seen in my [submissions](https://codeforces.me/submissions/Sol1/contest/1782). This is the first time I write an English editorial like this. If there's anything inappropriate, kindly point out. A ------------------ Note that you have to move from the bottom to the top no matter what, so we can consider the following problem: Given 2 points $A,B$ in a $w\times d$ rectangle, find one path from $A$ to $B$ that moves parellel to the edges of the rectangle and touch the edges at least once. After we get the answer to this problem, we can add $h$ to it to get the answer of the original. This problem is easy to solve: iterate over which edge to touch, and the d...
Observe that: if $a_i \geq a_j$, and $i$ goes but $j$ does not go, then one of $i,j$ must be sad.

Full text and comments »

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

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

Full text and comments »

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

144.
By kostka, 2 years ago, In English
Congratulations to the winners of the 2nd Universal Cup Semifinal! We’re excited to share that the **Universal Cup Summer Summit 2024**, sponsored by Huawei, just wrapped up in the beautiful Cancun, Mexico! ![ ](/predownloaded/2d/b9/2db998d0e500754097aab836010f4a903bf26bcf.jpg) ![ ](/predownloaded/d5/5f/d55f2cb20af1268fbb49cfde93c34a84fc93121d.jpg) ![ ](/predownloaded/8c/9b/8c9bda7ee471605ce6af0e80da5c9b979fd7d07e.jpg) The highlight of the event was the 2nd Universal Cup Semifinal, where 200 teams competed both onsite and online. A huge shoutout to all our onsite teams: **Gold Medal** * USA1 ([user:ecnerwala,2024-06-25], [user:ksun48,2024-06-25], [user:tourist,2024-06-25]) **Silver Medal** * Polish Mafia ([user:Swistakk,2024-06-25], [user:Radewoosh,2024-06-25], [user:Marcin_smu,2024-06-25]) **Bronze Medal** * HoMaMaOvO ([user:maroonrk,2024-06-25], [user:maspy,2024-06-25], [user:hos.lyric,2024-06-25]) **Honourable Mention** * 03 Slimes ([user:orzdevinwang,2024-06-25], [user:Rewinding,2024-06-25], [user:TLE,2024-06-25...

Full text and comments »

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

145.
By Endagorion, 12 years ago, translation, In English
Codeforces Round #265 Hi all. On [Sunday, September 7, at 19:30 MSK](http://www.timeanddate.com/worldclock/fixedtime.html?day=7&month=9&year=2014&hour=19&min=30&sec=0&p1=166) regular, 265-th, Codeforces round will take place. Problems are prepared by me, Mikhail Tikhomirov. Round will be for both divisions. Standard (not dynamic) scoring will be used for this round. **Div. 1: 500-1500-1500-2000-2500** **Div. 2: 500-1000-1500-2500-2500** I would like to thank Gerald Agapov ([user:Gerald,2014-09-07]) for his help in problems preparation, Filipp Rukhovich ([user:DPR-pavlin,2014-09-07]) and Alexander Mashrabov ([user:map,2014-09-07]) for round testing, Maria Belova ([user:Delinur,2014-09-07]) for English statements and Mikhail Mirzayanov ([user:MikeMirzayanov,2014-09-07]) for creation and development of Codeforces project. This is going to be my third round on Codeforces, and I tried to make problems as interesting and diverse as possible. Hope you will enjoy this round. Best of luck! =) **...

Full text and comments »

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

146.
By Updown, 8 years ago, In English
Teams going to ACM-ICPC World Finals 2019 Completed List! [user:Luqman,2019-01-30] said he [isn't creating a chart](https://codeforces.me/blog/entry/64899?#comment-488294) of teams going to ACM-ICPC this year as he isn't competing, so I added in all the teams. Let's complete the table together! For the teams where I don't know the cf handles of the team members, I put their names instead. Europe ====== | Count | Country | Region | University | Member 1 | Member 2 | Member 3 | | ----- | ------- | ------ | ---------- | -------- | -------- | -------- | | 1 | Romania | SEERC | Alexandru Ioan Cuza University of Iași | [user:Juve45,2019-01-31] | [user:Cristian1997,2019-01-31] | [user:Sin,2019-01-31] | | 2 | Switzerland | SWERC | ETH Zürich | [user:TimonKnigge,2019-03-08] | [user:zaspagety,2019-03-08] | Stefanie Zbinden | | 3 | Netherlands | NWERC | Leiden University | [user:pimsp,2019-03-08] | Onno Berrevoets | Daan van Gent | | 4 | Ukraine | SEERC | National Technical University "Kharkiv Polytechnic Institute" | [user:vlad8,2019-02-0...

Full text and comments »

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

147.
By maomao90, 3 years ago, In English
Editorial for Hello 2024 ### [problem:1919a] Author: [user:maomao90,2024-01-02] <spoiler summary="Hint 1"> When does the game end? </spoiler> <spoiler summary="Solution"> Depending on whether the player chooses to exchange wallets with their opponent on step $1$, $1$ coins will be removed from either the opponent's wallet or the player's wallet. This means that if either of the players still has remaining coins, the game will not end as at least one of the choices will still be valid. The only way that the game ends is when both players have $0$ coins. Since each operation decreases the total amount of coins by exactly $1$, the only way for Alice to win the game is if $a + b$ is odd. </spoiler> <spoiler summary="Code"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int a, b; cin >> a >> b; if ((a + b) % 2 == 0) { cout << "Bob\n"; } else { cout << "Alice\n"; } } ...
where the prefix sum becomes $0$ again for the prefix sum to go from negative to the final positive

Full text and comments »

Tutorial of Hello 2024
  • Vote: I like it
  • +760
  • Vote: I do not like it

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

Full text and comments »

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

149.
By -is-this-fft-, 5 years ago, In English
[Tutorial] Proving the inverse Ackermann complexity of Union-Find #### Introduction Most of us are familiar with the union-find data structure and the two optimizations one can do on it: _union by rank_ and _path compression_. Most tutorials will introduce these methods and state that if both optimizations are used, the complexity will be $\mathcal{O}((n + m) \alpha(n))$. Here, $n$ and $m$ are the number of vertices and queries respectively. What is $\alpha$? Generally, we are told that $\alpha$ is some mysterious function that grows very slowly: $\alpha(N) < 5$ where $N$ is the number of subsets of particles in the observable universe and whatnot. What it is is usually not clarified very much. And there is typically no proof (or intuition and other such justifications) as to why the complexity is like that: usually we're told that the complexity analysis is quite long and complicated. At the time of writing, both [cp-algorithms](https://cp-algorithms.com/data_structures/disjoint_set_union.html) and [Wikipedia](https://bit.ly/3EvnzrI) are like th...
weight 1 before we go over the height of the forest.

Full text and comments »

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

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

Full text and comments »

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

151.
By beaaaan, history, 20 months ago, In English
The very first red LLM cheater? Let me introduce you to [user:lequoctran181,2025-04-06] a.k.a Lê Trần Quốc Anh, a shining star in the competitive programming community from National Economics University, Hanoi. He is a philosopher who talks about CP-ing quite a lot on his Facebook page, sharing tips, talking about his journey, etc... ![ ](https://i.imgur.com/VAEYfGh.png) ![ ](https://i.imgur.com/vTQHQrk.jpeg) ![ ](https://i.imgur.com/cT5jp7Y.png) I admit, he is skilled, but not at cp, but at cheating. The first time I paid attention to this account was in December of 2024, where he had 2 different templates, submitting C and D only around 10 minutes apart from each other, and achieving rank 35 on [contest:2042], notice how he didn't space down, and the different way of naming variables: ![ ](https://i.imgur.com/0t0x1OD.png) ![ ](https://i.imgur.com/5OFpgeX.png) Now, after this "achievement", of course, he would be very proud, as seen bragging about it here on the blog post of the round: ![ ](h...
This is all I have. Before I go, take this lovely picture of the NEU.Newbies team standing together

Full text and comments »

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

152.
By Zhtluo, history, 3 years ago, In English
All You Need is Randomly Guessing — How to Improve at Codeforces I hope [my previous blog](https://codeforces.me/blog/entry/126310) has convinced you that the best way to improve at Codeforces is to be more Russian, i.e. to improve your math capability. Unfortunately, humble mortals such as you and I are not gifted with the talent that esteemed Russian grandmasters such as 74TrAkToR had: _Surely, it is beneficial to have a code reference for many algorithms and data structures, but I also think that just superficially knowing the algorithm and maybe having implemented it once or twice before is sufficient to use it without a reference?_ _&mdash; Some other Codeforces grandmaster_ Therefore, in this blog I will explore the dark side of Russian-ness &mdash; randomly guessing &mdash; that is forsaken by every Russian grandmaster of the light side I know. However, it has been very helpful to me, and I hope that it serves you well, too. ## Example 1 I will start by using an example to demonstrate my thought process. This problem [1923C](h...
going to figure out the proof in $a$ time, so you probably should just go coding.

Full text and comments »

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

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

Full text and comments »

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

154.
By 4fecta, history, 6 years ago, In English
An Introduction to Plug DP So I realized that there are literally 0 resources written in English on Plug DP, which is one of my favourite DP tricks/techniques that I know of so far. Thus, I hope this serves as a soft introduction for English speakers to this technique, and maybe sheds some light on how powerful it can be. Before we start, I would recommend having a solid understanding of bitmask DP in general in order to get the most out of this blog. Now, let's begin. ### What is Plug DP? In short, Plug DP is a bitmasking technique that allows us to solve complicated problems with relatively simple states and transitions. To illustrate Plug DP in its most primitive form, let's visit a rather classical problem: **How many ways can we fully tile an $N \times M$ grid with $1 \times 2$ dominoes?** This problem can be solved with a standard row-by-row bitmasking approach, but the transitions for that DP state is annoying and unclear at best. Instead, let's investigate an approach that uses a slightly differ...
to go.

Full text and comments »

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

155.
By -is-this-fft-, 4 years ago, In English
[Tutorial] My way of understanding Dinitz's ("Dinic's") algorithm **Part 1: [Tutorial] My way of understanding Dinitz's ("Dinic's") algorithm** [Part 2: [Tutorial] Minimum cost (maximum) flow](https://codeforces.me/blog/entry/105330) [Part 3: [Tutorial] More about minimum cost flows: potentials and Dinitz](https://codeforces.me/blog/entry/105658) #### Introduction My philosophy on writing blogs is that I only write blogs when I feel that I have something new and interesting to contribute. This is usually not the algorithm itself, of course, but it can be that I recently found or heard of a new perspective or I figured out a way to explain something in a new way. This is in contrast to my dear colleagues at GeeksForGeeks who write the most low-effort (and often wrong) tutorial on everything and then sit at the top of Google results using their somehow world-class SEO. This is one such case. I have an idea how to explain Dinitz's algorithm in a way I haven't heard of before (but it is not very hard to come up with, so this is...
because no flow gets actually pushed. The next time we are in the same vertex, we are going togo, junction must go out of a junction, and no more can come out of a junction than what came in., visually distinguished in the figure. All edges in the DAG go from one layer to the next; edges

Full text and comments »

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

156.
By antontrygubO_o, 5 years ago, In English
Support Ukraine (Now with Crowdforces too) I know that a lot of people here care about the war in Ukraine. If you are looking for ways to help, please, visit this link: http://linktr.ee/help_ukraine_global. Any support matters, any help matters. Please, help to stop the bloody dictator of our neighbor. **UPD1:** [Another very good site](https://www.standwithukraine.how/) **UPD2:** [With this website](https://stop-russia.near.page/) you can help to show Russians what's really going on in Ukraine. Props to this [post](https://codeforces.me/blog/entry/100453). **UPD3:** If your CF profile had country set to Ukraine at the moment of [this](https://codeforces.me/blog/entry/100459) post, and you haven't created Crowdforces account yet, you can do it by this link: https://nearcrowd.com/crowdforces, and receive 12 Near (which is around 100$ now). You can find detailed instructions [here](https://docs.google.com/document/d/1q_t_hdfVIYSGlMsOWsz3jhEEaLBfY1Yp/edit). This document is available only in Ukrainian for now. Ple...

Full text and comments »

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

157.
By flaviu2001, history, 6 years ago, In English
Codeforces Round #676 (Div. 2) Hi Codeforces! [user:stefdasca,2020-10-17], ~koala_bear00,2020-10-14 and I are very excited to announce our first contest [Codeforces Round #676](https://codeforces.me/contest/1421), which will take place [contest_time:1421]. The round will be rated for participants with rating up to 2099. The tasks were written by me with help from [user:stefdasca,2020-10-14] and [user:koala_bear00,2020-10-14] and you have to help some of the authors' favorite musical artists to solve the problems they're faced with. We hope we compiled a very interesting contest with memorable tasks :) Special thanks to: * [user:antontrygubO_o,2020-10-14] for coordinating our round and pushing us to come up with more and more interesting tasks. * [user:dorijanlendvaj,2020-10-14], [user:kclee2172,2020-10-14], [user:Devil,2020-10-14], [user:thenymphsofdelphi,2020-10-14], [user:jainbot27,2020-10-14], [user:Stelutzu,2020-10-14], [user:proggerkz,2020-10-14], [user:SleepyShashwat,2020-10-14], [user:bh...

Full text and comments »

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

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

Full text and comments »

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

159.
By codetiger927, history, 5 years ago, In English
Introducing CF Stonks — A Virtual Stock Market Based on Your CodeForces Rating! **2/11/2023 Update**: There had been a month-long hiatus due to the CF name change magic (and my own laziness oops), but everything has been fixed now :D! However, I know a lot of people have gone inactive due to the month-long market closure, so I am hoping to **relaunch StonksCF** in the near future with some new mechanisms (dividends, automatic algorithm trading, etc.). Let me know if you have any ideas! In the meantime, feel free to continue exploiting the way-over-inflated economy and embrace your inner capitalism >:D **Final Update**: We now have our own **DISCORD SERVER**. Join us for the latest information and engage with the community at [https://discord.gg/AeH2GTwkF5](https://discord.gg/AeH2GTwkF5) All the announcements will be there instead of on this page Greetings Fellow CodeForces users! I am proud to introduce my latest project, [CF Stonks](https://codetiger.me/project/StonksCF) (aka StonksCF), which is a virtual stock market based on your CodeForces rating. ...

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

162.
By -is-this-fft-, history, 7 years ago, In English
Some notes on rating inflation ### Introduction Recently there have been several suggestions that there is significant rating inflation now due to COVID-19. The typical hypothesis seems to be along the lines of: > Because people stay at home more now, there is a lot of new inexperienced users who add a lot of rating to the system, pushing "old" users upwards without actual improvement. A simplified and a bit more general hypothesis that I'm going to test: > Because of the virus I'm gaining more rating than usual without working more. But most of these comments are based on anecdotal evidence, which is not worth much. I wanted to see if there is any truth to these claims. Specifically, this blog is an implementation (although I modified the approach a bit) of the following [comment](https://codeforces.me/blog/entry/20638?#comment-601634) by [user:geckods,2020-04-15]: ![ ](https://i.imgur.com/8vM7iDZ.png) [cut] $~$ ### Methodology Let's define the "test period" and "control period". ...

Full text and comments »

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

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

Full text and comments »

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

164.
By Qingyu, 21 month(s) ago, In English
The 2025 Universal Cup Finals — Wrap up We are excited to share that The 2025 Universal Cup Finals just successfully wrapped up in Dongguan, China! <center> <img src="/predownloaded/cf/81/cf81069734f8d9b6e994f27c84e2781ccbe20c38.jpg"> </center> What a wonderful week! In our five-day event, participants went to the city tour of Guangzhou, competed in the Challenge session, participated in the Conference for Competitive Programmers, and most importantly, our main competition &mdash; The 2nd Universal Cup Finals! <div class="row"> <img src="/predownloaded/f5/d8/f5d8cd3b6264dfe7de13433662a7a1fbe61293f0.jpg" style="height: 262.0px;max-width: 100.0%;max-height: 100.0%;"> <img src="/predownloaded/cb/40/cb4020f1b2f88fc7cd7e40f11ccda90c88df26ba.jpg" style="height: 262.0px;max-width: 100.0%;max-height: 100.0%;"> </div> <div class="row"> <img src="/predownloaded/88/82/88820a183af6e038ba219c5887674276cd29322d.jpg" style="height: 262.0px;max-width: 100.0%;max-height: 100.0%;"> <img src="/predownloaded/8d/ab/8daba...

Full text and comments »

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

165.
By maroonrk, history, 20 months ago, In English
What to be careful about when submitting your problems to other contests This is a story about my recent contest participation. Let's call the contest X. X was an international contest with online qualification rounds and the onsite Finals, with trip and hotel expenses covered by the organizer. In other words, X was a very important contest for me. Hoping to go to the Finals, I participated in the qualification round. However, when I opened the last problem, I immediately remembered that the exact same problem had previously been submitted to AtCoder. I also knew that the submitter of that problem was among the organizers of X. Let's call the author of that problem Y. I immediately messaged Y about this issue. At first, I thought that Y had simply forgotten that he had submitted the problem to me, but the situation was a bit more complicated. Y _did_ remember he had submitted the problem to me but still used it in another contest. Why? Because I had given him permission! To make things clear, let me show you the relevant chat log betw...
Hoping to go to the Finals, I participated in the qualification round. However, when I opened the

Full text and comments »

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

166.
By GlebsHP, history, 10 years ago, translation, In English
The king is dead, long live the king! Dear community! It was a fantastic year, with great pleasure I took a role of Codeforces Coordinator. This year I learned a lot, communicated with wonderful people and realized how valuable this work is for thousands of people. I would like to thank you all for these great moments! I strongly believe that there are many cool rounds and interesting problems ahead as I'm passing this duty to Nikolay [user:KAN,2017-01-01] Kalinin! Please, watch my New Year's speech (Russian language, English subtitles): <br> <iframe width="560" height="315" src="https://www.youtube.com/embed/j_9n0iwEeYY" frameborder="0" allowfullscreen></iframe> P.S. Special thanks go to Maxim [user:zlobober,2017-01-01] Akhmedov and Oleg [user:shhdup,2017-01-01] Mingalev who helped me prepare this video.
P.S. Special thanks go to Maxim [user:zlobober,2017-01-01] Akhmedov and Oleg [user:shhdup,2017-01

Full text and comments »

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

167.
By Monogon, 4 years ago, In English
[Tutorial] Supporting Priority-Queue-like Undoing on DS _Good morning!_ In this blog, I will present an online algorithm that can perform priority-queue-like undoing on a data structure, given a few assumptions. I will also present and solve a generalization of that problem. For context, I highly recommend reading this blog that shows how to solve the easier problem of queue-like undoing. That blog gave me the inspiration for the trick I will describe here, but I will still try to write this blog so that it can be understood without it. Thank you [user:Noam527,2023-01-08] for introducing such a great trick to the competitive programming community. [[Tutorial] Supporting Queue-like Undoing on DS](https://codeforces.me/blog/entry/83467) Acknowledgment ----------------- Huge thanks go to [user:peltorator,2023-02-20] for hosting a [blog contest](https://codeforces.me/blog/entry/110840). His generous prize of $300 got many people to write blogs on new, interesting ideas, and it was one of the main reasons I wrote this blog. I'm...
Huge thanks go to [user:peltorator,2023-02-20] for hosting a [blog contest](https://codeforces.com

Full text and comments »

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

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

Full text and comments »

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

169.
By Monogon, history, 6 years ago, In English
[Tutorial] Voronoi Diagram and Delaunay Triangulation in O(n log n) with Fortune's Algorithm What's a Voronoi Diagram? ------------------ Given a set $S$ of $n$ points in the 2D plane, the Voronoi diagram is a partition of the plane into regions. The region associated with a point $p\in S$ contains precisely the points $q$ such that $q$ is closer to $p$ than any other point in $S$. In other words, a point $q$ belongs to the region of its nearest neighbor. <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Euclidean_Voronoi_diagram.svg/1024px-Euclidean_Voronoi_diagram.svg.png" width="300px" height="auto"/> The Voronoi diagram can be represented by the planar graph of boundaries between regions. A vertex in this graph is where three or more segments meet (or a point at infinity), and an edge is a segment connecting two of these vertices. The way the regions were defined, we see that a segment contains the points equidistant to two points in $S$, so it is part of their perpendicular bisector. Similarly, a Voronoi vertex is equidistant to three or more v...

Full text and comments »

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

170.
By -Morass-, history, 9 years ago, In English
Problem Topics Good Day to you! I've been asked to make some topic-wise list of problems I've solved. Even though I couldn't involve all problems, I've tried to involve at least "few" problems at each topic I thought up (I'm sorry if I forgot about something "easy"). I've alredy made such list once anyway I've tried to include more problems now &mdash; so here it is: <spoiler summary="aho"> http://www.spoj.com/problems/ADAJOBS/ URI 2226 (5) //[NICE][NUMBERS][DP] http://www.spoj.com/problems/SUB_PROB/en/ http://codeforces.me/contest/696/problem/D 8 http://www.spoj.com/problems/AHOCUR/ 5 //Aho-Corassic + DP https://www.codechef.com/problems/LYRC (5) //Sample aho-brute-force http://codeforces.me/problemset/problem/346/B //Proposed by [user:bradyawn,2019-08-03] </spoiler> <spoiler summary="automat"> 6861 [LA] //CYK UVA 10679 //Suffix Automat http://www.spoj.com/problems/STRMATCH/ //Suffix Automat &mdash; trie might do too http://www.spoj.com/problems/NSUBST...
11097 UVA (4) //Divide to N*1000 nodes and go!, http://codeforces.me/contest/63/problem/D (3) //NICE[GO BY LINES][4 WAYS B/D ODD/EVEN], http://codeforces.me/contest/777/problem/D (3) //just go from end, http://www.spoj.com/problems/CLSLDR/ (4) //Muchas queries — go DP, http://www.spoj.com/problems/DCOWS/ (4) //Very NICE (sort + GO), http://www.spoj.com/problems/GAMES/ (2) //EASY&NICE — Go discrete (by 10^k) → 10^k/GCD, http://www.spoj.com/problems/INGRED/ (5) //TSP-like [reduce + go], http://www.spoj.com/problems/SPCJ/ (4) //reverse + go from back, http://www.spoj.com/problems/WRONG/ (5) //VERY NICE — precalculate from back, thengo from

Full text and comments »

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

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

Full text and comments »

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

172.
By kalimm, history, 10 years ago, In English
Why We Are Going To ACM-ICPC Finals? Hi Codeforces, Me([user:ErdemKirez,2016-12-01]), [user:muratakburak,2016-12-01] and [user:onuryildiz,2016-12-01] have a competitive programming team which name is LogicError in [TOBB ETU](https://en.wikipedia.org/wiki/TOBB_University_of_Economics_and_Technology). Like a month ago, we participated at SEERC 2016. When there's just a minute before the contest finished, I completed writing problem A and submitted it. It gave a wrong answer because in one line I wrote "a[i]" instead of "b[i]". I changed it immediately but I wasn't be able to submit it because contest had finished. I downloaded code to my flash drive, hoping that somebody add this problem to Gym in Codeforces. Thanks to [user:Temirulan,2016-12-01], he added SEERC 2016 to Gym, I submitted my code on Codeforces, and it passed. I got very sad because we got 6th place and lost 2th place because of one tiny bug, and chance of going ACM-ICPC Finals same time. Two days ago I got an e-mail from "ICPC Manager", which name...
Thanks to whoever thinks "Let's top 6 team go to finals this year"!

Full text and comments »

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

173.
By adamant, 12 months ago, In English
Finding all primes up to half a billion in 83 ms Hi everyone! I was itching to apply SIMD in another problem, and this time my attention picked the following problem: --- **[Library Checker &mdash; Enumerate Primes](https://judge.yosupo.jp/problem/enumerate_primes)**. You are given $N$, $A$ and $B$. Find $\pi(N)$, and print all $p_{kA + B} \leq N$. It is guaranteed that $N \leq 5 \cdot 10^8$ and that the total number of primes to print is at most $10^6$. --- After some tweaking, I managed ([#336744](https://judge.yosupo.jp/submission/336744)) to reduce my time consumption in this problem to **83 ms** and memory consumption to **25 MiB**, which makes it a top-1 submission on the Library Checker. For comparison, the top-2 solution ([#148169](https://judge.yosupo.jp/submission/148169)) takes 172 ms and 15 MiB, meaning that what I describe here is a 2x improvement in terms of the running time. We can also compare it to what appears to be the state of the art of sieving, the [primesieve](https://github.com/kimwalisch/...
separate optimizations for small and large primes. In the standard sieve, we go over all prime numbers, well, as we now need to go over fewer numbers. This idea then maybe generalized to using a wheel of

Full text and comments »

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

174.
By Monogon, history, 5 years ago, In English
Feature Request: Consolidating Different Versions of the Same Problem First of all, Codeforces is great and I like its UI much better than other platforms. But there is one issue that annoys me repeatedly. I haven't seen it discussed in a blog yet (apologies if I missed it), so I thought I'd make this request. Sometimes I revisit a problem I solved before, and I want to see my submission. Then I get confused because I don't see my submission in the lower right corner of the problem page. Eventually, I find that I need to view a different link that shows the same problem. Now, it makes some sense that the same problem should have different links. For example, if I'm viewing the problem in a virtual contest, I want to see the correct short-name depending on the division. If the problem is div2C, I want to see C if I got there from div2, or A if from div1. Another example is that if a problem came from the contest, I don't want to see tags, but I might if I got there from the problemset. So, a problem can have multiple links. For example, all these...
So, a problem can have multiple links. For example, all these 6 links go to the same problem:

Full text and comments »

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

175.
By sevlll777, history, 4 years ago, translation, In English
Editorial of Codeforces Round 860 (Div. 2) Thank you all for participating, I hope you enjoyed the problems! You can rate the problems of the round in the corresponding spoilers. [problem:1798A]<br> <div class="spoiler"> <b class="spoiler-title">Hint 1</b> <div class="spoiler-content" style="display: none;"> For each index $i$, it makes no sense to perform the operation $\ge 2$ once, since applying the operation with the same index twice does not change anything. </div></div> <div class="spoiler"> <b class="spoiler-title">Hint 2</b> <div class="spoiler-content" style="display: none;"> Condition $a_n = \max(a_1, a_2, \ldots, a_n)$ is equivalent to $a_i \leq a_n$ for all $i$. So for each index $i$ there are only 2 conditions: $a_i \leq a_n$ and $b_i \leq b_n$. </div></div> <div class="spoiler"> <b class="spoiler-title">Tutorial</b> <div class="spoiler-content" style="display: none;"> [tutorial:1798A]</div></div> <spoiler summary="Solution"> ``` for _ in range(int(input())): n = int(input()) a = li...
= 0 for i in range(n, 0, -1): go[i] = i + a[i] + 1 if go[i] == n + 1 or (go[i

Full text and comments »

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

176.
By YouKn0wWho, 3 years ago, In English
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 ...
resources than before and ordered by which one you should go through first. I have also cited the original

Full text and comments »

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

177.
By Noam527, history, 6 years ago, In English
Problem Likeability Feature Proposal -------- The feature to "star" or "favorite" a problem already exists; if you go to the problemset archive, you can choose to mark any problem as favorite. Same holds for marking any contest. Unfortunately, it seems the only use for this feature, is so one could revisit his favorite problems in the future &mdash; you can't view the favorite problems of other participants. I think this feature can be easily extended to something more meaningful. Maintain for each problem, the number of accounts who liked it (now referred to as the likeability of the problem). Then implement the option to filter (or sort) problems by their likeability (hopefully filtering problems by likeability could be combined with sorting by the number of people solved, so that people could find their own difficulty level). Same could go for contest likeability. Pros -------- - I think this can mainly help beginners. I hope that people who try out competitive programming for the first time, ...
The feature to "star" or "favorite" a problem already exists; if you go to the problemset archive

Full text and comments »

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

178.
By Xellos, history, 11 years ago, In English
Codeforces Round #333 <center><img src="https://lh3.googleusercontent.com/--HN6DjhjZaM/VlNt6NQ6olI/AAAAAAAAAuQ/w6wSlj7rl0k/s250-Ic42/"></img><div>(<a href="http://i2.kym-cdn.com/photos/images/newsfeed/000/582/289/38f.gif">original</a>)</div></center> Hello everyone! CF round #333 (both divisions) is going to take place [today](https://www.timeanddate.com/worldclock/fixedtime.html?day=24&month=11&year=2015&hour=19&min=35&sec=0&p1=166). The authors of this round are me and [user:Baklazan,2015-11-18]. By total coincidence, I'm the author of even-indexed problems and Baklazan the author of odd-indexed problems. Now I'm going to let you wonder if it's 0-based or 1-based :D. As usual, thanks to [user:GlebsHP,2015-11-19] for his help (in particular, helping us not overkill the problems), [user:MikeMirzayanov,2015-11-19] for CF and Polygon, [user:Delinur,2015-11-24] for problem statement translations and our testers: [user:misof,2015-11-24], [user:Mimino,2015-11-24], [user:AlexFetisov,2015-11-24] and [u...

Full text and comments »

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

179.
By Ari, history, 6 years ago, In English
Codeforces Round #715 Editorial <strike>Note: I can't figure out how to place the tutorials inside spoilers. If someone is familiar with how CF spoilers work and can help I would really appreciate it. For now, be warned that the tutorials are visible by default (but everything else isn't)</strike> **UPD:** I figured out how to use spoilers! Also added implementations for all problems. Thanks for participating in our contest! [problem:1509A] Author: [user:Kuroni,2021-04-13] <br> First solve: [user:cfg0d,2021-04-16] at 00:01:02 <spoiler summary = "Hint"> How can you write the condition that $\frac{a_u + a_v}{2}$ is an integer in a more useful way? Think of the parities. </spoiler> <spoiler summary = "Tutorial"> [tutorial:1509A] </spoiler> <spoiler summary = "Comments from the authors"> ![ ](https://i.imgur.com/voR4hTu.png) </spoiler> [Implementation](https://codeforces.me/contest/1509/submission/113263196) [problem:1509B] Author: [user:Ari,2021-04-13] <br> First solve: [user:bl...

Full text and comments »

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

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

Full text and comments »

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

181.
By awoo, history, 6 years ago, translation, In English
Educational Codeforces Round 94 Editorial [problem:1400A] Idea: [user:BledDest,2020-08-26] <spoiler summary="Tutorial"> [tutorial:1400A] </spoiler> <spoiler summary="Solution (adedalic)"> ~~~~~ fun main() { repeat(readLine()!!.toInt()) { val n = readLine()!!.toInt() val c = readLine()!!.groupingBy { it }.eachCount().maxBy { it.value }!!.key println(c.toString().repeat(n)) } } ~~~~~ </spoiler> [problem:1400B] Idea: [user:adedalic,2020-08-26] <spoiler summary="Tutorial"> [tutorial:1400B] </spoiler> <spoiler summary="Solution (adedalic)"> ~~~~~ fun main() { repeat(readLine()!!.toInt()) { val (p, f) = readLine()!!.split(' ').map { it.toInt() } var (cntS, cntW) = readLine()!!.split(' ').map { it.toInt() } var (s, w) = readLine()!!.split(' ').map { it.toInt() } if (s > w) { s = w.also { w = s } cntS = cntW.also { cntW = cntS } } var ans = 0 for (s1 in 0.....
int go(int v, int c) { if (trie[v].go[c] == -1){ if (trie[v][c] != -1

Full text and comments »

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

182.
By EbTech, history, 4 years ago, In English
Elo-MMR ratings go live on CodeChef! Readers of my Codeforces blog may recall that [user:inutard,2022-07-10] and I have been experimenting with rating systems for quite some time. Last year, we demonstrated how to [break the Topcoder system](https://codeforces.me/blog/entry/87848), and [published our findings](https://github.com/EbTech/Elo-MMR/blob/master/paper/EloMMR.pdf) at the World Wide Web 2021 research conference. There, we derived a new Bayesian rating system from first principles. This system was specifically motivated by sport programming, though it may in theory be applied to any sport that ranks lots of contestants. Recently, it was adopted by the [Canadian contest judge, DMOJ](https://dmoj.ca/post/206-ratings-migrated-to-elo-mmr). Now, in collaboration with the CodeChef admins, we are pleased to announce that upon the completion of [July Lunchtime](https://www.codechef.com/LTIME110), the Elo-MMR rating system goes live on [CodeChef.com](https://codechef.com)! While recognizing that any rating system migrat...
Elo-MMR ratings go live on CodeChef!, disruptive, we hope that you’ll find the advantages worthwhile. Let’s briefly go over them. Elo-MMR is:

Full text and comments »

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

183.
By Errichto, 10 years ago, In English
Good Bye 2016 — hints and codes You can download my codes to all problems [here](http://www.filedropper.com/codes_1). I will write a full editorial in the next few days. Now you can read hints and short solutions. [problem:750B] <spoiler summary="hint"> Create a variable that will denote your current distance from the North Pole. What are allowed values of this variable? When can't we go West or East? </spoiler> [problem:750C] <spoiler summary="hint1"> Let $x$ denote the initial rating (or his final rating, whatever is easier for you to think about). The information that Limak is in some division in the $i$-th contest gives us some inequality for $x$. Can you see it? </spoiler> <spoiler summary="hint2"> For every contest we know that the current rating is $x$ increased by some prefix sum of c_i (changes of rating). If Limak is in the division 1, we have inequality x+prefSum >= 1900 so we have x >= 1900-prefSum. If Limak is in the division 2, we have inequality x_prefSum <= 1899 so it is ...
Where should we go now? , Where should you go now to find the root?

Full text and comments »

Tutorial of Good Bye 2016
  • Vote: I like it
  • +168
  • Vote: I do not like it

184.
By neal, 8 years ago, In English
Quick unofficial editorial for Educational Round 59 (Div. 2) Continuing with the theme from last time, here's a quick writeup of my approaches: #### [problem:1107A] Since we just want to make two numbers such that the first number is smaller than the second, our best bet is to use only the first digit for the first number and the rest of the digits for the second number. Note that since the numbers can have up to 300 digits we shouldn't actually evaluate the second number. Instead, since the digits only include 1 through 9, we can handle that case by checking the number of digits. Code: [submission:49002957] #### [problem:1107B] The key observation is that the digital root of an integer $k$ is the single-digit number $1 \leq d \leq 9$ such that $k \equiv d \bmod 9$. You can prove this by noticing that $10^p \equiv 1 \bmod 9$ for all $p$. Once we observe this, finding the $k$-th number is very simple; see the code: [submission:48993705] #### [problem:1107C] Since we are only allowed to push the same button $k$ times in a row, let's do...

Full text and comments »

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

185.
By Radewoosh, history, 8 years ago, In English
Should I start writing regular blogs? Hello codeforces! I want to share my idea with you. I've noticed that I know some nice tricks and some tasks with very educative solutions, which might be interesting, surprising or useful in other tasks. Recently I am considering starting my own blog, where I'd share chosen tasks with you and write about possible ways to solve them. I wanted to ask the community about it, cause I don't want you to hate this idea and write comments like "boooo, we already have Petr's blog, you are just copying his idea, you just want contribution, you are next [user:Swistakk,2018-08-12], go away". What do you think about this idea? I'd be able to change form of this blog as you wish and add additional sections. Should I write such blogs?
[user:Swistakk,2018-08-12], go away".

Full text and comments »

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

186.
By Um_nik, history, 5 years ago, In English
Petition to make (onsite part of) ICPC WF 2020 1-computer In case you haven't heard: ICPC announced that in the Championship (onsite in Moscow) Division of ICPC World Finals 2020 teams will use 3 computers (one per participant). And they did that less than 40 days before the contest itself. I think this is ridiculous and this is not the competition we have been preparing for all these years. If you think the same, please comment under this blog in a format you deem reasonable (you can follow my format or not). Moreover, there was a suggestion from [user:Alex_2oo8,2021-09-09] to ignore ICPC and self-impose the rule to use one computer at a time. If you want to do that (in case ICPC will go with 3 computers per team), you can add such a statement to your comment too.
the rule to use one computer at a time. If you want to do that (in case ICPC willgo with 3 computers

Full text and comments »

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

187.
By Phantasmagorias, history, 5 years ago, In English
Codeforces Round #745 Editorial I'm very sorry about all the inconvenience, and I would like to bear the blame. Much thanks to those who help me prepare this round. It's not their fault. And much thanks to your participation. [problem:1581A] ------------------ idea: [user:interlude,2021-09-30] preparation: [user:CQXYM,2021-09-30] tutorial: [user:CQXYM,2021-09-30] Assume a permutation $p$, and $\sum_{i=2}^{2n}[p_{i-1}<p_i]=k$. Assume a permutaion $q$, satisfying $\forall 1 \leqslant i \leqslant 2n, q_i=2n-p_i$. We can know that $\forall 2 \leqslant i \leqslant 2n,[p_{i-1}<p_i]+[q_{i-1}<q_i]=1$. Thus,$\sum_{i=2}^{2n}[q_{i-1}<q_i]=2n-1-k$, and either $p$ should be counted or $q$ should be counted. All in all, the half of all the permutaions would be counted in the answer. Thus, the answer is $\frac{1}{2}(2n)!$. The time complexity is $O(\sum n)$. If you precalulate the factors, then the complexity will be $O(t+n)$. ----- <spoiler summary="solution"> ~~~~~ #include<stdio.h> int f[100001]; int m...

Full text and comments »

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

188.
By Petr, 14 years ago, In English
Judges adding tests against submitted solutions during the contest In the discussion at [http://codeforces.me/blog/entry/6870#comment-125383](http://codeforces.me/blog/entry/6870#comment-125383) it became apparent that [user:Jacob,2013-03-11] has submitted a solution for Round 172 Problem E that passed all system tests, and was not challenged, but in the end he didn't get the score for it because a tester has decided to stress-test it against a correct solution and add tests where it fails to the system test. I think this is an awful, awful decision, as it goes against the spirit of progamming competitions: automatic judging and complete objectivity it gives. There are so many ways this can discriminate against [user:Jacob,2013-03-11]: - Had I submitted a solution for problem E, the tester might not suspect it would be a wrong greedy (because I'm in top 10 by rating) and would not add tests, and I'd get the points. - Maybe some people who opted for solving problem D instead also submitted wrong solutions, but since there were more than one...

Full text and comments »

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

189.
By peltorator, 4 years ago, In English
Codeforces Month of Blog Posts Results One and a half months ago [I proposed a challenge](https://codeforces.me/blog/entry/110840) to every one of you to get something from your drafts or from your head and actually write a blog post about it. I got a bunch of submissions, and you can find the links to all of them throughout this blog post (I was actually surprised that all entries were meaningful and interesting, so I definitely recommend checking them out). If you submitted an entry and I didn't mention it here, it is not purposeful! Indicate it via a direct message and I will include it here. It was just a bit hard to keep track of all submissions. I went through all the submissions. Some of them were very complicated, and I tried my best to get the overall idea but I will need to come back to dive deeper into some technical proofs. However, I believe that these technicalities that I glanced through do not affect my decisions. We are ready to present the winners! Regarding the first place, there was no doubt in my...
It was a hard decision but I decided to go with the first one as the topic resonated more with me

Full text and comments »

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

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

Full text and comments »

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

191.
By sslotin, 5 years ago, translation, In English
I'm writing a book *UPD (2021-10-13): I've just discovered that I published this post for Russian audience only :(* Hi everyone! [I'm writing a book](https://en.algorithmica.org/hpc) about performance engineering: the art of optimizing algorithms beyond just asymptotic complexity. The book walks through the main CPU optimization techniques such as caching, SIMD and pipelining while exploring many large case studies where we speed up some classic algorithm or a data structure, closely matching or even improving on the state-of-the-art. You will probably not learn a single asymptotically faster algorithm there, but it will help you not to get TL when you are supposed to get AC, and sometimes get AC when you are supposed to get TL. Among the stuff that you are probably most interested in: - [A version of segment tree](https://github.com/sslotin/amh-code/blob/main/segtree/refactor2.cc) that can compute prefix sums in 2ns plus the time of the slowest memory read if the array doesn't fit in L...

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

196.
By Zanite, 3 years ago, In English
[Photos Dump] Jollybee CP Team, the Luxor WF, and the Indomie Aftermath Whether or not you went to the ICPC WF 2023 in Luxor, you might remember us from the [Indomie trade offer blog](https://codeforces.me/blog/entry/127903) a while back. Aside from my team ([user:rfpermen,2024-04-30], me, [user:vioalbert,2024-04-30], and [user:siplusplus,2024-04-30] as coach) in the previous blog, of course our university's team for the 46th WF ([user:Owmicron,2024-04-30], [user:zeroscar,2024-04-30], [user:KerakTelor,2024-04-30], and [user:Yoshiyuki,2024-04-30] as coach) also joined us in many of our activities, including finding people to trade and/or give the two boxes of Indomie we brought to Luxor. In this blog, I'd like to share some of the pictures we ([Jollybee](https://www.instagram.com/binusjollybee/), the CP team in our university) took with others during the WF. **UPD:** There were several issues with the images; they weren't loading properly. The images are now hosted on ImgBB. ## Signed T-Shirts After doing something similar when I was parti...

Full text and comments »

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

197.
By Errichto, 8 years ago, In English
ROI 2018 in GYM Hi. On Wednesday at [9:05 CET / 8:05 UCT](https://www.timeanddate.com/worldclock/fixedtime.html?day=27&month=3&year=2019&hour=11&min=5&sec=0&p1=166) you can participate in the GYM version of the finals of 2017-2018 Russian Olympiad in Informatics (ROI), Day 1. And on Thursday there will be day 2, same time. Links to GYM contets: [day1](https://codeforces.me/gym/102147) and [day2](https://codeforces.me/gym/102154). 5 hours, 4 problems, IOI-style scoring with subtasks. Statements will be available in three languages: English, Russian, Polish. We wanted to use those problems in a camp in Warsaw so we had to import the problems to some system anyway. Then why not Polygon+Codeforces and thus allowing everybody to participate? Huge thanks to [user:MikeMirzayanov,2019-03-25] for helping me with using GYM. And credits to problem authors: [user:Andreikkaa,2019-05-21] for Radium, [user:Endagorion,2019-05-21] for Viruses, [user:pashka,2019-05-21] for Innophone, Георгий Корнее...
must quickly go to the next (biggest) critical number, say that its first digit 1 must stay, This way we can go from higher bits, check if we can have 0 here in the answer (by running the

Full text and comments »

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

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

Full text and comments »

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

199.
By vbandurin, history, 3 years ago, In English
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...
If you need to find problem by its URL, Сopy it, go to the 'Search' page, and find the desired, If you want to create a preview for a few tests, you can go to the 'Tests' page, select the tests

Full text and comments »

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

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

Full text and comments »

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

201.
By defnotmee, 2 years ago, In English
Catching the Mole (Psychotic_D cheating accusation) Hello codeforces! You guys must have seen the recent blog accusing international master [user:Psychotic_D,2024-07-23] of cheating in the most recent div2 round: [Codeforces Round 960 (Div. 2)](https://codeforces.me/contest/1990). This is due to the fact that the author, [user:wuhudsm,2024-07-23] is [user:Psychotic_D,2024-07-23]'s friend and that [user:Psychotic_D,2024-07-23] had a ridiculous performance, winning the amongst official participants. ![ ](https://i.imgur.com/tLslIlv.png) They are both big members of [TheForces](https://theforces.netlify.app/), raising suspicions of whether there was some collusions between the two. At first i thought it was nonsense since the evidence was lacking, but after a bit of my own investigation I've compiled the most interesting pieces of evidence of why i believe [user:Psychotic_D,2024-07-23] (along with some accomplices from TheForces) is in fact a cheater. Case #1: Introduction ------------------ I first learned about the sub...

Full text and comments »

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

202.
By galen_colin, 3 years ago, In English
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...

Full text and comments »

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

203.
By Elegia, history, 3 years ago, In English
How to composite (some) polynomials faster? Hi everyone, today I'd like to elaborate something more on the [problem I](https://codeforces.me/contest/1930/problem/I) on the recently ended div 1 contest. As described in the [official solution](https://codeforces.me/blog/satyam343), a bottleneck of the problem is the following: Given a sequence $\{c_j\}_{-n \leq j \leq n}$, compute $$ g_k = \sum_{-k\leq j\leq k} ([x^j] (x + 1/x)^k) c_j $$ for all $0 \leq k \leq n$. In the official solution, an $O(n\log^2 n)$ time algorithm is presented, and we also claimed that it is possible to compute $g_k$ in $O(n\log n)$ time. In this post, I'd like to elaborate on how to do that. By the way, another bottleneck of the problem is the relaxed convolution problem, where the usual implementation also takes $O(n\log^2 n)$ time. I mentioned in [comment](https://codeforces.me/blog/entry/111399#comment-996712) that the relaxed convolution has a somehow practical solution that has time complexity $$ O\left(\frac{n\log^2 n}{\log \log n...
# Can we go further?

Full text and comments »

Discussion of think-cell Round 1
  • Vote: I like it
  • +269
  • Vote: I do not like it

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

Full text and comments »

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

205.
By cgy4ever, 12 years ago, In English
Codeforces Round #270 Do you want to win a T-shirt? Do you want to learn how to design tasks for programming contest? Do you want to solve 7 tasks in 2.5 hours? So Codeforces Round #270 is right for you. It was designed by me in California, Assembled in polygon (so Thank you [user:MikeMirzayanov,2014-09-26] for the system and [user:Gerald,2014-09-26] for organize and testing), will start on [regular time this Sunday](http://www.timeanddate.com/worldclock/fixedtime.html?day=28&month=9&year=2014&hour=19&min=30&sec=0&p1=166), don't miss it! The organizers of **<a href="/blog/entry/13929">Marathon24</a>** decided to present gifts to the best finishers of the round! Best 25 participants will get Marathon24 tshirts! Thanks! <center> <img src="http://www.elmostshirts.com/images/tshirts.jpg"/> <br><small>It is just an image to attract your attention. Real tshirts will be designed specially for Marathon24!</small> </center> There are some articles introduced how to become a problem setter, like [Pro...

Full text and comments »

Announcement of Codeforces Round 270
  • Vote: I like it
  • +794
  • Vote: I do not like it

206.
By GreenGrape, 9 years ago, translation, In English
Codeforces Round #461 (Div. 2) _Hello, Codeforces! Haven't seen ya for a while :D_ Codeforces Round #461 will take place [on Wednesday, 20:15 MSK](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Codeforces+Round+%23461+%28Div.+2%29&iso=20180207T2015&p1=352&ah=2). Note that the round is scheduled a bit later than usual. The round will be **rated** for all division 2 participants. Division 1 is heartly welcome aswell :) My gratitude to Kolya ([user:KAN, 2018-02-04]) for round coordination, Grisha ([user:gritukan, 2018-02-04]), Oleg ([user:x3n, 2018-02-04]), AmirReza ([user:Arpa, 2018-02-04]) and Senya ([user:senek_k, 2018-02-04]) for testing and Mike ([user:MikeMirzayanov, 2018-01-01]) for awesome Codeforces and Polygon. A special thanks goes to Dima ([user:mitterr1999, 2018-02-04]) and Camille ([user:pseuda, 2018-02-04]) for sharing a problem sketch with me. The main character of this round will be **Imp** the playful monster. Yet the statements are guaranteed to be short :) ![ ](https://vk...

Full text and comments »

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

207.
By kuviman, history, 11 years ago, translation, In English
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...

Full text and comments »

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

208.
By PrinceOfPersia, 12 years ago, In English
Algorithm Gym :: Graph Algorithms Welcome to the new episode of [user:PrinceOfPersia,2015-01-31] presents: Fun with algorithms ;) You can find all the definitions here in the book "Introduction to graph theory", Douglas.B West. [cut] Important graph algorithms : DFS --- The most useful graph algorithms are search algorithms. DFS (Depth First Search) is one of them. While running DFS, we assign colors to the vertices (initially white). Algorithm itself is really simple : ~~~~~ dfs (v): color[v] = gray for u in adj[v]: if color[u] == white then dfs(u) color[v] = black ~~~~~ Black color here is not used, but you can use it sometimes. Time complexity : $O(n + m)$. #### DFS tree DFS tree is a rooted tree that is built like this : ~~~~~ let T be a new tree dfs (v): color[v] = gray for u in adj[v]: if color[u] == white then dfs(u) and par[u] = v (in T) ...
The simplest approach. We go up enough to achieve the goal.

Full text and comments »

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

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

Full text and comments »

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

210.
By adamant, history, 8 years ago, In English
Mindbun goes Telegram! Hi everyone! As you may know, I'm an attention <s>whore</s> seeker. For this (well, not only this) reason year and almost a half ago I've created public page on vk.com: [Зайчатки разума](https://vk.com/mindbun). Name is some old Russian semi-linguistic [meme](http://lurkmore.to/Зайчатки_разума) without adequate English translation, thus I decided to use 'Mindbun' as presumably closest to literal translation as English name. There was [announce](http://codeforces.me/blog/entry/52899) on codeforces, which didn't get any particularly positive or negative reaction. Or any reaction at all :) On that page I mostly post maths things interesting to me and information of any similar activities by me on other places (like, here). It serves as some kind of public notebook to me. Why won't I just post stuff on codeforces, as before? Well, my tastes may be very specific and I'm greatly afraid that I will bother community by posting dozens of short posts on topics which only partially relevan...

Full text and comments »

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

211.
By Um_nik, history, 8 years ago, In English
Most annoying person on CF It is this time of year! Many people trying to summarize all the things happened during the year. And since I love to hate people, I want to make a vote for most annoying person on CF in 2018. I know that I'm in top contributors list for too long, so to vote for given person you should **downvote** the comment with this person's handle(s). Due to the nature of voting through comments on CF, you can vote for many people, and you can also upvote comments if you find given person's comments helpful/funny/positive. If you care for your contribution but want to nominate a candidate, you can PM me their handle(s), then I will write a comment to vote. Note that I **will** write that it was you who nominated this person, so it saves your contribution but not relationships with the nominee. I will ignore messages from people without rating. If you hate someone already nominated so much that you want them to know, you can also PM me so I'll add you to list of people who nominated given ...
I know that I'm obvious candidate, especially after writing this post. But I don't annoy me, sogo

Full text and comments »

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

212.
By brunovsky, 5 years ago, In English
[Tutorial] Network simplex Hello! If you've learned the simplex algorithm and a minimum cost flow algorithm, perhaps you've also heard about this fancy thing called [network simplex](https://en.wikipedia.org/wiki/Network_simplex_algorithm) which is supposed to be a specialization/optimization of the simplex algorithm for computing a [minimum cost circulation](https://en.wikipedia.org/wiki/Minimum-cost_flow_problem). If your google search didn't turn up any interesting results or your interest faded, you might have moved on to other subjects. Well I didn't! So this is a tutorial on network simplex (NS) for the **minimum cost circulation** problem. I'll describe and formulate the problem, show how it relates to the usual minimum cost flow problem, explain the theory behind the algorithm in-depth, and then derive the implementation details. ## Introduction The algorithm commonly used in competitive programming for this sort of task is a minimum cost flow algorithm based on finding augmenting paths in a *f...
This way we can go up the tree easily, find $lca$ and visit all the edges in the cycle. In

Full text and comments »

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

213.
By djm03178, 2 years ago, In English
Unreasonable delay for viewing submissions UPD: I'm bringing this up again, because I think this is a serious issue that's been bothering us for months already and I really want a proper explanation from the admins. Please [user:MikeMirzayanov,2024-11-20], don't just look over this. It's causing a huge inconvenience for many normal users. --------------------------------- I don't know since when this has been like this, but now it seems Codeforces has exclusive delay policy for submission pages. For example, try to open [submission:286905356] [submission:286913842] [submission:286925333] [submission:286943910] [submission:287014608] these pages in 5 separate tabs (open one in each second). If it's not only me, it will go like this: - 1st tab: opens immediately - 2nd tab: waits for 10 seconds and then opens - 3rd tab: waits for 20 seconds and then opens - 4th, 5th tab: immediately goes to the "Oops! Probably Codeforces can't be reached right now or your Internet connection is broken." page If you open the same ...
). If it's not only me, it will go like this:

Full text and comments »

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

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

Full text and comments »

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

215.
By bicsi, history, 3 weeks ago, In English
Optimal Incremental MST in 20 lines of code Hello Codeforces! Some of you might know `BottleneckTree.h` from [my KACTL fork](https://github.com/bicsi/kactl/blob/master/content/graph/BottleneckTree.h) (although it's a little obscure for an ICPC notebook; oh well). [user:freak93,2026-11-05] and I wrote it in 2021. The header says the complexity is "probably $O(\log n)$ amortized". It all started from a 2020 solution by [user:RestingRajarshi,2026-11-05] (more on that at the end). After about 6 years of on-and-off thinking about it, and with the help of Claude, we finally have an answer: it's not :). There are inputs where it takes $\Omega(\sqrt n)$ per operation. The good news is that a small change in the main loop fixes it, and this time we have a proof. We wrote a paper about it: [Incremental Minimum Spanning Trees on a Napkin](https://arxiv.org/abs/2611.05713). I think the structure is super elegant and short enough to be useful in contests, so I'm writing a blog about it. Prerequisites: none, really. It helps to know ...

Full text and comments »

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

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

Full text and comments »

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

217.
By defnotmee, 5 years ago, In English
Ideone is evil and I can prove it (not anymore!) So, on the last round i wasnt at home, and therefore had to use another person's computer to do the contest. Waking up to close to the start time made me not be able to set up the IDE properly, so I thought "why not just use ideone"? But what is Ideone anyway? ------------------ ![ ](https://media.discordapp.net/attachments/911814528277307392/920062296867356703/unknown.png) Well it *says* its an online compiler, so it must be a great alternative to a text editor to test things locally. However, little did I know that it was, in fact, a trap meticulously crafted by the devil, as I received those kind messages from codeforces: ![ ](https://cdn.discordapp.com/attachments/911814528277307392/920063125338861649/unknown.png) There are 5 more of these. Well, let me explain. This is what appears when you go into ideone: ![ ](https://cdn.discordapp.com/attachments/911814528277307392/920065828794273843/unknown.png) Notice something wrong? Right at the corner of the screen...
Well, let me explain. This is what appears when you go into ideone:

Full text and comments »

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

218.
By -is-this-fft-, history, 2 years ago, In English
Is it just me or has discussion on Codeforces become a lot less lively? A few months ago, I was pretty disheartened. I wrote a [blog](https://codeforces.me/blog/entry/128552) that I put thought and effort into, and it got only +163 votes and basically no discussion. Meanwhile, a [dumb parody](https://codeforces.me/blog/entry/128316) I had published just 5 days earlier got +959 votes. Ok, but let's say that this is a bad example, maybe my explanation was bad or uninteresting or people just don't care about residual graphs that much. That's fair. But I suspect this is a bigger trend. I don't know if my memory deceives me here, but I feel like some years ago there were more high-quality, educational blogs with active discussion. [user:WeakestTopology,2024-09-16] posted a math blog recently and there are no comments, the blog might just slide out of Recent Actions pretty soon. This seems to happen a lot with such blogs, especially on "advanced" topics. What I see a lot instead is poor quality content. Lots of blogs like "please debug my code" and "how...

Full text and comments »

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

219.
By ChthollyNotaSeniorious, history, 4 years ago, In English
Polynomial Round 2022 (Div. 1 + Div. 2) Editorial Thanks for your participation! I am so sorry for my careless review. We were preparing for this round for many months and made some problems which writers and testers are all like. We do want to give everyone a good time to enjoy the contest. But carelessness is deadly. In problem B, some test cases should have been made, but we missed them in not only the pretests but also the final tests. In fact, we had not noticed it until some suspicious hacks appeared. I and all co-authors sincerely regret our mistake and hope you can forgive us. Besides, few people are cyberbullying authors, please do not do so. If you have a bad experience, you can downvote me because of our fault. [problem:1774A] Idea: [user:cirno_9baka,2022-12-17] <spoiler summary="Solution"> The answer is the number of $1$s modulo $2$. We can get that by adding '-' before the $\text{2nd}, \text{4th}, \cdots, 2k\text{-th}$ $1$, and '+' before the $\text{3rd}, \text{5th}, \cdots, 2k+1\text{-th}$ $1$. </spoiler...
Okay, it's time for us to go back to the original problem.

Full text and comments »

220.
By Monogon, history, 5 years ago, In English
[Tutorial] Solving Interval Problems with Geometry There are a lot of programming problems where a collection of intervals comes up, either directly or indirectly. In this tutorial, I want to present a nice way to visualize a collection of intervals, and how you can solve problems with it. An interval $[l, r]$ is just a pair of integers $l$ and $r$ such that $l\le r$. Let's make a 2D plot where the horizontal axis is $l$ and the vertical axis is $r$. Then our interval will be represented by the 2D point $(l, r)$. But an interval is more than just a pair of numbers: it describes the set of points $x$ such that $l\le x\le r$. How can we visually tell whether a number $x$ is covered by an interval? Well, we can represent it by a point $(x, x)$ in the plane. Then we can imagine that the interval's 2D point can see down and right, and the interval covers all the points it can see. Here's an example where we see how the interval $[2, 4]$ covers the points $2$, $3$, and $4$. <center> <img src="/predownloaded/60/b8/60b8b63a2b9682f...

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

223.
By -is-this-fft-, 6 years ago, In English
[Feature request] Some suggestions for blogs I wanted to suggest some improvements for the blog system. Some of these things have probably been said before. Some of these things should be pretty easy to implement, others are harder and might require a complete rework. I tried to put the easy things first. [cut] $~$ #### Let's do something about necroposting This is probably my biggest pet peeve about Codeforces blogs. Most of the time, Recent Actions is filled with very old blogs, some of which have been brought up for pretty much no reason at all. Currently, we have [useful C++ "library](https://codeforces.me/blog/entry/8387) from 2013 in Recent Actions, where the recent comment answers an old question which has already been answered better. Similarly, there is [How to add friends?](https://codeforces.me/blog/entry/2006) which was brought up to make some joke that has already been done. The thing is though, a lot of the time these blogs are not brought up by trolls or anything like that. They are brought up by hel...

Full text and comments »

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