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.

lists

Last visit:  4 years ago
Registered:  4 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...
The Ultimate Topic List (with Resources, Problems and Templates), been feeling is a need for a comprehensive topic list that will contain all sorts of topics from easy, beginning what I have been feeling is a need for a comprehensive topic list that will contain all sorts of, #### About the Topic List I have added a few tutorials for each topic. You can also find more of, #### Topic List Link: [smash me](https://blog.shahjalalshohag.com/topic-list/), ://youkn0wwho.academy/topic-list)

Full text and comments »

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

3.
By tourist, history, 7 years ago, translation, In English
Codeforces Global Round 5 <img src="/predownloaded/2e/e2/2ee2f0f95f05aae6ca6f47812dae2dc2aabf277b.png" style="width:200px; float:right; margin: 0 1em 1em 1em"/> Hey! On [contest_time:1237] we will host [contest:1237]. It is the fifth round of a new series of [Codeforces Global Rounds](https://codeforces.me/blog/entry/65002) supported by XTX Markets. The rounds are open for everybody, the rating will be updated for everybody. The round will last for 2 hours 30 minutes, 8 problems are waiting for you, and one of them will be proposed in two versions. Scoring distribution: **500 &mdash; 750 &mdash; (750 + 750) &mdash; 2000 &mdash; 2500 &mdash; 3000 &mdash; 3750 &mdash; 4000** The prizes for this round: - 30 best participants get a t-shirt. - 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive. The prizes for the 6-round series in 2019: - In each round top-100 participants get points according to the [table](https://pastebin.com/QT5sXEaT). - The fi...
certificates. The problems of this round were developed by me, and here is the list of people who can't take, Coincidentally, this is also the list of people I'm thankful to for making this round what it is., The problems of this round were developed by me, and here is the list of people who can't take part

Full text and comments »

Announcement of Codeforces Global Round 5
  • Vote: I like it
  • +3664
  • Vote: I do not like it

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

Full text and comments »

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

5.
By MikeMirzayanov, 8 years ago, translation, In English
Codeforces: Problem Difficulties Hi Codeforces! Meet a small innovation on Codeforces &mdash; difficulties of problems (and at the same time a new widget filtering problems in the archive). For all the problems of the archive, I’ve calculated the difficulties in the scale of the rating of participants. Approximately this means that if the rating of the problem is equal to yours, then on a typical round you would solve the problem with a probability of 0.5. And, in general, if your rating is $r_i$, and the problem rating is $r_j$, then the problem during the round can be solved approximately with probability: $$P_{i,j}=\frac{1}{1+10^{\frac{r_j-r_i}{400}}}.$$ For example, if the rating of a problem is less than yours by 200, then the expected probability of solving the problem is 0.75. With a difference of 400 rating points, the probability increases to 0.9. For convenient search of problems in the archive, you can now use a special widget: <center><img src = "/predownloaded/1c/fb/1cfba40476423720c79f0f...
one tag from the list.

Full text and comments »

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

6.
By MikeMirzayanov, history, 20 months ago, translation, In English
New Year's Eve Update: Random Problems for Mashups Hello, Codeforces! Only a couple of days remain until 2025. To wrap up the year, I'm bringing an update &mdash; I hope you'll find it useful. Now, you can automatically find and add random problems for your mashup based on a range of criteria and restrictions. The problems are sourced from the archive, and unusual problems are automatically excluded. So, click the "Add random problems" link under the problem list and proceed to the addition form. <center> <img style="zoom:75%;" src="/predownloaded/b9/25/b925e4d00215ff2e408cc81c2629936df72dce38.png"/> </center> Here's what you can do: * Exclude problems that registered mashup participants have solved/attempted/authored (a problem will be excluded if at least one registered participant is familiar with it), * If the mashup belongs to a group (e.g., your training group), exclude all problems from other contests in that group, * Exclude problems with subtasks &mdash; such problems are often interconnected or referenc...
(use tags: and provide a comma-separated list of tags, e.g., tags:dp, binary, other, * Simply specify a list of handles or [user lists](https://codeforces.me/blog/entry/21912) for, " link under the problem list and proceed to the addition form. , So, click the "Add random problems" link under the problem list and proceed to the addition form., When you click the "Find Problems" button, you'll be presented with a list of problems to add. You

Full text and comments »

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

7.
By maspy, history, 6 weeks ago, In English
0 Problems Remaining [日本語記事(For Japanese Speakers)](https://maspypy.com/codeforces-all-ac) ---- Previous post: https://codeforces.me/blog/entry/150057 Submission: [submission:384239819] 2026/07/26 03:13:42 JST (2026/07/25 18:13:42 UTC) I have solved every problem in the Codeforces PROBLEMSET except for those for which I determined that obtaining an accepted verdict is impossible. ![unsolved problem list](https://maspypy.com/wp-content/uploads/2026/07/problemset.png) # Scope I considered the problems listed in the [PROBLEMSET](https://codeforces.me/problemset). I have solved very few problems from the [GYM](https://codeforces.me/gyms). The only collection I worked through systematically was the PROBLEMSET. I determined that it is theoretically impossible to obtain an accepted verdict for the following 31 problems: [problem:775A], ([92101](https://codeforces.me/problemset/problem/921/01) ... [92114](https://codeforces.me/problemset/problem/921/14)), [problem:927A], [prob...
![unsolved problem list ](https://maspypy.com/wp-content/uploads/2026/07/problemset.png), These problems continue to occupy the list of unsolved problems in the PROBLEMSET, and there is no, list](https://maspypy.com/wp-content/uploads/2026/07/problemset.png) # Scope I considered the

Full text and comments »

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

8.
By MikeMirzayanov, 3 years ago, In English
Codeforces: Results of 2023 [Annual Report] Hello, Codeforces. Let's recall 2023, shall we? In this post, I want to summarize this year. You know, a lot of terrible things happen in the world, and personally, this year was the hardest and most sorrowful for me. But today, we'll remember something else. We'll remember what this year was like for Codeforces. Recently, Codeforces turned 14 years old. Not bad, right? And for many years now, when asked "What is Codeforces?" the first thing I say is — it's a community! [cut]<br/> #### Personal Thanks! On behalf of the community (and myself), I say thank you to everyone who tries, helps, and makes efforts to keep the community alive. Thank you to the developers! Although I continue to engage in development and other technical activities, I'm glad that these guys made an effort and improved the platform: [user:geranazavr555,2024-02-04], [user:unreal.eugene,2024-02-04], [user:vbandurin,2024-02-04], [user:ChurakovaAlexandra,2024-02-04], [user:medvezhonokok,2024-02-04]...
Codeforces – it's important and valuable. And here's the full list: [user:errorgorn,2024-02-04, discovered a truly marvelous list of all writers, which this margin is too narrow to contain. Here's alist, whole list of you! It's pleasant and valuable that our community attracts your interest! I'll justlist

Full text and comments »

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

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

10.
By parveen1981, history, 5 years ago, In English
I compiled a list of almost all useful blogs ever published on Codeforces [update: till 09.06.2021] <h3 style="color:red">If there are any blogs that I have missed, please tell in the comment section. Thank you.</h3> # Mathematics Stuff - [Number Theory in Competitive Programming [Tutorial]](https://codeforces.me/blog/entry/46620) - [Number of points on Convex hull with lattice points](https://codeforces.me/blog/entry/62183) - [FFT, big modulos, precision errors.](https://codeforces.me/blog/entry/48465) - [Number of ways between two vertices](https://codeforces.me/blog/entry/19078) - [Mathematics For Competitive Programming](https://codeforces.me/blog/entry/76938) - [FFT and NTT](https://codeforces.me/blog/entry/19862) - [Burnside Lemma](https://codeforces.me/blog/entry/51272) - [Number of positive integral solutions of equation 1/x+1/y=1/n!](https://codeforces.me/blog/entry/76836) - [On burnside (again)](https://codeforces.me/blog/entry/64860) - [Simple but often unknown theorems/lemmas/formula? Do you know?](https://codeforces.me/blog/entry/55912) - [Probabili...
I compiled a list of almost all useful blogs ever published on Codeforces [update: till 09.06.2021], awesome list for competitive programming!](https://codeforces.me/blog/entry/23054) - [USACO Guide, # Trees - [A list of important concepts in Tree-based Problems](https://codeforces.me/blog/entry, ://codeforces.com/blog/entry/13703) - [using merging segment tree to solve problems about sortedlist](https, list](https://codeforces.me/blog/entry/49446) - [Minimum memory consumption by the segment tree

Full text and comments »

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

11.
By McDic, history, 7 years ago, In English
Codeforces Round #589 (Div. 2) **다시 만나서 반가워요, 코드포스!** (Nice to see you again, Codeforces!) I'm again happy to introduce you to [Codeforces Round #589 (Div. 2)](https://codeforces.me/contests/1228). Please look at following information for details: - This contest will take place on [contest_time:1228]. - The round will be **rated for all Division 2 participants**. - There are **6 problems** and you will have **2 hours** to solve them. Score distribution will be announced later. The listed handles below are contributors. Thank you for all who listed! - **Main author**: ~McDic,2019-09-26 &mdash; I made and prepared all problems. - **Coordinator**: ~arsijo,2019-09-26 &mdash; He is my coordinator again. - **Early phase testers**: ~dorijanlendvaj,2019-09-26 ~tfg,2019-09-26 ~Lawali,2019-09-26 &mdash; They are early phase testers. They mostly focused on test data. - **Late phase testers**: ~_Kuroni_,2019-09-26 ~imbr92,2019-09-26 ~Redux,2019-09-26 ~Dr_Park,2019-09-26 ~Mahotsukai,2019-09-26 ~TOPWINDFLOWER,20...

Full text and comments »

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

12.
By MikeMirzayanov, 5 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...
Codeforces: Results of 2020 [list some changes and improvements], (including a personal list of exclusions) * Now you can set end time instead of duration while, publish numbers (no, charts) with statistics for 2020. In the meantime, I bring to your attention alist, ) with statistics for 2020. In the meantime, I bring to your attention a list of changes and, By the way, this is a decent list. This is about half to a quarter of all changes. It's just that, The items on the list are written in a concise and informal form, many of the items I just copied

Full text and comments »

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

13.
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...
new techniques? Here's a list of techniques you need to know to get out of grey: DFS, binary, seem to do it any more. This is the feature that made A2OJ great, not that they had alist of, Here's a list of techniques you need to know to get out of grey: DFS, binary search and ideas, Suppose you have a list of problems. For example, you went to the Codeforces problemset page and

Full text and comments »

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

14.
By zscoder, history, 6 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...
### List of Common Series, Before we delve into applications, I want to compile a short list of series that we will use, You can find a more complete list on Page 57 on [generatingfunctionology](https

Full text and comments »

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

15.
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 ...
in the backend of the system, this changes are not explicitly visible to you. I reviewed thelist of, just show themselves to you. Very pleased that this year the list of our partners long and varied, Here is a list of sponsorship and championship rounds:, list of our partners long and varied. Many come again, and it’s inspiring. Here is alist of

Full text and comments »

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

16.
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...
from our suspect list we are left with **36 suspects**., suspect list use Java? That's right, you got it — **1**!, suspect list we are left with **36 suspects**. Reducing the suspects even further

Full text and comments »

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

17.
By MikeMirzayanov, 6 years ago, In English
Codeforces New Feature: Rewrite Statements in Mashups Hello Codeforces! There is something new for you. It seems that now it will be easier to reuse problems from the archive for educational and other purposes. As you know, problems from past Codeforces rounds can be added to <a href="https://codeforces.me/blog/entry/10099">mashups</a> simply by their codes of the form like <code>1234D</code> (contest ID + problem letter). I myself regularly used this when I taught at Saratov University &mdash; it was very convenient to prepare trainings: problems have expected complexity and topics, there are Russian and English statements, you can see the analysis and many solutions. Because of hacks and uphacks, problems in the archive usually have strong tests. Almost all of them are well-prepared. In addition, with the help of <a href="https://codeforces.me/blog/entry/21912">user lists</a>, you can easily pick up problems for a group of students that they did not solve. <img src="/predownloaded/2f/ec/2fecbf1f7e7a8f8655f0f74576fd1f6dbbc2307...
"/> appears in the problem list in mashups, by clicking on which there will be a form for creating, ://sta.codeforces.com/s/92324/images/actions/add_text.png"/> appears in the problemlist in mashups

Full text and comments »

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

18.
By Ra16bit, history, 5 years ago, In English
Competitive Programming Hall of Fame — cphof.org Hi Codeforces! Today I'd like to introduce the new [Competitive Programming Hall of Fame](https://cphof.org) project that is available at [cphof.org](https://cphof.org) ![ Logo ](/predownloaded/12/35/1235b4fcce22b33f83cf26221d889087e06d8592.png) #### Background A long time ago I've noticed that there is no single source of information with the results of previously held large programming competitions. Moreover, plenty of older championships don't maintain their websites anymore, and it becomes hard or even impossible to find any details about them, which is pretty sad. So I've decided to create [Competitive Programming Hall of Fame](https://cphof.org). #### About the project Competitive Programming Hall Of Fame is a project created to preserve the history of international championships in competitive programming. This website collects the results of the final stages for both worldwide and regional contests. By international championship we mean a contest consisting ...
competitions that restrict participants to be from a certain list of countries directly or indirectly, participants to be from a certain list of countries directly or indirectly (like lack of English, We will be especially happy if you find and share something from this list:

Full text and comments »

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

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

Full text and comments »

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

20.
By shashwatchan, history, 6 years ago, In English
Codeforces Round #663 (Div. 2) Henlo Codeforces! ^_^ I invite you to participate in [Codeforces Round #663 (Div.2)](https://codeforces.me/contests/1391) taking place on [contest_time:1391]. The round is rated for users rated less than 2100, while other users can participate non-competitively. The round features five problems, and you have 2 hours to solve them. There may, or may not, be an interactive problem; regardless, you should [know](https://codeforces.me/blog/entry/45307) how to deal with them. I would, now, like to thank– - [user:antontrygubO_o,2020-07-31] for coordination <s>and manipulation</s>. - [user:AwakeAnay,2020-07-31], [user:AsleepAdhyyan,2020-07-31], and [user:RestingRajarshi,2020-07-31] for always listening to my problem ideas. - [user:BRCode,2020-08-03] for making [3b1b-style](https://www.youtube.com/watch?v=LYrtRnz35sU) video editorials of the problems! - [user:Aggu_01000101,2020-08-07], [user:Devil,2020-07-31], [user:Dragnoid99,2020-07-31], [user:NOOBxCODER,2020-07-31], [use...
is truly remarkable! Please do not mind the long list of testers (I had to write code to tag, Please do not mind the long list of testers (I had to write code to tag everyone here) since the

Full text and comments »

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

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

Full text and comments »

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

22.
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...
infrastructure, stability, performance is not visible to everyone. The list below contains the main, just show themselves to you. Very pleased that this year the list of our partners long and varied, pleased that this year the list of our partners long and varied. Many come again, and it’s inspiring, . Cities/countries have been reworked, now you can choose them from a list generated from geodatabase. 1, 1. Management of test groups on the page with the list of tests, autocompletion of test groups by, Here is the list of key partners of 2017:

Full text and comments »

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

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

Full text and comments »

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

24.
By YouKn0wWho, 2 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 ...
A Huge Update on The Ultimate Topic List, contribution, I will review it and add it to the public list. - **Beginner Friendliness:** Last, ! Once you suggest a contribution, I will review it and add it to the public list. - **Beginner, **Link to the website: [smash me](https://youkn0wwho.academy/topic-list)**, To know how to follow the topic list visit the [guideline](https://youkn0wwho.academy/topic-list

Full text and comments »

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

25.
By MikeMirzayanov, history, 3 years ago, In English
Filter for Past Contests Hello, Codeforces. It's scary to think about it: there are already almost 1800 rounds in the list of past contests! I started adding a filter to the table with these rounds. Right now, you can already filter by some of the types of rounds. Here's what I've supported: * Div. 1 * Div. 2 * Div. 3 * Div. 4 * Div. 1 + Div. 2 * Educational Rounds * CodeTON Rounds * Globals * Kotlin Rounds * VK Cup Rounds * Long Rounds * April Fools Of course, I might have forgotten some types of contests. Please remind me if I missed anything. We should pay attention only to types where we have conducted several contests of that type. I plan to expand this filter by adding more settings. Perhaps it would be good to filter by the condition "has at least one submission in this contest" (or those for which no submissions at all). What do you think? What else would you suggest adding? P.S. Here is how it looks on the website (some intermediate version, some options may be missing)...
It's scary to think about it: there are already almost 1800 rounds in the list of past contests!, list of past contests! I started adding a filter to the table with these rounds. Right now, you can

Full text and comments »

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

26.
By hugopm, history, 6 years ago, In English
Codeforces Round #668 Hello Codeforces! We are glad to invite you to [contest:1404] and [contest:1405], which will take place on [contest_time:1404]. The problems were created by [user:Ari,2020-09-04], [user:Kuroni,2020-09-04], [user:Maripium,2020-09-04], [user:Monogon,2020-09-04], [user:antontrygubO_o,2020-09-04] and [user:hugopm,2020-09-04]. We would like to thank: - [user:dorijanlendvaj,2020-09-04], [user:Jatana,2020-09-04] and [user:MrDecomposition,2020-09-04] for helping with the preparation of the tasks. - [user:gamegame,2020-09-04] for always being nice and supportive. - [user:DatVu,2020-09-04], [user:Maripium,2020-09-04], [user:MofK,2020-09-04] and [user:atoiz,2020-09-04] for stealing the round #666, forcing us to retheme around ponies. - [user:Monogon,2020-09-04] for making the author list more colorful. - [user:TwentyFour,2020-09-04], [user:thenymphsofdelphi,2020-09-04], [user:qlf9,2020-09-04], [user:mcfr,2020-09-04], [user:Tlatoani,2020-09-04], [user:i_love_Lisa,2020-09-04...
author list more colorful. - [user:TwentyFour,2020-09-04], [user:thenymphsofdelphi,2020-09-04, - [user:Monogon,2020-09-04] for making the author list more colorful.

Full text and comments »

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

27.
By zimpha, 6 years ago, In English
List of All Open Cup Contests Open Cup has very high quality problems. I made a list for all the contests containing the standings, sources, upsolving links, statements and discuss blog in codeforces. Some materials and links of old opencup contests are missing, maybe [user:snarknews,2020-11-10] could help to fill these entries. I will update the list when new opencup stages published. Note: most of the upsolving links need the logins for yandex.contest or opentrains. ## XXI Open Cup named after E.V. Pankratiev | # | Contest | Upsolving | Materials | |:--:|:------------|:--:|:--:| | Stage 1 | [Grand Prix of Eurasia](https://official.contest.yandex.ru/opencupXXI/contest/20063/standings)<br/> [XXI All-Siberian Programming Contest. Online](https://olympic.nsu.ru/files/inet_res_2020_0.pdf) | [baekjoon](https://www.acmicpc.net/category/detail/2403)<br/> [yandex](http://official.contest.yandex.ru/opencupXXI/contest/20063) | [statement](https://yadi.sk/i/dsRvTxbgJ9fDXw) [discuss](https://codeforces.me/blog/...
List of All Open Cup Contests, I will update the list when new opencup stages published., Open Cup has very high quality problems. I made a list for all the contests containing the

Full text and comments »

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

28.
By MikeMirzayanov, 7 years ago, translation, In English
Codeforces: Results of 2019 <a style="float:right; display: inline-block; margin:0 1em 1em 2em; max-width: 60%;" href="https://codeforces.me/10years"/> <img style="max-width:100%" src="https://assets.codeforces.com/images/codeforces-10-years-300.png"/> </a> Hi Codeforces! The platform recently turned 10 years old. We accept your congratulations at <a href="https://codeforces.me/10years">https://codeforces.me/10years</a>. Please review the progress in 2019 and support the anniversary crowdfunding campaign. Your donation will be a contribution to the future of Codeforces, will help its development and work. We need resources to continue to host rounds, not to stop developing, to innovate and to maintain the existing infrastructure. In 2019, together with numerous writers the coordinators worked on problems: [user:KAN,2020-02-06], [user:300iq,2020-02-06], [user:cdkrot,2020-02-06], [user:arsijo,2020-02-06] and recently joined [user:isaf27,2020-02-06]. And this year, rounds coordinated by other exper...
infrastructure, stability, performance is not evident. The list below lists the main points for noticeable, list of our main partners this year:

Full text and comments »

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

29.
By YouKn0wWho, 5 years ago, In English
(The Ultimate) Code Library Hey everyone, I am sharing my personal code library where I compiled **almost all** the important templates that you will need in CP (saying almost just for courtesy). Most of the codes are originally written by me and some of them are collected from others but modified in a cleaner way. Link: [https://github.com/ShahjalalShohag/code-library](https://github.com/ShahjalalShohag/code-library) It took me around 4 years to complete the list. Maybe each line is just a line to you but to me it tells a story of the excitements I had while learning those stuffs, the sleepless but fun nights I had to seek knowledge. ###### Why am I sharing this library? - Just so that your learning path becomes a bit smoother. - Knowledge hidden inside my head or codes in a private code-library will be useless when I am dead, so it's better to share those among people before I die. Also, you can make me happy(as in to pay me) just by upvoting this blog and giving a star to the repository. I beli...
took me around 4 years to complete the list. Maybe each line is just a line to you but to me it, It took me around 4 years to complete the list. Maybe each line is just a line to you but to me it

Full text and comments »

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

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

Full text and comments »

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

31.
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...
list l; l = {5, 6, 9, 1}; for (auto i: l) cout << i << ' '; cout << '\n'; // prints, one) Capture List: simple! We don't need it here, so just put `[]`, ~~~~~ [capture list](parameters) -> return value { body } ~~~~~

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

34.
By unreal.eugene, 5 years ago, In English
Polygon Updates (June — August 2021) Hello, Codeforces. I and [user:DK318,2021-08-19] joined the Codeforces team in June. These three months we mainly dealt with the development of the Polygon platform. In this post, we would like to present to you a list of what we have done during this time. Most of the changes were made to attain easier problem creation. This list does not include minor bug fixes or any improvements that are invisible to users. #### Tables support when rendering statements in HTML Now it's possible to insert the most basic tables in your HTML statements. For example, you can show the scoring system of your problem or insert several images side by side. Only column text alignment and border specification are supported now. <img src="/predownloaded/4a/4a/4a4a6c726e96df40929803a1276a448947d6ebed.png" style="width: 800px; margin-left: auto; margin-right: auto; display: block"/> #### A brief manual for writing statements We bet a lot of users who wrote statements were confused by the fact ...
button will appear in the problems list. We made sure that if any conflict occurs, you still will be, dealt with the development of the Polygon platform. In this post, we would like to present to you alist, from the list of accessible problems: they will be added to a separate list. You can also filter your, present to you a list of what we have done during this time. Most of the changes were made to

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

37.
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...
”, “matroid intersection” and “matroid intersection algorithm”. But I will list all important sources of

Full text and comments »

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

38.
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...
has a policy to resize itself when it gets too large. So we just need to find thislist of primes., the list we're looking for.

Full text and comments »

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

39.
By tourist, history, 9 years ago, translation, In English
VK Cup 2017 Round 3 + Codeforces Round #412 -- разбор задач Разбор задач VK Cup 2017 Round 3 и Codeforces Round #412 доступен на русском и английском языках. Приятного прочтения! <spoiler summary="Is it rated?"> [tutorial:807A] <spoiler summary="Код"> ~~~~~ 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="Более эффективный код"> ~~~~~ #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; i...
~~~~~ n = int(input()) a = sorted(list(map, ): results.append(list(map(int, input().split())))

Full text and comments »

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

40.
By rewhile, 17 months ago, In English
<h1>Mike, please stop ignoring your userbase</h1> **This blog will compile a list of codeforces issues along with all the times Mike has ignored complaints about them** ## 1. Unreasonable delay for viewing submissions [<a class="rated-user user-green">+973</a>] - [Submission pages on Codeforces often not loading](https://codeforces.me/blog/entry/134655) [<a class="rated-user user-green">+281</a>] by [user:jeroenodb,2025-04-04] on *October 2024* - [Unreasonable delay for viewing submissions](https://codeforces.me/blog/entry/135457) [<a class="rated-user user-green" title="Green 392">+392</a>] by [user:djm03178,2025-04-04] on *October 2024* - [Please, give us proper explanations about this nonsense.](https://codeforces.me/blog/entry/136830) [<a class="rated-user user-green">+300</a>] by [user:djm03178,2025-04-04] on *December 2024* No [user:MikeMirzayanov,2025-04-04] reply ## 2. Cloudflare misconfiguration [<a class="rated-user user-green">+1232</a>] Posted [CF should rename itself to Cloudflare instead of Codef...
## ∞. The list could stop here, **This blog will compile a list of codeforces issues along with all the times Mike has ignored

Full text and comments »

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

41.
By Golovanov399, 6 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...
If you want to build a segment tree where each node contains a sorted list of values from the

Full text and comments »

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

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

Full text and comments »

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

43.
By Radewoosh, history, 5 years ago, In English
My own algorithm — offline incremental strongly connected components in O(m*log(m)) Hello Codeforces! As all of you know, there are so many known algorithms named after people who invented them &mdash; from the easiest ones, like Dijkstra, to the harder ones, like Berlekamp–Massey algorithm. These algorithms were innovative when they were invented, so of course, it's good that they are named after their inventors. But, today, I've seen a blog about the solution to the problem "compute LCS of two strings in time $O((n + k) \cdot \log(k))$, where $n$ is the sum of lengths of the strings, and $k$ is the number of pairs of matching positions in them". To be honest, it a bit pissed me off that even this algorithm is named after its creators. Is it ok to name the solution to every possible problem after its author? I won't judge it. Anyway, I want my very own Radecki algorithm, so let me give it a try. If anyone has ever heard about it &mdash; it's cool. Let me know, and it'll be just another helpful blog on Codeforces. Let's imagine the following problem: there is...
and a list of $m$ directed edges which we want to add to this graph one by one. After adding each edge, , just getting the list of undirected edges) has 72 lines., Let's use the divide and conquer technique on the list of the edges. We can also think about it

Full text and comments »

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

44.
By zimpha, 6 years ago, In English
List of All Petrozavodsk Contests Like my last blog [List of All Open Cup Contests](https://codeforces.me/blog/entry/84466). I made this list for all contests from Petrozavodsk Training Camp, containing the standings, upsolving links and statements. The upsolving links of Petrozavodsk Summer 2020 are private, yandex.contest logins are needed. I will update the link if other sources found. And thanks to the efforts of [Baekjoon Online Judge](https://www.acmicpc.net/), most contests from winter 2015 to winter 2020 can be solved without private logins. For some of the rest contests, opentrains logins are needed. And for some of the rest contests, I found several other sources to virtual participant using [Virtual Judge](https://vjudge.net/), [Codeforces gyms](https://codeforces.me/gyms) and [Programmers club of PetrSU](http://acm.petrsu.ru/). For some of the rest contests, I could not find any public sources and maybe someone could help with it (I believe problems in Warsaw U Contests are from old POI or PA). ...
List of All Petrozavodsk Contests, Like my last blog [List of All Open Cup Contests](https://codeforces.me/blog/entry/84466). I made

Full text and comments »

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

45.
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-...
We tried O1-mini on several problems, from a variety of sources. Let's list the results first.

Full text and comments »

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

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

Full text and comments »

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

47.
By tokitsukaze, 4 years ago, In English
Codeforces Round #789 Hello, Codeforces! ฅ(*`ω´*)ฅ We are glad to invite you to take part in [contest:1677] and [contest:1678], which will be held on [contest_time:1677]. The round will be **rated** for all participants from both divisions. Participants in each division will be offered **6** problems and **2** hours to solve them. Both divisions will share 4 problems. The problems were written and prepared by [user:funer,2022-05-05], [user:dark_light,2022-05-05], [user:FreshP_0325,2022-05-05], [user:Frank_DD,2022-05-05], [user:qsmcgogo,2022-05-05], [user:winterzz1,2022-05-05], [user:Heltion,2022-05-05], [user:TomiokapEace,2022-05-05] and me. Thank to: - [user:74TrAkToR,2022-05-05] for excellent coordination of this round! And translating the statements to Russian. - [user:KAN,2022-05-08] for helping us to review and fix some statements. - [user:TomiokapEace,2022-05-05] for helping us to translate **all** the statements and tutorials to English. - [user:Heltion,2022-05-05] for giving...
**UPD2**: List of contributors is a bit changed, and the score distribution will be:

Full text and comments »

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

48.
By twosquares, 8 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: ...

Full text and comments »

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

49.
By MikeMirzayanov, 12 years ago, translation, In English
Codeforces: results of 2014 <img src="http://assets.codeforces.com/images/statistics-2014/snowman-en.png" style="float:right; margin:0 1em 1em 1em;"/> Hello 2015! Hello Codeforces! It seems it is time to take stock. Frankly, I was almost feared to start summing statistics of 2014. In 2013 Codeforces showed rapid growth so that it would not be surprising to look bad on the background of 2013. Certainly not! I was pleasantly surprised by the statistics and reports! Just below is a list of major events and achievements of Codeforces over the year. For you, it's just a list, but please note &mdash; every item includes hard work of multi-day Codeforces team, writers of problems, the organizers of contests and tournaments, problem testers and volunteers. Yay! Together we have done all of this: * introduced Codeforces API * added (and sometimes improved) all Andrew [user:andrewzta,2015-01-03] Stankevich contests * Codeforces supported mode to work as iframe-widget, and Codeforces helped Google to run https...
Just below is a list of major events and achievements of Codeforces over the year. For you, it's

Full text and comments »

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

50.
By YouKn0wWho, 4 years ago, In English
A List of Useful Equations in Competitive Programming Hi, I am super excited to be back with another list. This time it is a **collection of some useful equations in Competitive Programming**. ### Motivation Do you find it bad if you couldn’t solve a problem just because you didn’t know about a certain equation? Do you find it difficult to take a quick look at an equation that you know exists but forgot about it while solving a problem? Do you think that all the equations that are important in CP are just cluttered and you are too lazy to collect them in one place? Well, then you are in the right place! I am here to solve all of the aforementioned problems. I believe you should not waste your precious time searching the internet for important equations. You should solve more problems. I am here to undertake the nasty task of collecting things. ### Payment Everything comes with a cost. You need to do something for me. That is you need to upvote this blog. Pretty easy! ### Acknowledgement Thanks to the following guys ...
A List of Useful Equations in Competitive Programming, ### About the List I didn't add any explanations for any of the equations because it's not, ### Audience This list is NOT for beginners. This is for people who already came across lots of, ### The Equation List Link: [blog.shahjalalshohag.com/equation-list/](https, Hi, I am super excited to be back with another list. This time it is a **collection of some useful, The list also contains some small tricks as a bonus. As the list is long, it must have some errors

Full text and comments »

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

51.
By -is-this-fft-, history, 4 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...
. To settle these things "once and for all", I decided to write my own list about about common "small

Full text and comments »

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

52.
By shiven, history, 21 month(s) 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...
**Disclaimer:** This is just a list of issues that I sourced by talking to the handful of teams at

Full text and comments »

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

53.
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...
**Update5** : Thank all of your support! I found I'm on the Top contributors list now. :)

Full text and comments »

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

54.
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...
also have the option to list all existing Codeforces groups, and to create your own group. For each, page you are shown a list of courses you can register and take part in. Each course has a navigation, , there probably won't be any more Div. 4 rounds so I didn't list it here.

Full text and comments »

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

55.
By lnishan, 11 years ago, In English
An awesome list for competitive programming! This is a project I started from late January 2016. My motive is that: Although there's fantastic information out there, I think they're still spread all over the place. Therefore, in my opinion it would probably be cool if there's an [awesome list](https://github.com/sindresorhus/awesome) for competitive programming! ( *It's now featured on the main list!* ) I'm actively updating the list here: [https://github.com/lnishan/awesome-competitive-programming](https://github.com/lnishan/awesome-competitive-programming) # Awesome Competitive Programming [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) A curated list of awesome `Competitive Programming`, `Algorithm` and `Data Structure` resources. Created with a view to connecting people to information, this list below contains a complete collection of all the fantastic resources I've collected over the course of my 11...
An awesome list for competitive programming!, all over the place. Therefore, in my opinion it would probably be cool if there's an [awesomelist, it would probably be cool if there's an [awesome list ](https://github.com/sindresorhus/awesome) for, very complete list of competitive programming resources. A must-have in your browser bookmark. | | ★★★, ! > > I really hope that more people can benefit from this list :), ## Books > A list of recommended books for competitive programming., ## List of Lists > Awesome curated lists classified by topics., * [List of Lists](#list-of-lists) * [Syllabuses](#syllabuses) * [Tutorial Websites](#tutorial, ++11FAQ.html) | A list of FAQs regarding C++11 collected and written by Bjarne Stroustrup, the creator of, /1_dc3Ifg7Gg1LxhiqMMmE9UbTsXpdRiYh4pKILYG2eA4/edit) | A list of important topics in competitive programming, /MaximAbramchuck/awesome-interview-questions) | A curated list of awesome interview questions |, ://graphics.stanford.edu/~seander/bithacks.html) | A huge compiled list of bit manipulation tricks. | | ★★★, ://www.topcoder.com/community/data-science/data-science-tutorials/) | A list of tutorials written by, ?module=ProblemArchive) | List of problems with categories and complexity levels |, A curated list of awesome `Competitive Programming`, `Algorithm` and `Data Structure` resources., Created with a view to connecting people to information, this list below contains a complete, I'm actively updating the list here: [https://github.com/lnishan/awesome-competitive-programming, You can also contribute by sharing! Share the list with your classmates, your friends and, ](http://web.stanford.edu/class/cs97si/) | Offers comprehensive lecture slides and a shortlist of, ](https://github.com/prakhar1989/awesome-courses#algorithms) | A fantastic list of open courses offered, | Name | Link | | --- | --- | | C++ Books | [The Definitive C++ Book Guide and List — Stack

Full text and comments »

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

56.
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"; } } ...
a linked list in $O(n\log n)$. Note that many other implementations exist, including several $O(n, . Let $c_i$ store the list of edges with depth $i$. Suppose we want to insert edge $u$ into the tree

Full text and comments »

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

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

Full text and comments »

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

58.
By Errichto, 5 years ago, In English
[Tutorial] Square Root Techniques _This is my 100th CF blog!_ This is a list of techniques with $O(\sqrt n)$ time complexity. Watch the lecture https://youtu.be/BJhzd_VG61k, with timestamps! 1. Square root decomposition &mdash; split the sequence into blocks of fixed size. 2. Splitting objects (e.g. vertices) into light and heavy. 3. Square root decomposition by the time of queries & rebuilding the structure. 4. Mo's algorithm &mdash; processing queries in proper order and updating the answer by erasing/inserting new elements. https://cp-algorithms.com/data_structures/sqrt_decomposition.html 5. Strings &mdash; if the sum of lengths is $S$ then there are at most $\sqrt{S}$ distinct lengths. 6. Birthday paradox & baby-step giant-step. See P4 and P6 [here](https://codeforces.me/blog/entry/95571), and see https://cp-algorithms.com/algebra/discrete-log.html. P1. [problem:398D] P2. [problem:220B] P3. <s>[problem:86D]</s> (actually, skip this one because it's boring) P4. Count triangles in a graph, i....
Thanks to [user:krismaz,2021-11-07] for letting me use his list of techniques and problems., This is a list of techniques with $O(\sqrt n)$ time complexity. Watch the lecture https://youtu.be

Full text and comments »

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

59.
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...
1. `rootDP` is a list, where `rootDP[node] = dfs(node)`. 2. `forwardDP` is a list of lists

Full text and comments »

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

60.
By Kuroni, history, 2 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...
in the problem statements can be found [here](https://www.youtube.com/playlist? list

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

63.
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...
then $\mathrm{cycleId}[u] = u$; 3. form a new adjacency list where for each $u$, each instance of $u, things convenient. Like an adjacency list but "next level". This section is purely an implementation

Full text and comments »

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

64.
By MikeMirzayanov, history, 10 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...
~~~~~ private double getSeed(List contestants, Contestant contestant, int rating

Full text and comments »

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

65.
By PurpleCrayon, history, 5 years ago, In English
Codeforces Global Round 18 <img src="/predownloaded/2e/e2/2ee2f0f95f05aae6ca6f47812dae2dc2aabf277b.png" style="width:200px; float:right; margin: 0 1em 1em 1em"/> Happy Holidays! On [contest_time:1615] we will host [contest:1615]. It is the sixth round of a 2021 series of [Codeforces Global Rounds](/blog/entry/65002). The rounds are open and rated for everybody. The presents for this round: - 30 best participants get a t-shirt. - 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive. The presents for the 6-round series in 2021: - In each round top-100 participants get points according to the table. - The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest. - The best 20 participants over all series get sweatshirts and place certificates. Thanks to XTX, which in 2021 supported the global rounds initiative! The problems were written and prepared by the hard-working elves [user:1-gon,2021-12...
Good luck, have fun, and stay off the naughty list!

Full text and comments »

Announcement of Codeforces Global Round 18
  • Vote: I like it
  • +609
  • Vote: I do not like it

66.
By MikeMirzayanov, history, 11 years ago, translation, In English
User Lists Hello, We are launching new feature on Codeforces, in early beta mode. I hope it will be useful to many active users of the web-site. Now you can create, manage and use the "user lists". ![Menu](http://codeforces.me/predownloaded/90/70/9070387bafaea763209171cc550792d8da66f224.png) Partially, it is a kind of generalization of "friends." You can create a list of users interesting to you (you can create many lists) and, using the list, filter the results of rounds, quickly analyze what problems are solved in the problemset, etc. This feature is a helpful tool for coaching &mdash; I'm using it. By combining in a list of all practicing students, it is easy to pick up problems that have not been solved (and even not attempted) by any student. A user list has name and a pair of two relatively secret keys & mdash; one for view/usage and one for editing. For example, here is the key to view a list of ACM-ICPC students at Saratov State U for autumn of 2015: 15c68c2cf878267d59373d1...
* in the problemset (shown number of solvers/attempters for each problem) * in list of rounds, A user list has name and a pair of two relatively secret keys & mdash; one for view/usage and one, Partially, it is a kind of generalization of "friends." You can create a list of users interesting, This means that on some pages, you can use the optional parameter `?list=key` to apply thelist

Full text and comments »

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

67.
By Amir_Parsa, 3 years ago, In English
Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2) Salam, Codeforces! $\color{white}{\text{ «Be attentive about your thought that becomes your behavior» «Be attentive about your behavior that becomes your speech» «Be attentive about your speech because it becomes your habit»«Be attentive about your habit because it becomes your personality»«Be attentive about your personality because it becomes your destiny» Said by: Imam Ali}}$ We're so excited to invite you to take part in our round [contest:1864] which will start on [contest_time:1864]. The round will be **rated and open for everyone**. The problems were prepared and authored by [user:amenotiomoi,2023-08-19], Dhruvil [user:Psychotic_D,2023-08-19] Kakadiya, Han [user:wuhudsm,2023-08-19] Jinlong, Amir Hossein [user:Amir_Parsa,2023-08-19] Farhadi, Matthew [user:Chromate00,2023-08-19] Roh, [user:JohnVictor,2023-08-19], [user:odt,2023-08-19], [user:ugly2333,2023-08-19], [user:lavine,2023-08-19], [user:RiverHamster,2023-08-19], [user:flowerletter,2023-08-19] and [user:Aquamoon...

Full text and comments »

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

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

Full text and comments »

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

69.
By qwexd, 4 years ago, In English
Codeforces Team To Do List # Feature Requests and Suggestions for Codeforces ***This blog lists common feature requests, suggestions, and bugs for Codeforces. Originally posted 3 years ago, this is a reformatted version with implementation status updates.*** ## ✅ Implemented Features - **Allow changing profile picture to the default profile picture.** ✅ - **Make comment replies collapsable.** ✅ - **Paginated comments sections.** *(so that blogs with a large amount of comments are actually scrollable on mobile)* ✅ - **Make upvotes and downvotes changable.** ✅ - **Add unrated registeration.** ✅ ## UI/UX Improvements - **Make official dark mode.** - **Make the folder icon in the catalog clickable so that we can collapse certain columns while searching.** - **In Fav. Blog Entries Option, blogs should be collapsed by default so that we can see multiple favorite blogs at one time otherwise it takes a lot of scrolling to see...
Codeforces Team To Do List, Last Unsolved list** *(section of PROBLEMSET)*. - **Problem submission syncing** *(i.e, .** - **Add "hide if participated by any of the given member-list." option on the gym, ] - **Allow removal / hidding of problems in the Last Unsolved list** *(section of PROBLEMSET)*. [likes

Full text and comments »

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

70.
By fcspartakm, history, 8 years ago, translation, In English
Polygon Improvements (May — June 2018) Hello, Codeforces. Below you can see the improvements in the system Polygon. A lot of work has been done to simplify the preparation of school tasks, which use groups and points for tests. In the General Information tab, you can enable the points option for each test. This option is enabled points for the whole problem, that is, for tests from all testsets. Let me remind you that test groups can be enabled for each testset separately on the Tests tab. #### Points for groups, points policies, dependencies Points for the test, as well as groups, can be entered in the table with the list of tests, and also specify them when creating a new test. If the group for the test appears for the first time, it will be automatically added to the list of available groups. This list is presented in the table. ![ ](https://pp.userapi.com/c846322/v846322429/70f6b/XokdENM1X6o.jpg) [cut] <br/> Here the problem developer can specify a policy for calculating points for the group, and also ...
Points for the test, as well as groups, can be entered in the table with the list of tests, and

Full text and comments »

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

71.
By vovuh, history, 6 years ago, In English
My thoughts on clarifications and on the round #677. Alright, I'm done. I wanted to write a blog like that for a long time, but now I really don't have enough patience to ignore this issue anymore. I want to say that I get 100-200 clarifications each Div.3 round. It doesn't even matter how well the statements are, it doesn't matter if there are any issues with solutions or checkers, people always find what to ask. Before I start whining here, I really want to recommend anyone to read these two [user:Um_nik,2020-10-20] blogs: [this one](https://codeforces.me/blog/entry/62730) and [this one](https://codeforces.me/blog/entry/62744). Sorry, [user:Um_nik,2020-10-20], I unnecessarily tagged you, I will not do that anymore. Now some breaking news for most participants: _your local IDE compiler_ and _Codeforces compiler_ are **actually** different things! If your code works fine locally but gets WA/TL/RE/ML/etc on Codeforces, it (most probably) means you have a bug somewhere in your code. There are rare cases when the issue is with comp...
make it unrated". I opened his submissions list and saw he solved only A and B. The only thing that

Full text and comments »

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

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

Full text and comments »

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

73.
By TechnobladeNeverDies, history, 4 years ago, In English
The Ultimate Equation List This is **a collection of all important equations in Competitive Programming**. # Motivation Do you find it bad if you couldn’t solve a problem just because you didn’t know about a certain equation? Do you find it difficult to take a quick look at an equation that you know exists but forgot about it while solving a problem? Do you think that all the equations that are important in CP are just cluttered and you are too lazy to collect them in one place? Well, then you are in the right place! I am here to solve all of the aforementioned problems. I believe you should not waste your precious time searching the internet for important equations. You should solve more problems. I am here to undertake the nasty task of collecting things. # The Equation List 1. Axiom of extensionality: $\forall x\forall y[\forall z(z\in x\Leftrightarrow z\in y)\Rightarrow x=y]$ 2. Axiom of regularity: $\forall x[\exists a(a\in x)\Rightarrow\exists y(y\in x\land\lnot\exists z(z\in y\lan...
The Ultimate Equation List, # The Equation List

Full text and comments »

74.
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...
, `V6_HeapAlloc` and `V5_HeapAlloc`, which seem to allocate memory by looking through a linkedlist for

Full text and comments »

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

75.
By Intellegent, 11 months ago, In English
Codeforces Round 1060 (Div. 2) <center> <img src="https://i.imgur.com/Brilqkh.png" style="width: 125.0px;max-width: 100.0%;max-height: 100.0%;"></center> <center> <h1> Hi Codeforces! </h1> </center> I am very excited to invite you to participate in [contest:2154], starting at [contest_time:2154]. There will be **6** wowee problems for you to solve in **2 hours**, some problems will have multiple parts. All problems were authored and prepared by me. This round will be **rated for all participants with rating below 2100**. I would like to thank the following list of very strong individuals for making this round possible: - [user:satyam343,2025-10-16] for epic coordination. - [user:um_nik,2025-10-16] for preliminary review. - The army of testers: [user:Dominater069,2025-10-16], [user:sammyuri,2025-10-16], [user:__baozii__,2025-10-16], [user:Andreasyan,2025-10-16], [user:potatoo,2025-10-16], [user:_istil,2025-10-16], [user:nifeshe,2025-10-16], [user:anango,2025-10-16], [user:cry,2025-10-16], [...
I would like to thank the following list of very strong individuals for making this round possible:

Full text and comments »

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

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

Full text and comments »

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

77.
By mostafa.saad.fci, 6 years ago, In English
Releasing my private problems lists for ICPC/IOI/Online training **Updating** from time to time to **reach** more guys.. ........ Since 2019 and I receive very positive feedback about the quality of my **problem selections** in my international [supervision](http://codeforces.me/blog/entry/59131). I intended to make my problem lists public one day to help trainees to train in a more efficient and effective way. This program started in 2016 and has been changed and improved a lot based on the received feedback from my trainees. I ended up with 2 big lists of problems: one for guys training toward **IOI** and another for **ICPC/OnlineContest** styles. Specifically 4 critical features: - **Problem difficulty level** [1-10] per problem is a manual weighted average of the assigned levels from my trainees’ sheets. A common complaint about 'online tools/ways for ranking problems by difficulty' is that they are not accurate. The issue is more severe for OI problems. - **Problem importance level**: ~ 5 levels (important, very interesting, int...

Full text and comments »

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

78.
By Intellegent, history, 19 months ago, In English
Codeforces Round 1005 (Div. 2) <center> <img src="https://i.imgur.com/McpYICK.png" style="width: 125.0px;max-width: 100.0%;max-height: 100.0%;"></center> <center> <h1> Hello Codeforces! </h1> </center> I am very excited to offer you to participate in [contest:2064], starting at [contest_time:2064]. There will be **6** very epic tasks and you will have **2 hours** to solve them. All problems were authored and prepared by me. This round will be **rated for all participants with rating below 2100**. I would like to thank the following list of orzosities for making this round possible: - [user:flamestorm,2025-02-13] for coordinating and helping with problem preparation. - My army of testers: [user:N_z__,2025-02-13], [user:triple__a,2025-02-13], [user:sammyuri,2025-02-13], [user:_istil,2025-02-13], [user:Dominater069,2025-02-13], [user:nifeshe,2025-02-13], [user:awesomeguy856,2025-02-13], [user:Error_Yuan,2025-02-13], [user:anango,2025-02-13], [user:temporary1,2025-02-13], [user:efishel,2025-02-13], [u...
I would like to thank the following list of orzosities for making this round possible:

Full text and comments »

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

79.
By ace5, 2 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!), ...
submissions of participants from the list, you can see that many of them earlier sent code for this, , and if you look at the submissions of participants from the list, you can see that many of them

Full text and comments »

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

80.
By DmitryGrigorev, history, 7 years ago, translation, In English
Codeforces Round #569 Hi, Codeforces! We are glad to invite you to take part in [contest:1179] and [contest:1180], which will be held [on Friday, June 21, 2019, at 19:35](https://www.timeanddate.com/worldclock/fixedtime.html?day=21&month=6&year=2019&hour=19&min=35&sec=0&p1=166). The round will be rated for all participants from both divisions. Problems for the round have been proposed by Ivan [user:ScreaMood,2019-06-20] Fedorov, Kyrill [user:Choopa_choops,2019-06-20] Bessonov, Mukhammadjon [user:Mr.Hakimov,2019-06-20] Hakimov, Fedor [user:osaaateiasavtnl.,2019-06-20] Ushakov, Fedor [user:Kuyan,2019-06-20] Kuyanov, and me, Dmitry [user:DmitryGrigorev,2019-06-20] Grigoryev. The round have been prepared by us, Dmitry [user:DmitryGrigorev,2019-06-20] Grigoryev, Fedor [user:osaaateiasavtnl.,2019-06-20] Ushakov, Dmitry [user:TheWayISteppedOutTheCar,2019-03-09] Piskalov and Mukhammadjon [user:Mr.Hakimov,2019-06-20] Hakimov. We'd like to give thanks to Ildar [user:300iq,2019-03-09] Gainullin for excelle...
List of the winners of the contest:

Full text and comments »

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

81.
By tourist, history, 9 years ago, translation, In English
Hello 2018 -- Tutorial Here is the tutorial of Hello 2018. Enjoy! <spoiler summary="Modular Exponentiation"> Problem writer: [user:tourist,2018-01-08] [tutorial:913A] <spoiler summary="Solution"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { int n, m; scanf("%d %d", &n, &m); printf("%d\n", n >= 31 ? m : m % (1 << n)); return 0; } ~~~~~ </spoiler> </spoiler> <spoiler summary="Christmas Spruce"> Problem writer: [user:BudAlNik,2018-01-08] [tutorial:913B] <spoiler summary="C++ solution"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> p(n), deg(n); for (int i = 1; i < n; i++) { cin >> p[i]; p[i]--; deg[p[i]]++; } vector<int> sons_leaves(n); for (int i = 0; i < n; i++) { if (deg[i] == 0) { sons_leaves[p[i]]++; } } for (int i = 0; i < n; i++) { if (deg[i] > 0 && sons_leaves[i] < 3) { puts("No"); return 0; } } puts...
- 1)] leafs = list(filter(lambda x: not x in p, range(n))) lp = [x for i, x in enumerate(p) if i, (n - 1)] leafs = list(filter(lambda x: not x in p, range(n))) lp = [x for i, x in enumerate(p) if i

Full text and comments »

Tutorial of Hello 2018
  • Vote: I like it
  • +463
  • Vote: I do not like it

82.
By Errichto, 8 years ago, In English
Wanting to get contribution is good I initially wrote a longer comment on [user:Radewoosh,2018-08-17]'s blog but realized the following part is a completely separate thing. ### **Wanting to get contribution is a good thing.** It's an incentive to literally contribute to the community. This is how rankings work. People dream to be top10 rating one day and it motivates them to work harder. The "top contributors" list has the same goal: to incentivize people to help others. I don't mind if someone says "you want to get to top10 contribution" to me, and I joke with friends about it (also about [user:Swistakk,2018-08-17] and [user:Radewoosh,2018-08-17]). The bad thing is that a comment like this can be seen by others and make them less motivated (maybe unconsciously) to contribute. You likely don't realize how much the feedback matters. Preparing contests isn't more profitable than working in a company, but it's so rewarding to know some people liked your problems that it motivates you to do it again. It should be si...
to be top10 rating one day and it motivates them to work harder. The "top contributors"list has

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

85.
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...
an internal thing, but I'm very proud of it. In general, we have a big waiting list of problems that, list of problems that are approved but not yet used for contests. When we need to make the next

Full text and comments »

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

86.
By ICPCNews, 2 years ago, In English
The 2023 ICPC World Finals Luxor <img src="/predownloaded/60/aa/60aa49ecdb6a668539163c4d7d797ac6f1bb43b3.jpg" align="right" style="height: 350px; margin: 10px 20px 20px;" alt="text"/> Hello Codeforces! The 2023 ICPC World Finals Luxor will begin on [April 18, 2024 at 10:00 UTC](https://www.timeanddate.com/worldclock/fixedtime.html?msg=2023+ICPC+World+Finals+Luxor&iso=20240418T12&p1=4626&ah=5). This time, we have a double World Finals. You can distinguish them by colors: blue (fish emoji) and green (crocodile). Join us on the live broadcast for this awesome double event of the year in competitive programming; commentators will include [user:ecnerwala,2024-04-17], [user:SecondThread,2024-04-17], [user:Egor,2024-04-17], and more! ICPC World Finals Luxor is hosted by The Arab Academy for Science, Technology, & Maritime Transport (AASTMT), the ICPC World Finalist teams for two seasons will compete for World Championship awards, prizes, and bragging rights. More than 130 teams of each season represent the best of gr...
hashtag to the chat to see your favorite! All hashtags for both seasons were collected in [thislist, - [Official list](https://icpc.global/worldfinals/teams) — select region - Non-official

Full text and comments »

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

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

Full text and comments »

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

88.
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...
Let us examine the list Mike linked to., The point is, when you make a changelog, you don't make up a big list of improvements. You don't

Full text and comments »

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

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

Full text and comments »

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

90.
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...
- 2018-April 2020: I kept a file with a list of problems I created in my spare time. Some were

Full text and comments »

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

91.
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...
know and I'll add it to the list.

Full text and comments »

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

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

Full text and comments »

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

93.
By Um_nik, history, 11 months ago, In English
One-letter variables Complete shitpost, don't take it seriously. We were discussing `#define int long long` and I suggested defining it to one letter if you want to save on typing so desperately. [user:jeroenodb,2025-10-11] said that those are reserved for variables, which prompted me to think, "Is there a letter I don't standardly use for some particular purpose?" Then I compiled the following list, and then I thought, "Well, I already wrote it, let's put it on cf", so here we are. ~~~~~ a - array, but also all sorts of stuff b - second array c - third array / count d - delta / divisor e - event / edge f - flag g - graph / second flag h - third iterator / third flag / height i - iterator j - second iterator k - third input size / some parameter (i know, those are all parameters, but for some reason k is parameter) l - left m - number of edges / second input size n - input size o - ??? p - permutation / position q - number of queries / query / second permutation / second position r - r...
don't standardly use for some particular purpose?" Then I compiled the followinglist, and then I

Full text and comments »

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

94.
By Seyaua, 12 years ago, In English
Rockethon 2015 Announcement <a href="http://rocketfuel.com/"><img src="http://assets.codeforces.com/images/rockethon/HZ-LOGO-TAG-RGB-big.png" style="float:right;margin:0 2em 2em 2em;"/></a> Hello Codeforces community, I am happy to announce that [Rocket Fuel Inc.](http://rocketfuel.com/) will be hosting a Rockethon competition again! The contest is prepared by Rocket Fuel employees Eldar Bogdanov, Anton Lomonos, Lasha Lakirbaia, Alexander Ruff, Nikhil Goyal and me, Ievgen Soboliev. We hope everyone will find some interesting problems in the contest and everyone will have as much fun solving these problems as we had preparing them. Just like last year, the best participants will receive valuable prizes and top performers will get Rockethon 2015 T-shirts! Also, Rocket Fuel is interested in hiring people after this event, so please fill out the simple form during registration. About Rocket Fuel --------------------- Rocket Fuel is building technology platform to do automatic targeting and optimization of a...
Rocket Fuel has been named [#4 on Forbes Most Promising Companies in America List](http

Full text and comments »

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

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

Full text and comments »

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

96.
By Monogon, history, 5 years ago, In English
[Tutorial] Blossom Algorithm for General Matching in O(n^3) I have decided to write a tutorial on a topic not even [user:Um_nik,2021-06-29] knows! ([source](https://codeforces.me/blog/entry/92248)) In this tutorial, I will talk about the blossom algorithm, which solves the problem of **general matching**. In this problem, you are given an undirected graph and you need to select a subset of edges (called matched edges) so that no two edges share a vertex, and the number of matched edges is maximized. More common in competitive programming is bipartite matching, which is the same problem but when the graph is guaranteed to be bipartite. In competitive programming, general matching seems to get a lot of hate for being very challenging to implement. However, the blossom algorithm is quite beautiful, and important in the history of algorithm research. It will help if you are already familiar with bipartite matching. I will discuss the high level ideas of the algorithm, but my main focus will be on the tricky implementation details. So you may...
the `b[z]` list of the last vertex on our lifted path - `j`: the index in the `b[z]`list of the, the original graph. The input will be a list of blossoms, where each one connects to the next, and we

Full text and comments »

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

97.
By errorgorn, 5 years ago, In English
Linear Basis (Xor Basis Extended) As part of the graduation requirements for my school, I have to complete a simple research project, so I decided to do something related to data structure and algorithms. I believe I have come out with a data structure that maintains the basis of vectors in $(\mathbb{Z}/m\mathbb{Z})^d$, where $m$ **may not be prime**. Since this was related to competitive programming, I think it is a good idea to share it here. Hopefully, this algorithm is actually novel :P I would like to thank: - [user:icypiggy,2021-12-26] for being my research mentor and tolerating my dumb questions - [user:rama_pang,2021-12-26] and [user:adamant,2021-12-28] for their helpful suggestions and comments Please comment under the blog or message me on codeforces if any parts are unclear or wrong. Also, I hope that some LGMs can help solve the open problems in this blog. # Introduction Maintaining the basis of vectors in $(\mathbb{Z}/2 \mathbb{Z})^d$, also known as the xor basis algorithm is a well-studie...
Let us first list out some properties of $A$ and $V$.

Full text and comments »

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

98.
By KAN, 8 years ago, translation, In English
Codeforces Round #476 (Div. 2) [Thanks, Telegram!] Hi everyone! <img src="/predownloaded/bf/c1/bfc15c5c56f3e421cc2799e5e1e0273cac1e3605.jpg" alt="digital resistance" title="digital resistance" style="float:right; margin: 0 1em 1em 1em; width:30%"/> Tomorrow, [on the April 25-th, 2018 at 17:35 UTC](http://www.timeanddate.com/worldclock/fixedtime.html?day=25&month=4&year=2018&hour=20&min=35&sec=0&p1=166) we are holding [contest:965]! The round will be rated for the second division participants, members with higher rating can take part out of competition. I give the floor to [user:MikeMirzayanov,2018-04-24] to announce the round: _This round opens a series of thanks-rounds to those who significantly supported Codeforces in the crowdfunding campaign for the 8th anniversary. Although Telegram is not explicitly present on the list of donators, for us this is the first and most important friend. We express our gratitude to Telegram and personally to Pavel Durov for the constant support and send regards from programming contest com...
list of donators, for us this is the first and most important friend. We express our gratitude to

Full text and comments »

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

99.
By MikeMirzayanov, history, 11 years ago, translation, In English
New: Educational Rounds on Codeforces! Hi everybody! First, I invite you to take part in an official [contest:597]. The fact is, the Codeforces team has made numerous changes to the platform (details are below), and we want to be sure that the basic functionality remained unchanged. This round will have a shortened duration of 1.5 hours, consist of 3 (maybe 4) problems that you might have already seen before. Its purpose is to test the system on the one hand, and on the other hand &mdash; to brighten up a Wednesday evening. Of course, the round will be unrated. Now the main thing. This coming Friday (yes, the 13th of November) Codeforces starts another line of rounds. We called them Educational Rounds. Using my students at the Saratov State University Programmings Competitions Training Center as an example, I regularly notice that even those who have a considerable progress in the results on the rounds often have narrow purview in terms of standard topics and ideas, they are not familiar with many well-known problems ...

Full text and comments »

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

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

Full text and comments »

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

101.
By -is-this-fft-, history, 4 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 ...
see a list of files and folders located in the folder you're currently in.

Full text and comments »

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

102.
By Fefer_Ivan, 12 years ago, translation, In English
Andrew Stankevich Contests — 46 contests later Good evening, Codeforces. Some time ago I added the last 46th Andrew Stankevich Contest to the Gym. Now all of them are added. Here is a complete [list](/group/j9VlExDLmA/blog/entry/64) and the [group](/group/j9VlExDLmA/contests) with all the contests. Now I want to tell what was done during the process of adding all the contests to the gym. &nbsp;[cut]&nbsp; - In some problems tests and checkers (the program to check if the participant's answer is correct if it is ambigious) are fixed. Errors were found not only by me, but by the members of Codeforces community as well. - In most of the archive tests were generated from scratch. I tried to use the sam compiler versions because some test generator program used built-in pseudorandom number generator and they can produce different numbers in different compilers. - In old contests time limits were adapted to fit on modern computers. For more precise time limit tuning I used not only jury's solutions from the contest arch...
. Here is a complete [list](/group/j9VlExDLmA/blog/entry/64) and the [group](/group/j9VlExDLmA

Full text and comments »

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

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

Full text and comments »

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

104.
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...
**[Here](https://www.youtube.com/watch?v=_G_LMuLWMaI&list =PLDjGkpToBsYDx4GWu2u87sTqt6ICELz-T) is a

Full text and comments »

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

105.
By TLE, history, 10 years ago, In English
using merging segment tree to solve problems about sorted list Two months ago, I came across a problem. Initially there are n elements, they are in n tiles. There are 3 kinds of queries: 1. merge two tiles into one tile. 2. split one tile into two tiles. (Formally for a tile of size k, split it into two tiles of size k1 and k2, k=k1+k2, the first tile contains the smallest k1 elements and the second tile contains the rest) 3. find the k-th smallest element in one tile. Recently I found this technique http://blog.csdn.net/zawedx/article/details/51818475 (in Chinese) which can be used to solve this problem. This blog is my own explanation :p First, let's suppose the values in the sorted lists are integers between 1~n. If not, you may just sort and map them. Let's build a segment tree for every sorted list, segment trees are built based on values (1~n). In every node of a segment tree stores how many numbers are in this range, let's call this the value of a node. It seems that it requires O(nlogn) space to store every segment t...
using merging segment tree to solve problems about sorted list, So for a sorted list with only one element, we simply build a chain of this value, so only O(logn, When we split a segment tree (sorted list), simply split two children recursively:

Full text and comments »

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

106.
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 ...
your time. I will just list a couple of trusted volunteer organizations: https://wfu.world/en

Full text and comments »

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

107.
By Ahnaf.Shahriar.Asif, history, 7 years ago, In English
DP Tutorial and Problem List Today I've listed some DP tutorials and problems. Actually, I made it for my personal practice. But I think It may Help others too. Update: I write stuff [Here](https://duoblogger.github.io) in Bengali. I probably have one or two basic DP tutorials too. If you understand Bengali, it may help. **Note: If you have some other tutorial links and nice problems, mention them. I'll add them here. It'll help me too.** ## Dynamic programming: * [Topcoder Tutorial](https://www.topcoder.com/community/competitive-programming/tutorials/dynamic-programming-from-novice-to-advanced/) * [Dynamic Programming,from novice to advanced](https://www.cnblogs.com/drizzlecrj/archive/2007/10/26/939159.html) * [Learn DP and other tricks](https://www.codechef.com/certification/data-structures-and-algorithms/prepare#foundation) * [Non-trivial DP tricks](https://codeforces.me/blog/entry/47764) * [Everything about Dynamic Programming](https://codeforces.me/blog/entry/43256) * [Digit DP 1](https://...
DP Tutorial and Problem List, ://www.youtube.com/playlist?list=PLPt2dINI2MIattDutu7IOAMlUuLeN8k2p) * [DP playlist2(Arabic)](https

Full text and comments »

108.
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...
And now the list of all other entries in no particular order:

Full text and comments »

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

109.
By cry, 23 months ago, In English
Codeforces Round 979 (Div. 2) Haiii Codeforces ^_^ ================== <img src="/predownloaded/43/5d/435d58648d7459cedf23ec644dc6cc5fbc112f64.png" style="width:350px;float:right;margin:0 1em 1em 1em;"/> **Note the unusual starting time. This round starts 30 minutes before the standard starting time.** [user:vgoofficial,2024-10-15] and I are extremely excited to invite you to [contest:2030] on [contest_time:2030]. You will be given **7 problems** and **2 hours and 15 minutes** to solve them. One problem will be split into two subtasks. This round will be **rated** for all participants with rating below **2100**. This round is based on... absolutely nothing. We would like to mention the following individuals for making the contest possible: - Our coordinatorz [user:satyam343,2024-10-15] for his active and insightful coordination once again. ORZ!!!! - Our testuwuwuwuers for their efforts in improving this [gramazing](https://www.urbandictionary.com/define.php?term=Gramazing) contest: [user:nife...
- The most jacked user on this list, [user:MikeMirzayanov,2024-08-02], for developing Codeforces

Full text and comments »

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

110.
By pajenegod, history, 3 years ago, In English
Tutorial: A simple O(n log n) polynomial multiplication algorithm Hi Codeforces! I have something exciting to tell you guys about today! I have recently come up with a really neat and simple recursive algorithm for multiplying polynomials in $O(n \log n)$ time. It is so neat and simple that I think it might possibly revolutionize the way that fast polynomial multiplication is taught and coded. You don't need to know anything about FFT to understand and implement this algorithm. Big thanks to [user:nor,2023-07-10], [user:c1729,2023-07-10] and [user:spheniscine,2023-07-10] for discussing the contents of the blog with me and comming up with ideas for how to improve the blog =). I've split this blog up into two parts. The first part is intended for anyone to be able to read and understand. The second part is advanced and goes into a ton of interesting ideas and concepts related to this algorithm. Prerequisite: Polynomial quotient and remainder, see [Wiki article] (https://en.wikipedia.org/wiki/Polynomial_greatest_common_divisor#Euclidean_divi...
Input: P: A list of length n representing a polynomial P(x). n needs to be a power of 2, Input: P: A list representing a polynomial P(x) Q: A list representing a polynomial Q(x, Input: P: A list representing a real polynomial P(x) Q: A list representing a real polynomial

Full text and comments »

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

111.
By Qingyu, 2 years ago, In English
The 3rd Universal Cup Announcement (with Details of Upcoming Online and Onsite Event on June 23!) <center> <img src="/predownloaded/a6/3b/a63b8b0dc4b18f3e18c316abc22d4677aa075fd8.png" style="height: 262.0px;max-width: 100.0%;max-height: 100.0%;"> </center> Hello everyone, we are happy to announce that the 3rd Universal Cup has started officially. Universal Cup is an organization dedicated to offering training resources for competitive programming teams. In the previous season, over 900 teams from more than 500 affiliations all over the world, registered and participated in a total of 28 stages, encompassing contests from Asia, Europe, and America. We also want to express our gratitude to our sponsor [Huawei](https://codeforces.me/blog/entry/122510). - Semifinal and Summer Summit --------------------------- As announced before ([Link](https://codeforces.me/blog/entry/127295)), we will host the 2nd Universal Cup Semifinal on June 23, 2024. The contest will start at 17:00 (UTC +8) and end at 22:00 (UTC +8). **Any Universal Cup registered team can participate. If you are...
Here is a list of teams that will be competing onsite:

Full text and comments »

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

112.
By carcinisation, 2 years ago, In English
IOI 2024 Teams A few days ago, the team selection of Türkiye was completed after a glorious and intense battle. Since no one has posted a blog for the [IOI](https://www.ioi2024.eg/) teams yet, I have taken up the responsibility this year. Here is the IOI team of Türkiye: - Cengiz Eray Aslan ([user:erray,2024-05-12]) — 3rd time at IOI, 0 attempts left - Berke İnan Tol ([user:tolbi,2024-03-28]) — 2nd time at IOI, 0 attempts left - Duru Özer ([user:Weobe,2024-05-12]) — 1st time at IOI, 0 attempts left - Noyan Cantürk ([user:Nummer_64,2024-05-12]) — 1st time at IOI, 3 attempts left I wish the best of luck to all the participants. If you could kindly let me know the members of your team in the comments, I will be happy to update the list of participating teams. Good luck, and see you there! UPD: Added column for max rating average <table> <thead> <tr> <th>Country</th> <th colspan="4">Members</th> <th>Average of Max Ratings</th> ...
your team in the comments, I will be happy to update the list of participating teams. Good luck, and

Full text and comments »

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

113.
By MikeMirzayanov, 7 years ago, translation, In English
Codeforces Round #547 (Div. 3) Hello, Codeforces! I am pleased to invite you to [contest:1141], which will start on [contest_time:1141]. Everyone whose current rating is strictly less than 1600 is invited to participate officially. All others can take part out of the competition. It so happened that the schedule of this month is not replete with rounds (coordinators, we hope for you!). Therefore I decided to partially correct the situation. All the problems of this round were invented and prepared by me on the last day of [Hello Muscat Programming Bootcamp 2019] (/blog/entry/63298) and on flights from Muscat to St. Petersburg. I even specially noted the time for preparation: for the current moment (the problems are ready for testing) I spent about 6 hours on their preparation, including inventing some of the problems. I really like working on problems, this is something at the intersection of creativity and programming. I really hope you enjoy the result of my work. <center> <br/> <img src = "/predownload...
I hope a little later a list of thanks to testers will appear instead of this paragraph. So far

Full text and comments »

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

114.
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...
. This is not a super-comprehensive list, I also set some problems for some local contests, but that's

Full text and comments »

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

115.
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...
) applications of FFT. There is a long list of generalizations and weird applications and implementation details

Full text and comments »

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

116.
By hxu10, 10 months ago, In English
Codeforces Round 1061 (Div. 2) On the special day of 1024, I am very glad to invite you to participate in [contest:2156], starting at [contest_time:2156] There will be six problems for you to solve in two hours, one of which will have two parts. At least one problem will be interactive, so please make sure to read the [guide for interactive problem](https://codeforces.me/blog/entry/45307) before the contest. This round will be rated for all participants with rating below 2100. All problems were authored by me, and carefully prepared by [user:maomao90,2025-10-20] and me. I would like to thank the following list of very strong individuals for making this round possible: - [user:maomao90,2025-10-20] for his wonderful coordination and careful adjustments to some problems! - [user:MathModel,2025-10-20] for his excellent work on the editorial. - [user:Alexdat2000,2025-10-20] for translating the statements into russian. - [user:Dominater069,2025-10-20] and [user:A_G,2025-10-20] for VIP testing - [user:Agi...
I would like to thank the following list of very strong individuals for making this round possible:

Full text and comments »

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

117.
By Zhtluo, history, 2 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...
There are some common pitfalls when using the way of thinking. I will list a few that I encountered.

Full text and comments »

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

118.
By GlebsHP, history, 3 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...
- **UPD** Now that the list is complete we can say many thanks to all the testers

Full text and comments »

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

119.
By adnan_toky, history, 5 years ago, In English
List of Problems Having Short Statements Who doesn't like short statements? (or maybe just me!) Sometimes I get bored reading long statements while practicing and search for the problems with short statements. So I filtered such problems and **ordered them by their statement size**. I thought of sharing the list with everyone. Hope it may help the lazy programmers like me! <br/> **Problems (Categorized by Difficulty):** <spoiler summary="1700"> - [problem:1325D] - [problem:578A] - [problem:622C] - [problem:632C] - [problem:900C] - [problem:915C] - [problem:1268A] - [problem:1485C] - [problem:1512G] - [problem:281B] - [problem:464A] - [problem:466C] - [problem:578B] - [problem:617D] - [problem:627A] - [problem:678D] - [problem:691D] - [problem:983A] - [problem:1000C] - [problem:1051D] - [problem:1132C] - [problem:20A] - [problem:305B] - [problem:321A] - [problem:327C] - [problem:32C] - [problem:349B] - [problem:467C] - [problem:584C] - [problem:773A] - [problem:919D] - [problem:1061C] ...
List of Problems Having Short Statements, of sharing the list with everyone. Hope it may help the lazy programmers like me!

Full text and comments »

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

120.
By MikeMirzayanov, 5 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-...
list of our main partners this year:

Full text and comments »

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

121.
By 300iq, 8 years ago, translation, In English
Avito Code Challenge 2018 Hi! I'm glad to invite you to take part in [contest:981] which starts on [contest_time:981]. Any participant can join the round and it will be rated for each participant. Hope to see you among the participants! Problems are prepared by me — Ildar Gainullin. This round is conducted on the initiative and support of [Avito](https://www.avito.ru/). Avito.ru is a Russian classified advertisements website with sections devoted to general good for sale, jobs, real estate, personals, cars for sale, and services. Avito.ru is the most popular classifieds site in Russia and is the third biggest classifieds site in the world after Craigslist and the Chinese website 58.com. Many thanks to Vladislav [user:winger,2018-05-24] Isenbaev, Grigory [user:gritukan,2018-05-24] Reznikov, Ivan [user:isaf27,2018-05-24] Safonov,Alexander [user:AlexFetisov,2018-05-24] Fetisov and Shiqing [user:cyand1317,2018-05-24] Lyu for the round testing, Nikolay [user:KAN,2018-05-24] Kalinin for helping me to...
| List place | Contest | Rank | Name | |--|--|--|--| | 6 | 981 | 36 | [user:snuke,2018-05-30

Full text and comments »

Announcement of Avito Code Challenge 2018
  • Vote: I like it
  • +565
  • Vote: I do not like it

122.
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...
. - problem.validatorTests — returns a list of validator tests for the problem, Here's a list of the main improvements to Polygon that we've made (sometimes with significant help

Full text and comments »

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

123.
By Dominater069, 8 months ago, In English
IICPC Global Codefest 2026 Hello! Registrations for IICPC Global Codefest 2026 are opening soon. This is the first global edition of India's largest offline competitive programming competition. **About IICPC Codefest** IICPC (Intercollegiate Informatic and Competitive Programming Camp) is an academic and industry-backed organization focused on identifying, evaluating, and nurturing high-potential students in competitive programming, algorithms, and computer science fundamentals through rigorously designed, large-scale competitive examinations and camps. We organize Codefest, a multi-stage competitive programming competition conducted across India. This year, we are opening participation to international students from 50+ countries. **The prelims is individual participation, and online for international students. The deadline for registration is 15th January, 23:59 IST**. <img src="https://i.ibb.co/bRJt7y44/codefest-banner.png" height="50"> **Competition Structure** Prelims &mdash; Janua...
. See the full list [here](https://indianvisaonline.gov.in/evisa)

Full text and comments »

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

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

Full text and comments »

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

125.
By jerrywang0916, history, 5 months ago, In English
List of Suspected Cheaters in Nebius Round 2 This message was originally intended to be posted via the account [user:send_cheater_to_basement,2026-03-31]. However, since that account is not a trusted account, it cannot publish blogs. Therefore, I am using this account instead, **which belongs to one of my classmates**. I would like to thank him for lending it to me. I manually collected all suspicious users, which were then organized by AI. There may be errors. Here is a list of users who are heavily suspected of cheating during the Nebius Round 2. I only managed to check the top 250 participants whose original rating was no higher than Specialist. Unfortunately, I had to stop after checking these because my IP was flagged as a web crawler/bot. **⚠️ DISCLAIMER: Appearing on this list does not definitively prove that a user has cheated.** It simply indicates highly suspicious behavior during the contest. ### Detection Methodology During the contest, anti-AI traps were placed in the problem statements: - ...
List of Suspected Cheaters in Nebius Round 2, ### List of Suspicious Users

Full text and comments »

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

126.
By duality, 3 years ago, In English
Codeforces Round #884 (Div. 1 + Div. 2) Editorial Video editorials for [B](https://www.youtube.com/watch?v=5nzUni8dFLQ), [C](https://www.youtube.com/watch?v=8mz7gnAJ5QM), and [D](https://www.youtube.com/watch?v=ahnNAwpGwHc) are available on [user:ak2006,2023-07-11]'s channel. ### [problem:1844A] <spoiler summary="Hint 1"> There exists a small $n$ where the second player can win. </spoiler> <spoiler summary="Hint 2"> If $a \ge 2$, then $n = 1$ works. </spoiler> <spoiler summary="Solution"> [tutorial:1844A] </spoiler> <spoiler summary="Implementation"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { int t,a,b; scanf("%d",&t); while (t--) { scanf("%d %d",&a,&b); printf("%d\n",a+b); } return 0; } ~~~~~ </spoiler> ### [problem:1844B] <spoiler summary="Hint 1"> In order for $(l,r)$ to contribute to the primality, we must have $\operatorname{MEX}(a_l,\dots,a_r) \ge 2$, so there is some value $1$ between indices $l$ and $r$. </spoiler> <spoile...
this element does not exist, then we take $a_i$ to be the largest element in the linkedlist. Then

Full text and comments »

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

127.
By bicsi, history, 9 years ago, In English
Minima/maxima over all fixed-size arrays (multi-dimensional) This article will be presenting a rather classical problem that can be solved using deques, along with an extension that allows you to solve the problem in its more general multi-dimensional case. I have decided to write this article after [this discussion on 2D range-minimum query](http://codeforces.me/blog/entry/45485?#comment-377649). The article will be mainly based on this following **problem**: #### You are given an array of numbers $A[]$ of size $n$ and a number $k \leq n$. Find the minimum value for each continuous subarray of size $k$. We will be now focusing on the linear-time solution to this problem. **Solution:** Consider sweeping from left to right through the array. At every moment we keep a list of "candidates" for minimum values throughout the process. That means that at each moment, you have to add one element to the list and (potentially) remove one element from the list. The key observation is that, during the sweep line process, we find two values ...
Consider sweeping from left to right through the array. At every moment we keep alist of

Full text and comments »

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

128.
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...
,...,V)+\{R\}$ (the vertices). Each vertex $u$ has a matching list containing all of its children

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

132.
By DmitryGrigorev, 8 years ago, translation, In English
Codeforces Round #489 (Div.2) Hi, Codeforces! I'm glad to invite everybody to the #489 Codeforces Round, which will be held as soon as tomorrow, on [Monday, June 18, 2018 at 19:35](https://www.timeanddate.com/worldclock/fixedtime.html?day=18&month=6&year=2018&hour=19&min=35&sec=0&p1=166). The round will be rated for all participants from the second division (with rating **below than 2100**). As usually, we will be glad to see participants from the first division out of competition! Problems for the round have been invented and prepared by us, pupils of Moscow school №2007, Dmitry [user:DmitryGrigorev,2018-06-17] Grigorev and Fedor [user:ushakov.fedor,2018-06-17] Ushakov. We want to give thanks to Andrew [user:GreenGrape,2018-06-17] Raiskiy for his aid in preparing and testing of the problems, to Ildar [user:300iq,2018-06-17] Gainullin and to AmirReza [user:Arpa,2018-06-18] PoorAkhavan who have tested our problems too and to the coordinator Nikolay [user:KAN,2018-06-17] Kalinin, since our sometimes strange and u...
List of the winners of the contest:

Full text and comments »

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

133.
By Aris, 5 years ago, In English
Codeforces Round #764 (Div. 3) Hello! [contest:1624] will start at [contest_time:1624]. You will be offered 7-8 problems with expected difficulties to compose an interesting competition for participants with ratings up to 1600. However, all of you who wish to take part and have a rating of 1600 or higher, can register for the round unofficially. The round will be hosted by rules of educational rounds (extended ICPC). Thus, solutions will be judged on preliminary tests during the round, and after the round, it will be a 12-hour phase of **open hacks**. You will be given **7-8 problems** and **2 hours and 15 minutes** to solve them. One of the problems in this round is **interactive**. Don't forget to read the [guide on interactive problems](https://codeforces.me/blog/entry/45307). Note that the **penalty** for the wrong submission in this round is **10 minutes**. [Remember](https://codeforces.me/blog/entry/59228) that only the trusted participants of the third division will be included in the official s...
contest and valuable feedback. List of testers will be updated.

Full text and comments »

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