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

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

Results

1.
By 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), basic topics and solve problems. #### Topic List Link: [smash me](https://blog.shahjalalshohag.com, #### Topic List Link: [smash me](https://blog.shahjalalshohag.com/topic-list/)

Full text and comments »

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

2.
By MikeMirzayanov, history, 22 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...
" 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.

Full text and comments »

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

3.
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], # Trees - [A list of important concepts in Tree-based Problems](https://codeforces.me/blog/entry, 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

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

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

Full text and comments »

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

6.
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...
* a new icon-link

Full text and comments »

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

7.
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]...
, help Codeforces – it's important and valuable. And here's the full list: [user:errorgorn,2024-02-04

Full text and comments »

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

8.
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, **Link to the website: [smash me](https://youkn0wwho.academy/topic-list)**, list of the top users based on the number of completed topics and solved problems. **Link to the

Full text and comments »

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

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

10.
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...
originally written by me and some of them are collected from others but modified in a cleaner way.Link

Full text and comments »

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

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

Full text and comments »

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

12.
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 ...
present to you a list of what we have done during this time. Most of the changes were made to, When the conflict occurs, the link 'Resolve Conflicts' will appear on the sidebar accessing the

Full text and comments »

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

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

Full text and comments »

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

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

15.
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...
. :) See the link: [click](https://www.luogu.com.cn/problem/P9394). The problem in contest is only a

Full text and comments »

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

16.
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...
memory by looking through a linked list for free chunks. I did not have enough time or energy to, , `V6_HeapAlloc` and `V5_HeapAlloc`, which seem to allocate memory by looking through alinked list for

Full text and comments »

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

17.
By pajenegod, history, 2 years ago, In English
Tutorial: The fastest tree algorithm, the XOR Linked Tree Hi Codeforces! This is a blog about a really cool folklore technique that seems to have been forgotten over time. I currently only know of one place where it is mentioned on the internet, https://www.algonotes.com/en/minimal-memory-dp/, which is a tutorial by [user:monsoon,2024-10-20] for his problem "Matchings" https://dmoj.ca/problem/ontak2010sko from a POI training camp in 2010 ([see this for more information](https://codeforces.me/blog/entry/92090?#comment-807964)). But I've heard that this technique is even older than that. I originally learnt of this technique a couple of years back when I was digging through the fastest submissions on [problem:321-C] and I saw it being used in a submission [submission:9076307] by [user:Marcin_smu,2024-10-18] from 2014. I don't know if there is a name for this technique, so I've decided to call it the _XOR Linked Tree_ because of its close connection to XOR linked lists https://en.wikipedia.org/wiki/XOR_linked_list. The XOR Linked Tree is...
Tutorial: The fastest tree algorithm, the XOR Linked Tree, adjacency list. It is also really fast, since there are no expensive `.push_back`/`.append` calls., technique, so I've decided to call it the _XOR Linked Tree_ because of its close connection to XOR, | Time | Memory | Submission link | |----------|------------|----------------|---------| | XORLinked, This is it! This is the entire algorithm! The `deg` list is now completely 0 (except for `deg[root, | C++ Benchmark | Time | Memory | Submission link, | Python Benchmark | Time | Memory | Submission link

Full text and comments »

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

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

Full text and comments »

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

19.
By YouKn0wWho, 5 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, away from this. ### The Equation List Link: [blog.shahjalalshohag.com/equation- list/](https, ### The Equation List Link: [blog.shahjalalshohag.com/equation-list/](https

Full text and comments »

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

20.
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, will update the link if other sources found., 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

21.
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...
If you ask me how to improve your algorithm competition skill, I will give you thelink of this, important? I really don't know how to choose order is best for me. So I do almost the problems.List, 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

22.
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...
managers. I will not put a link to the server here, and I ask setters who has it to not do it too: we want, link to the server here, and I ask setters who has it to not do it too: we want only people who are

Full text and comments »

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

23.
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...
** [link](https://bit.ly/37MSCjV). - A [Google Doc](https://bit.ly/2V4G3eS) that outlines the evolution, - The **problems lists** [link](https://bit.ly/37MSCjV). - A [Google Doc](https://bit.ly/2V4G3eS

Full text and comments »

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

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

Full text and comments »

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

25.
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...
the list. Here is an example of the screen by the link `http://codeforces.me/problemset/page/3, . Here is an example of the screen by the link `http://codeforces.me/problemset/page/3?list

Full text and comments »

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

26.
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...
Maintain a linked list of the unused entries of $a$ and a set of unused, algorithm from the easy version with the help of a linked list of the unused elements of $a$ and a, this element does not exist, then we take $a_i$ to be the largest element in thelinked list. Then, +1}$) and ($b_{k-1}-a_i \le |c|$). Maintain a linked list

Full text and comments »

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

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

Full text and comments »

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

28.
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...
, you should have the link "propose a contest/problems" in the personal menu on the right sidebar

Full text and comments »

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

29.
By pashka, 6 years ago, In English
ITMO Algorithms Course Hello Codeforces! I teach a course on algorithms and data structures at ITMO University. During the last year I was streaming all my lectures on [Twitch](https://twitch.tv/pmavrin) and uploaded the videos on [Youtube](https://www.youtube.com/pavelmavrin). This year I want to try to do it in English. This is a four-semester course. The rough plan for the first semester: - Algorithms, complexity, asymptotics - Sorting algorithms - Binary heap - Binary search - Linked lists, Stack, Queue - Amortized analysis - Fibonacci Heap - Disjoint Set Union - Dynamic Programming - Hash Tables The lectures are open for everybody. If you want to attend, please fill out [this form](https://docs.google.com/forms/d/e/1FAIpQLSfHIhiwAUyKfnt92NluNj2tLnczp0oxu5szPS4S_PF3N7EUDA/viewform) to help me pick the optimal day and time. See you!
- Linked lists, Stack, Queue - Amortized analysis - Fibonacci Heap - Disjoint Set Union - Dynamic, , complexity, asymptotics - Sorting algorithms - Binary heap - Binary search - Linked lists, Stack

Full text and comments »

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

30.
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...
doubly linked list of $u_{in}$, and iterate those again recursively. We can do it with bfs or dfs, it, explain an implementation based on **linked lists**, rather than *threads* which is what is, How about going down? We will maintain $V+1$ doubly linked lists with elements in the universe $[0

Full text and comments »

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

31.
By ramchandra, 6 years ago, In English
Link-cut tree tutorial #### Introduction The link-cut tree data structure represents a rooted forest (a collection of rooted trees) and can perform the following operations in $O(\log n)$ amortized time (here, a node represents a vertex of the tree): * `link(par, child)`: Attach a tree (child) as a child of another tree's node (par). * `cut(node)`: Detach node's subtree from node's parent. * `find_root(node)`: Find the root of a node. * `lca(u, v)`: Find the least-common ancestor of two nodes. #### Structure: The represented forest (which is represented by the link-cut tree) is split into disjoint, vertical preferred paths composed of preferred edges linking each node with the latest child on the access path. On each preferred path we store a splay tree, sorted by increasing depth. You'll want to know splay trees for link-cut trees so see my [splay tree tutorial](https://codeforces.me/blog/entry/79524) for a tutorial on splay trees, which are a type of balanced binary search tree. Each ...
Link-cut tree tutorial, * [Codechef list of problems](https://www.codechef.com/tags/problems/link -cut-tree)

Full text and comments »

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

32.
By Errichto, 7 years ago, In English
Bitwise operations for beginners You can watch my Youtube video ([link](https://www.youtube.com/watch?v=xXKL9YBWgCY&list=PLl0KD3g-oDOHpWRyyGBUJ9jmul0lUOD80)) with the same content as this blog. Anyway, enjoy. ### Introduction Let's learn bitwise operations that are useful in Competitive Programming. Prerequisite is knowing the binary system. For example, the following must be clear for you already. $$13 = 1 \cdot 8 + 1 \cdot 4 + 0 \cdot 2 + 1 \cdot 1 = 1101_{(2)} = 00001101_{(2)}$$ Keep in mind that we can pad a number with leading zeros to get the length equal to the size of our type size. For example, `char` has $8$ bits and `int` has $32$. ### Bitwise AND, OR, XOR You likely already know basic logical operations like AND and OR. Using `if(condition1 && condition2)` checks if both conditions are true, while OR (`c1 || c2`) requires at least one condition to be true. Same can be done bit-per-bit with whole numbers, and it's called bitwise operations. You must know bitwise AND, OR and XOR, typed r...
You can watch my Youtube video ([link ](https://www.youtube.com/watch?v=xXKL9YBWgCY&list=PLl0KD3g

Full text and comments »

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

33.
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!, algorithm competition skill, I will give you the link of this blog. — Codeforces](http, it would probably be cool if there's an [awesome list ](https://github.com/sindresorhus/awesome) for, | Name (Handle) | Link | | --- | --- | | Petr Mitrichev ([user:Petr,2018-04-10]) | [Youtube, | 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

34.
By himanshujaju, history, 10 years ago, In English
Parallel Binary Search [tutorial] [Click here to download the pdf](https://www.dropbox.com/s/cndim2lv872dzen/parallel-binary-search.pdf?dl=0) Pre Requisites -------------- Binary Search &mdash; How it works and where can it be applied! Motivation Problem ------------------ We aim to solve this problem : [Meteors](http://www.spoj.com/problems/METEORS/) The question simply states : There are $N$ member states and $M$ sectors. Each sector is owned by a member state. There are $Q$ queries, each of which denote the amount of meteor shower in a $[L,R]$ range of sectors on that day. The $i^{th}$ member state wants to collect $reqd[i]$ meteors over all its sectors. For every member state, what is the minimum number of days it would have to wait to collect atleast the required amount of meteors? Solution -------- The naive solution here is to do a binary search for each of the $N$ member states. We can update in a range using segment trees with lazy propagation for each query. The time complexity of such a ...
and check if the linked list for this query is empty or not. If not, check for the member states in, implementation : 1. linked list for every member state, denoting the sectors he owns. 2. arrays $L, 1. linked list for every member state, denoting the sectors he owns. 2. arrays $L$ and $R, ~~~~~ for all logQ steps: clear range tree and linked list check for all member states i

Full text and comments »

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

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

Full text and comments »

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

36.
By ecnerwala, 11 years ago, In English
8VC Venture Cup 2016 — Final Round Editorial ###[problem:635A] We can iterate over each possible rectangle and count the number of violists enclosed. This can be optimized with rectangular prefix sums, though the simple brute force is sufficient for this problem. Runtime: $O(n^6)$ ###[problem:634A] Notice that, as we move the empty pedestal around the circle, we cyclically permute the statues (and the empty pedestal can be anywhere). Thus, we can reach one state from another if and only if, after removing the empty pedestal, they are cyclic shifts of each other. The starting and ending configurations are permutations, so we can check this in linear time. Runtime: $O(n)$ ###[problem:627A] For any two integers $a$ and $b$, we have $s = a + b = (a \oplus b) + (a \& b) * 2$, where $a \oplus b$ is the xor and $a \& b$ is the bitwise AND. This is because $\oplus$ is non-carrying binary addition. Thus, we can find $a \& b = (s - x) / 2$ (if this is not an integer, there are no solutions). Now, for each bit, we ha...
with $xhi = r$ and a linked list containing all the desired violists; decrementing $xhi$ is now a, . Instead, we sweep in reverse. Start with $xhi = r$ and a linked list containing all the desired violists

Full text and comments »

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

37.
By meooow, 5 years ago, In English
[Tutorial] k shortest paths and Eppstein's algorithm Hello, Codeforces! This is a blog on the $k$ shortest paths problem, and a neat algorithm by David Eppstein that can solve it very fast. You can find the original paper "Finding the $k$ Shortest Paths" [here](https://www.ics.uci.edu/~eppstein/pubs/Epp-SJC-98.pdf). Given an edge-weighted directed graph $G$, the problem asks us to find the lengths of the $k$ shortest paths from a fixed vertex $s$ to a fixed vertex $t$. This a very specific problem, and unlikely to show up in any programming contest. However, the ideas used to solve this may be useful in solving other problems. ### Getting started Prerequisites: * [Dijkstra's algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) * [Persistent](https://en.wikipedia.org/wiki/Persistent_data_structure) [heaps](https://en.wikipedia.org/wiki/Heap_%28data_structure%29) [cut]<p></p> Let's get some things out of the way. * The input graph is $G$, with $n$ vertices and $m$ edges. We assume $n \leq m$ to simpl...
using a persistent structure. A singly linked list can be used, taking $O(1)$ per insertion. So, '$ using linked lists. Dashed lines connect linked list nodes., {p_u}$. This is possible using a persistent structure. A singly linked list can be used, taking $O(1

Full text and comments »

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

38.
By ko_osaga, history, 3 years ago, In English
[Tutorial] Online Dynamic Connectivity The World Finals are right ahead, and if everything works as I expect, you will probably have to wait a lot of time before the contest, dress rehearsals, or anything else. I prepared this blog post so that you have something to keep yourself occupied. # Goal Our goal is to maintain connectivity in fully-dynamic query streams. In other words, we want to solve this problem: * Insert an edge $e = (u, v)$ into a graph * Delete an edge $e = (u, v)$ into a graph * Find if two vertices $u, v$ are connected * Find the size of connected components where the vertex $u$ belongs. The *offline version*, where you can *cheat* (aka, read all queries before answering, and answer everything at the very end of the program) has a very cool solution commonly known as *Offline Dynamic Connectivity*. This is enough in most CP problems, where this *offline* solution is rarely considered cheating. Unfortunately, people in the academia are not chilling and consider this a kind of cheating (n...
spanning forest with `link` operation. Otherwise throw it into the list of back edges. Easy!

Full text and comments »

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

39.
By arvindf232, history, 2 years ago, In English
How might LGMs cheat using current AI. Or, are these not cheating? Disclaimer: My natural English ability is questionable. I have passed the blog through chatgpt to correct grammatical mistakes. I experimented with o1-mini and tried to understand its implications for competitive programming on Codeforces at level 2500 or higher. Obviously, the current AI cannot outright provide you with solutions; however, there are already ways it can help quite a lot. ### Brute Force Writing I believe most competitors regularly use brute-forces. They are kind of an admission of failure to find your mistakes on your own. Previously, brute-forces came with the cost of taking 5 minutes to write. I would not do it unless it is a very hard problem, or I have tried debugging by hand for 10 minutes and seen nothing. If AI usage is assumed, then these 5 minutes would be completely saved. Five minutes would correspond to approximately a 10 performance rating if on the final problem and increasingly more on earlier problems. ### Translations of Languages Thi...
best, is to realize this can be handled with a basic linked list implementation. During practice, I, implementation supporting those queries and replaced my linked list. The solution was accepted rather easily, realize this can be handled with a basic linked list implementation. During practice, I ended up going, Note that, in particular, the AI didn't tell me I was dumb and could have used a linked list, but

Full text and comments »

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

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

Full text and comments »

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

41.
By huangzirui, history, 4 years ago, In English
Editorial of Codeforces Round 796 [problem:1688A] Idea: [user:huangzirui,2022-06-03]. Solution: [user:huangzirui,2022-06-03]. Preparation: [user:huangzirui,2022-06-03]. Good problem Average problem Bad problem Did not solve <spoiler summary="Hint"> Consider $x=2^k$ and $x\ne 2^k$ separately. </spoiler> <spoiler summary="Solution"> Let $p_i$ be the $i$-th bit of $x$, $q_i$ be the $i$-th bit of $y$ (both indexed from $0$). $x\ \texttt{and}\ y > 0\Leftrightarrow \exists i,\ p_i= q_i = 1$. $x\ \texttt{xor}\ y > 0\Leftrightarrow \exists i,\ p_i\ne q_i$. To satisfy the first condition, find the minimum integer $k$ satisfying $p_k=1$, and assign $1$ to $q_k$. If $x\ne 2^k$, the second condition is satisfied now. Otherwise, find the minimum integer $j$ satisfying $p_j=0$, and assign $1$ to $q_j$. The time complexity is $O(1)$. </spoiler> <spoiler summary="Code (C++)"> ```cpp #include<bits/stdC++.h> ...
$\frac{a_n}{w}$ jumps. We only need to enumerate jumps to calculate the ranges. We can uselinked list

Full text and comments »

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

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

Full text and comments »

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

43.
By chromate00, 22 months ago, In English
Codeforces Round 1000 (Div. 2) — Editorial <spoiler summary="Rating Predictions"> | Handles | A | B | C | D | E | F1 | F2 | | ---------------- | --- | ---- | ----------- | ----------- | ----------- | ---- | ----------- | | ~Proof_by_QED,2025-01-20 | 800 | 1000 | 1500 | 2200 | 2400 | 1800 | 2600 | | ~chromate00,2025-01-20 | 800 | 1100 | 1500 | 2100 | 2300 | 1800 | 2700 | | ~redpanda,2025-01-20 | 800 | 900 | 1400 | 2000 | 2400 | | | | ~larush,2025-01-20 | 800 | 1100 | 1600 | 2100 | | | | | ~FairyWinx,2025-01-20 | 800 | 900 | 1500 | 2000 | 2400 | 1800 | 2500 | | [user:priyanshu.p,2025-01-20] | 800 | 1200 | 1500 | 2000 | 2500 | 2000 | | | ~Intellegent,2025-01-20 | 800 | 1000 | 1400 | 2000 | 2200 | 2000 | 260...
is hard to fix using only a linked list. Instead, we will also maintain the implicit rooted tree, , every time we have to split a linked list, we will identify the smaller section and split it out in, . Precisely, every time we have to split a linked list, we will identify the smaller section and split it, Given a linked list of indices and two nodes on it, we can identify the smaller section in

Full text and comments »

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

44.
By geranazavr555, 5 years ago, translation, In English
Polygon Updates (February 2022) Hello, Codeforces. In this post, I'll share with you a few recent improvements in Polygon made by [user:MikeMirzayanov,2022-03-03], [user:unreal.eugene,2022-03-03], [user:dk318,2022-03-03] and me. Polygon is a service to prepares programming problems and contests. It is usually used to prepare problems for olympiads/programming contests but it is also often used to prepare educational content. It is located at https://polygon.codeforces.com/ and is open to everybody. Here are three recent new features: * IOI-like Graders for Python * Problem Materials * User Groups [cut] <br/> <br/> IOI-like Graders for Python ================== About 3 years ago we announced support of IOI graders for C++ in Polygon (Please read [the old post](https://codeforces.me/blog/entry/66916)). Now we have added support for graders written in Python. However, since there is no concept of linkage in Python, Python graders are different from C++ ones. In the case of Python, the gra...
item” link). In the pop-up window, you can choose which elements the archive should contain, To manage user group members you have to click the “Enter” link on the corresponding group. You

Full text and comments »

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

45.
By smax, 4 years ago, In English
[Tutorial] Fully Dynamic Trees Supporting Path/Subtree Aggregates and Lazy Path/Subtree Updates Hey everyone! Usually when I post stuff on CF I just drop an external link to my blog, but this time I would like to also paste the same content natively on CF to see if it leads to more engagement. You can read the exact same article on my blog [here](https://mzhang2021.github.io/cp-blog/ds5/). Also, special thanks to [user:alien_lover,2022-06-10] and [user:gabrielwu,2022-06-10] for proofreading. --- ## Motivation We will solve **[this problem](https://dmoj.ca/problem/ds5)**. ## Prologue The original name of this problem is [SONE1](https://darkbzoj.cc/problem/3153), originating from the fiery depths of Chinese OI. Amazingly, the Chinese have figured out how to augment the link/cut tree to solve this problem (ref [1](https://www.cnblogs.com/clrs97/p/4403244.html), [2](https://blog.csdn.net/iamzky/article/details/43494481)). Maintaining subtree aggregates with a LCT isn't difficult, and there's a well-known [Codeforces article](https://codeforces.me/blog/entry/67637) ...
I will use the same terminology used in the resources linked in the prerequisites section. Here is

Full text and comments »

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

46.
By Arpa, history, 10 years ago, In English
Graph saving methods Hi. ## Introduction. We have a graph, we want to save it (and maybe run DFS on it for example); simple? Yes, but I want to show different methods for this, you can choose any of them depending on problem. ### Adjacency matrix. Simple, if graph is not weighted, save in $G[v][u]$ if there is an edge between $v$ and $u$ or not. If graph is weighted, if there is an edge between $v$ and $u$ save it’s weight in $G[v][u]$, save $-1$ otherwise (if weight can be negative, use $inf$ instead of $-1$). Memory usage : $\mathcal{O}(n ^ 2)$.<br>Overall time complexity : $\mathcal{O}(n ^ 2)$ (for running dfs). <spoiler summary="Code here"> ~~~~~ // God & me #include <bits/stdc++.h> using namespace std; const int maxn = 1e3 + 17; int n, m; bool G[maxn][maxn], mark[maxn]; void dfs(int v){ if(mark[v]) return ; mark[v] = 1; for(int u = 0; u < n; u++) if(G[v][u]) dfs(u); } int main(){ ios::sync_with_stdio(0), cin.tie(0); cin >> n >> m; ...
### Linked list.

Full text and comments »

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

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

Full text and comments »

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

48.
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...
is a directed graph on $n$ vertices without any edges and a list of $m$ directed edges which we want

Full text and comments »

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

49.
By Errichto, 7 years ago, In English
And three streams this week Hi. Even more streams are coming. For notifications, subscribe to my secondary channel for streams [Errichto 2](https://www.youtube.com/errichto2), or you can watch me on [Twitch](https://www.twitch.tv/errichto). **Stream 1** &mdash; Monday [at 12:00 CEST](https://www.timeanddate.com/worldclock/fixedtime.html?iso=20190520T12&p1=262), I want to check out coding interview platforms like Leetcode. Here's [Youtube link](https://www.youtube.com/watch?v=1PhErzqrY6c). **Stream 2** &mdash; Tuesday [at 9:00 CEST](https://www.timeanddate.com/worldclock/fixedtime.html?iso=20190521T09&p1=262). Algo research and writing old editorials. Links to [part 1](https://www.youtube.com/watch?v=XWf9DCMnpFM) and [part 2](https://www.youtube.com/watch?v=5rW-t3KFLM0) (the stream stopped for a few seconds and the new one started). **Stream 3** &mdash; Friday [at 12:00 CEST](https://www.timeanddate.com/worldclock/fixedtime.html?iso=20190524T12&p1=262). Solving Codeforces problems, mainly around <s>div...
Leetcode. Here's [Youtube link](https://www.youtube.com/watch?v=1PhErzqrY6c). **Stream 2** &mdash, linked lists. (After an update, Linux stopped working on my PC, so no coding stream.) [Link](https

Full text and comments »

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

50.
By Zlobober, history, 11 years ago, translation, In English
Editorial for VK Cup 2015 — Finals Thanks everybody for participating. Tasks follow in the order of the original contest (the mirror order is given in the brackets). [problem:562A] -------------- (in mirror: [problem:566C]) Let's think about formal statement of the problem. We are given a tricky definition of a distance on the tre: $\rho(a, b) = dist(a, b)^{1.5}$. Each vertex has its weight $w_i$. We need to choose a place $x$ for a competition such that the sum of distances from all vertices of the tree with their weights is minimum possible: $f(x) = w_1 \rho(1, x) + w_2 \rho(x, 2) + \ldots + w_n \rho(x, n)$. Let's understand how function $f(x)$ works. Allow yourself to put point $x$ not only in vertices of the tree, but also in any point inside each edge by naturally expanding the distance definition (for example, the middle of the edge of length $4$ km is located $2$ km from both ends of this edge). **Fact 1**. For any path $x \in [a, b]$ in the tree the function $\rho(i, x)$ is convex. Actually, the ...
step servers. The list of replications may be kept in a "double-linked list" data structure, that

Full text and comments »

Tutorial of VK Cup 2015 - Finals
  • Vote: I like it
  • +100
  • Vote: I do not like it

51.
By malfple, history, 7 years ago, In English
CP Series *This is my first blog post and it's not a tutorial. Pls don't hit me.* CP Series ================== One beautiful day, I decided to draw a comic series related to competitive programming for my friends on a whim. It is mainly about dumb stuff that I remember happened during my competitive programming journey in college. On another beautiful day, I acquired the idea of making this post. ![ ](/predownloaded/07/51/0751036bdbf86eda40ab9b22fb02c32fca924fbf.png) ### Motivation Here are some reasons for why I decided to draw this. *I absolutely have to write this for self-justification and so that when I lose motivation, I can read this and regain my motivation, producing a never-ending loop.* 1. I like drawing. Actually, it's a love-hate relationship. 2. Initially, this is intended to be a joke, but somehow some of my friends are genuinely looking forward to it. They told me it's funny *smh*. So, I'll at least continue it until I run out of ideas. 3. *I want to be able...
Webtoon is probably good enough. Here's the link: [https://www.webtoons.com/en/challenge/cp, Here's the link: [https://www.webtoons.com/en/challenge/cp-series/list ?title_no=365151](https

Full text and comments »

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

52.
By djm03178, 2 years ago, In English
Blowing up unordered_map 2024 edition It is already well-known that using `unordered` series in Codeforces is super dangerous, and it is not recommended to use them at all unless you know how to prevent them properly (well, even if you know, just using a regular `map` or `set` is more beneficial in most cases). Thanks to [Blowing up unordered_map, and how to stop getting hacked on it](https://codeforces.me/blog/entry/62393), it is easy to access to the basics of hacking these hash-based structures. In this blog, I'm going to get into more details on how it works, and the ideas to hack them with various constraints on the variables. The basics ------------------ As mentioned in the linked blog, gcc implements its hash table simply by modding the key with certain primes, and these primes vary between different versions of gcc. So, basically the easiest way to make a hack case is to put numerous distinct multiples of these primes. However, an important thing to note is that it's a _list_ of primes instead of just one pr...
The basics ------------------ As mentioned in the linked blog, gcc implements its hash table

Full text and comments »

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

53.
By unreal.eugene, 5 years ago, In English
Polygon's New Feature: Resolving Conflicts (finally!) Hello Codeforces! I and [user:DK318,2021-07-09], as students of ITMO University, joined the Codeforces team in June. Last month we mainly dealt with the development of the Polygon platform and were focused on one significant feature lots of people dreamed of. Have you ever made some changes to the problem, and at the same time another person changed the same file? I believe most of you did and disliked this situation. If you wanted to resolve the conflict, you needed to download an archive containing all your changes and repeat them all in the newest revision of the problem. This was very confusing and time-consuming, wasn't it? And now we present probably the most anticipated feature of Polygon since its creation: **a web interface for resolving conflicts**. [cut]<br> When the conflict occurs, the link 'Resolve Conflicts' will appear on the sidebar accessing the page, where you can merge different versions. If it is impossible to load into the problem, the same button will...
When the conflict occurs, the link 'Resolve Conflicts' will appear on the sidebar accessing the

Full text and comments »

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

54.
By ODT, history, 9 years ago, In English
Codeforces Round #449 Editorial [897A &mdash; Scarborough Fair](http://codeforces.me/contest/897/problem/A) By [user:mcfx,2017-12-04] For every $i$ in range $[l,r]$, if $c_i$ is $c_1$ then change it into $c_2$... Because $n, m$ are all very small, $O( nm )$ can easily pass it. PS. You can use binary search tree to solve it in $O( m\log n )$ time. [897B &mdash; Chtholly's request](http://codeforces.me/contest/897/problem/B) By [user:mcfx,2017-12-04] The $k$-th smallest zcy number is $conn(str(k),rev(str(k)))$, where $str$ denotes the decimal representation of a positive integer as a string, $conn$ denotes the concatenation two strings, and $rev$ denotes the reverse of a string. Then go over the smallest $k$ such numbers and sum them up to obtain the answer. [896A &mdash; Nephren gives a riddle](http://codeforces.me/contest/896/problem/A) By [user:mcfx,2017-12-04] $f(n)=str_1+f(n-1)+str_2+f(n-1)+str_3$. First we can compute the length of $f(n)$ for all possible $n$. For a pair of $(n...
This can be maintained by using DSU or linked list., We get the value of each number in block $belong[l]$ and $belong[r]$ using the DSU orlinked list

Full text and comments »

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

55.
By hehezhou, history, 4 years ago, In English
Invitation to 4th Turing Cup Hey everyone, Here's an invitation for all programming lovers to participate in the 4th Turing Cup competition! The Turing Cup is an invitational competition that is organized by one of the most successful informatics competition teams in China, the XinYouDui, and X-Camp. Several top students of XinYouDui: [Chao Li](https://stats.ioinformatics.org/people/2672) (IOI 2012 Gold Medalist);[Yinzhan Xu](http://stats.ioinformatics.org/people/5059) (IOI 2014 Individual 1st place winner);[Ce Jin](https://stats.ioinformatics.org/people/5872) (IOI 2016 Individual 1st place winner): Top contestants such as IOI Gold medalists, and other top CPers joined the past contest as well. The 4th Turing Fun cup is open for registration, come and code with us! [Registration link](https://contest.xinyoudui.com/22a) (No Registration Fee) Novice Group: We'd recommend programmers who have completed learning the language and basic algorithms and who are in USACO silver division, are eligible ...
contest? **A:** Click the link below to check the [rank list ](https://ranklist.turingstar.com.cn, **A:** Click the link below to check the [rank list ](https://ranklist.turingstar.com.cn/22a), you

Full text and comments »

Announcement of The 4th Turing Cup
  • Vote: I like it
  • +129
  • Vote: I do not like it

56.
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, ) * [DP playlist(Arabic)](https://www.youtube.com/playlist?list =PLPt2dINI2MIattDutu7IOAMlUuLeN8k2p

Full text and comments »

57.
By Spheniscine, history, 5 years ago, In English
Unofficial AtCoder Beginner Contest 237 Editorial ### [A &ndash; Not Overflow](https://atcoder.jp/contests/abc237/tasks/abc237_a) <spoiler> Note that $N$ has to be read as a signed 64-bit integer type. You could check it by either doing to comparison manually, or casting back and forth between the signed 32-bit integer type. Time complexity: $O(1)$ </spoiler> ### [B &ndash; Matrix Transposition](https://atcoder.jp/contests/abc237/tasks/abc237_b) <spoiler> Simply construct a $W$-by-$H$ matrix, assign $B_{i, j} = A_{j, i}$ for all relevant $i, j$, then output it. Alternatively, if you use Python, the `numpy` library installed in AtCoder gives a really short implementation, as noted in this user editorial: https://atcoder.jp/contests/abc237/editorial/3344 Time complexity: $O(HW)$ </spoiler> ### [C &ndash; kasaka](https://atcoder.jp/contests/abc237/tasks/abc237_c) <spoiler> Note that for a string to be a palindrome, it must start with the same number of contiguous `a`s as it ends with. If there are less con...
There are at least two methods that could be used, a straightforward method withlinked, One could make a simple linked list using two arrays, $pr$ "previous" and $nx$ "next", where $pr[i, Straightforward method with linked list:

Full text and comments »

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

58.
By AkiLotus, history, 2 years ago, In English
Codeforces Round 983 (Div. 2) Editorial <spoiler summary="README: Notice about solutions"> All editorial codes contain solutions wrapped in classes. I'll only paste the important part (`namespace solution` in C++, `class Solution` in Python 3) as plaintext in the solution code section (along with the corresponding AC submission link). You might want to see the code template here. <spoiler summary="C++ template"> ```cpp #include <bits/stdc++.h> using namespace std; namespace solution { bool hasMultipleTests = true; void preprocess() { // something } void input(int testcase) { // something } void solve(int testcase) { // something } } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); solution::preprocess(); int t = 1; if (solution::hasMultipleTests) cin >> t; for (int testcase=1; testcase<=t; testcase++) { solution::input(testcase); solution::solve(testcase); } return 0...
```cpp namespace datastruct { // A doubly-linked list that, namespace datastruct { // A doubly-linked list that only supports modify and (pseudo) deletion at

Full text and comments »

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

59.
By Dominater069, 22 months ago, In English
ICPC India Amritapuri 2024 Stream, Problems and Editorial Hi everyone, The second Indian ICPC Amritapuri onsite regional round will be held tomorrow in Bengaluru, Coimbatore and Kollam. We plan to host a stream covering the round. The stream links will be posted shortly. The problems will be posted in this blog when the contest starts. The editorial will be posted after the contest ends. Hope you enjoy the contest! Contest Details - Public ranklist Link — [ICPC Amrita Website](https://amritaicpc.in/final-rank-list) - Date & Time — [29 December 2024, Sunday, 9:00 IST](https://www.timeanddate.com/worldclock/fixedtime.html?day=29&month=12&year=2024&hour=9&min=00&sec=0&p1=1799) (Tentative start time) - Duration — 5 Hours - There will be 8 to 20 problems to solve - Problem statements : NA - Will follow standard ICPC scoring system (20 minutes penalty and 1 point per problem) - The questions may not be sorted by difficulty - Stream link &mdash; [Codechef Chann...
- Public ranklist Link — [ICPC Amrita Website](https://amritaicpc.in/final-rank-list, - Public ranklist Link — [ICPC Amrita Website](https://amritaicpc.in/final-rank- list) - Date

Full text and comments »

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

60.
By RezwanArefin01, 8 years ago, In English
Checklist for OI Problems (WebApp) Hello Everyone, I guess everyone who is preparing for OI already know about this [Checklist for OI Problems](https://codeforces.me/blog/entry/59422) prepared by [user:ko_osaga,2018-11-01]. I've been using this for quite a long time, and it is really helpful! But since the checklist gets updated from time to time, I found it hard to migrate from the previous checklist to new checklist. So, I made the following web app for the same purpose! Now you don't need to worry about migrating, I can just add the problems to database and it'll update automatically! Link: [OI Checklist](https://oichecklist.pythonanywhere.com) Please find the features and changes to the main checklist bellow: Features and Changes ------------------ 1. First of all, now the checklist contains direct link to each problem, while the main checklist had link to some parent of the link. And clicking on a contest name will lead to the official "Task" page of that contest, which generally contains jud...
cses.fi (previously https://cses.fi/boi/list/ was linked with each of the BOI problems), same goes, in cses.fi (previously https://cses.fi/boi/list/ was linked with each of the BOI problems), same

Full text and comments »

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

61.
By physics0523, history, 4 years ago, In English
Strange Comparison: vector&lt;vector&lt;int&gt;&gt; vs vector&lt;pair&lt;int,int&gt;&gt; ? If we want to use a 2D dynamic array, some C++ user writes following 2D vector: ``` vector<vector<int>> a(n); // add y to a[x] a[x].push_back(y); // walkthrough a[x] for(auto &nx : a[x]){ cout << nx << "\n"; } ``` But we can do the equivalent thing with handwritten linked list (when we know the total size) by using 1D vector<pair<int,int>>: ``` pair<int,int> empty={-1,-1}; vector<pair<int,int>> b(n+total_size,empty); int add_point=n; // add y to b[x] if(b[x]!=empty){ b[add_point]=b[x]; b[x].second=add_point; add_point++; } b[x].first=y; // walkthrough b[x] int current=x; while(current!=empty.second && b[currnt]!=empty){ cout << b[current].first << "\n"; current=b[current].second; } ``` So, what's the benefit for the later implementation? The merit is the generation time of later one is very fast. vector size = $10^5$, Total elements = $10^6$ (this means we need `vector<vector<int>>(1e5)` and the sum of the size of $10^5$ vect...
But we can do the equivalent thing with handwritten linked list (when we know the total size) by, ]){ cout << nx << "\n"; } ``` But we can do the equivalent thing with handwrittenlinked list

Full text and comments »

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

62.
By Cirno_9baka, 5 years ago, In English
Codeforces Round #732 Editorial [tutorial:1546A] <spoiler summary="solution"> ~~~~~ #include<bits/stdc++.h> using namespace std; #define O(x) cout<<#x<<" "<<(x)<<"\n" inline int read(){ int x=0,f=1,c=getchar(); while(!isdigit(c)){if(c=='-')f=-1;c=getchar();} while(isdigit(c)){x=(x<<1)+(x<<3)+(c^48);c=getchar();} return f==1?x:-x; } const int N=104; int n,sum,a[N]; vector<pair<int,int> >ans; inline void solve(){ n=read(); sum=0; ans.clear(); for(int i=1;i<=n;i++)a[i]=read(); for(int i=1;i<=n;i++){ a[i]-=read(); sum+=a[i]; } if(sum){puts("-1");return;} for(int i=1;i<=n;i++){ for(int j=1;j<=a[i];j++){ for(int k=1;k<=n;k++)if(a[k]<0){ ans.push_back(make_pair(i,k)); ++a[k]; break; } } } cout<<ans.size()<<"\n"; for(auto v:ans)cout<<v.first<<" "<<v.second<<"\n"; } int main(){ for(int T=read();T--;)solve(); return 0; } ~~~~~ </spoiler> Idea: [user:Cirno_9baka,2021-07-11] [tutorial:1546B] <spoiler summary="solution"> ~~~~~ #includ...
// TODO: replace with linked list

Full text and comments »

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

63.
By Zlobober, 12 years ago, translation, In English
Codeforces Round #296 Editorial [problem:527A] ============== It’s easy to see that described process is equivalent to the following loop: ~~~~~ while a > 0 and b > 0: if a ⩾ b: a = a - b else: b = b - a ans = ans + 1 ~~~~~ But such naive approach will obviously lead to verdict TLE, since it makes ~$10,2015-03-19^{12}$ operations even on the third sample test. The key idea is to replace repeating subtraction operations with integer division operations. This leads to the logarithmic-time solution that looks similar to the Euclid algorithm: ~~~~~ while a > 0 and b > 0: if a ⩾ b: ans = ans + a div b a = a mod b else: ans = ans + b div a b = b mod a ~~~~~ [problem:527B] ============== The first observation is that the new Hamming distance may not be less than the old one minus two, since we change only two characters. So the task is to actually determine, if we can attain decrease by two, one or can’t attain decrease ...
double-linked lists and track the current maximum (that can only increase and become equal to the

Full text and comments »

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

64.
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 ...
) 2023; - Send me a link to your blog post as a direct message on CodeForces before February 15th

Full text and comments »

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

65.
By marat.snowbear, 12 years ago, In English
Codeforces Round #269 Editorial [problem:471A] ------------------ Given six sticks and their lengths we need to decide whether we can make an elephant or a bear using those sticks. The only common requirement for both animals is that four leg-sticks should have same length. This means that the answer "Alien" should be given **only** if we can't find four sticks for the legs. Otherwise we will be able to make some animal. The type of the animal will depend on the relation of the remaining sticks' lengths. If they are equal then it will an elephant, if they are different we will have a bear. So this algorithm should solve the problem: 1. Find the number which appears at least four times in the input. 2. If no such number exist then the answer is "Alien". 3. Otherwise remove four entries of that number from the input. 4. After removing that number you will have two numbers left, compare them and decide whether it's an elephant or a bear. One shortcut for this problem might be to sort the in...
code because originally I thought it would be a linked list with some way to manipulate it quickly

Full text and comments »

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

66.
By merlin_, 4 years ago, In English
List of ICPC India Contests <s>ICPC India 2021-22 is knocking at the door.</s> So, inspired by similar blogs on Codeforces for [Open Cup](https://codeforces.me/blog/entry/84466), [Petrozavodsk Camp](https://codeforces.me/blog/entry/84489), and [USACO](https://codeforces.me/blog/entry/95032), and also due to the fact [ICPC Live Archive](https://icpcarchive.ecs.baylor.edu/) collapsed, I decided to list down all ICPC contests of India I could find. Please note that this blog contains only the materials and links I could find. I hope this is of some help to you guys. For the Github repository regarding the same, see [here](https://github.com/m-e-r-l-i-n/icpc-india). ### ICPC 2022-23 | Contest | Upsolving | Materials | |-|-|-| |[Mathura Kanpur Preliminary Round](https://icpc.global/regionals/finder/Preliminary-Round-2023)| [CodeDrills](https://codedrills.io/contests/icpc-kanpur-mathura-2022-qualifier-round)| Discuss:[1](https://codeforces.me/blog/entry/114039),[2](https://codeforces.me/blog/entry/1129...
List of ICPC India Contests, Live Archive](https://icpcarchive.ecs.baylor.edu/) collapsed, I decided to list down all ICPC, [here](https://www.codechef.com/icpc/2019). The discussion blog linked in Gwalior-Pune regional, Concluding notes: * This isn't an ultimate list, a lot of data is still

Full text and comments »

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

67.
By orz, history, 3 years ago, translation, In English
The XXXI Saint-Petersburg High School Programming Contest (SpbKOSHP 2023) The [XXXI Saint-Petersburg High School Programming Contest](https://neerc.ifmo.ru/school/archive/2023-2024/ru-olymp-team-spb-2023-standings.html) took place on 4 November 2023 in ITMO University. It is a regional qualification for the [XXIV Russia Open High School Programming Contest](https://neerc.ifmo.ru/school/russia-team/index.html) which will be held on 11–12 December 2023 in person. The problems were prepared by a committee headed by [user:andrewzta,2023-11-06]: [user:ba.tasya,2023-11-06], [user:Niko,2023-11-06], [user:Thinkbuge,2023-11-06], [user:Volkov_Ivan,2023-11-06], [user:golikovnik,2023-11-06], [user:orz,2023-11-06], [user:DishonoredRighteous,2023-11-06], [user:Volodya333,2023-11-06], [user:polipolinom,2023-11-06], [user:GShark,2023-11-06], [user:VArtem,2023-11-06], [user:peltorator,2023-11-06], [user:doreshnikov,2023-11-06], [user:Toy_Mouse,2023-11-06], [user:step_by_step,2023-11-06] and [user:fedor.tsarev,2023-11-06]. There were several qualifications for XXIV Open VK...
There were several qualifications for XXIV Open VKOSHP based on this problemset. Below is thelist

Full text and comments »

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

68.
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...
help and support. Here's a list of the main improvements to Polygon that we've made (sometimes with, when adding a valid solution via the API. - An 'Edit' link has been added while viewing the file

Full text and comments »

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

69.
By MofK, history, 3 years ago, In English
Codeforces Global Round 25 Editorial Hi, we hope you enjoyed our problems! For the playlist of songs used in the problem statements, click [this link](https://www.youtube.com/playlist?list=PLTVdHvnX6LZhAJre49E7M7tpGA30WlBM3). [problem:1951A] Author: [user:MofK,2024-04-06] <br> Prepared by [user:Kuroni,2024-04-06] <br> First solve: [user:xiachong,2024-04-06] at 00:01 <spoiler summary="Tutorial and Implementation"> [tutorial:1951A] [submission:255371605] </spoiler> <spoiler summary="Rate this problem"> Yay Meh Nay Banger song </spoiler> [problem:1951B] Author: [user:MofK,2024-04-06] <br> Prepared by [user:Kuroni,2024-04-06] <br> First solve: [user:pavement,2024-04-06] at 00:05 <spoiler summary="Hint 1"> What is the condition for your cow to win her first match? </spoiler> <spoiler summary="Hint 2"> If your cow is not already winning her first match, there are at most two candidate positions you can swap her to. </spoiler> <s...
, click [this link](https://www.youtube.com/playlist?list =PLTVdHvnX6LZhAJre49E7M7tpGA30WlBM3).

Full text and comments »

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

70.
By kartik8800, history, 3 years ago, In English
Introduction to Disjoint Set Data Structure | DSU # Introduction to Disjoint Set Data Strucutres Hello Codeforces! I recently read about Disjoint Sets from the book Introduction to Algorithms and wanted to share the learnings in a simplified manner. So below article(and corresponding videos) is an attempt to create a good starting point for people who: 1. want to learn about DSU 2. practice some good DSU problems ## Contents 1. Introduction through an illustrative problem (video version: https://youtu.be/JDycPHW4kIs?si=WEp5Ft2jBWp9KnO2) 2. Sample SPOJ Problem and Implementation (video version: https://youtu.be/O4w-aX5mSks?si=vr0XSbyUswcXx-Yv) 3. Upcoming Practice Problems 4. Some Applications and References We will learn about disjoint set data structures and their operations union and find through a sample problem. ## Illustrative Problem Q: Given a undirected $Graph(V, E)$, answer Q queries of the form $(u, v)$ where answer to the query is True if there is a path from u to v, false otherwise. ![image](ht...
worst case(we may end up getting a link list), ### Disjoint Set — Linked List Implementation, #### Complexity Analysis for link list implementation, #### Weighted Union Heuristic for link list Implementation, 1. Each set is represented as a link list. 2. The set has HEAD pointer to representative element

Full text and comments »

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

71.
By cerealguy, 9 years ago, In English
MemSQL Start[c]UP 3.0 Round 2 Hello everyone! The second round of MemSQL Start[c]UP 3.0 will take place this Saturday, September 30, at [10:05am US/Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=MemSQL+Start%5Bc%5DUP+Round+2&iso=20170930T1005&p1=224&ah=3). There will be an onsite round at [MemSQL HQ](https://www.google.com/maps/place/MemSQL/@37.7787481,-122.3998668,17z/data=!4m13!1m7!3m6!1s0x808f7fd5882a8259:0x403893ed6e8a2456!2s534+4th+St,+San+Francisco,+CA+94107!3b1!8m2!3d37.7787439!4d-122.3976728!3m4!1s0x808580795c705e15:0xf0ede2d3d47374b8!8m2!3d37.7789555!4d-122.3976042) and parallel online rounds that will be open for div1 and div2 participants. The online finalists (placed in top 500 in Round 1) will be given 100 MemSQL Start[c]UP T-shirts. The onsite contestants will be participating from MemSQL HQ using their personal laptops. Breakfast will be served starting at 8:30 am, contest starts at 10:05 am and lunch will be served after the contest. The three winners of the onsite round...
UPD4: You will be able to see results of offsite finalists using [this link ](/contest/866/standings

Full text and comments »

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

72.
By kuviman, history, 11 years ago, translation, In English
Codeforces Updates (April-May, 2015) Hello! Codeforces never sleeps, and I am going to tell you about our recent updates which weren't announced yet. ### Testlib - testlib moved to [GitHub](https://github.com/mikemirzayanov/testlib), and the version 0.9.9 with C++11 support has been released. ### Polygon - Added basic support for test groups. Now you can specify group for each test, run invocations by test groups, and you can view summary for each group on the invocation page. If group is specified for a test, it will be added to the problem descriptor (i. e. `<test cmd="gen 1 2" group="testGroup" method="generated"/>`). - You can now view problem statements and validator for a problem/contest on the same page. This makes finding mistakes in translations and in validator much easier (before you had to open them on separate tabs and switch between them, which is not comfortable). On the problem statements page the "Review" link has been added: <br/> ![ ](http://codeforces.me/predownloaded/22/8b/228bf6f506072...
the "Review" link has been added: ![ ](http://codeforces.me/predownloaded/22/8b, link generated which you can use to insert it into the text: ![ ](http://codeforces.com

Full text and comments »

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

73.
By Errichto, 4 years ago, In English
List of Coaches (IOI and ICPC Camps) When some country organizes an ICPC or IOI preparation camp, they often need a teacher from abroad. When they ask me, I usually decline because of a lack of time. I want to be able to link this blog so they would find a good teacher. If you teach and want to be reached by camp organizers, leave a comment and say something about your experience. <spoiler summary="More info about such camps"> Here's how it usually works. Organizers always pay for your flights and accommodation. They also might provide food and salary (1000-2500 USD per week). There are 8-30 students and they don't pay for anything. You are supposed to conduct 5-hour contests and maybe do a few lectures. It's ok to reuse old problems instead of creating new ones (though it might be nice for a particular lecture). I usually cover IOI finals and Polish contests. And CSES is good for beginners. If there are very few students, you can work more 1-to-1 with them and help with codes and upsolving. That's n...
List of Coaches (IOI and ICPC Camps), . When they ask me, I usually decline because of a lack of time. I want to be able tolink this

Full text and comments »

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

74.
By Qingyu, history, 5 years ago, In English
A complete list of opentrains contests The opentrains provides a series of high-quality ICPC training contests. However, its contest list is not complete(then it is difficult in finding some contests), and we cannot know if the contest has an editorial until we finish it. Therefore I made a [list](https://qingyu.us/opentrains.html) containing almost all of the contest materials, including contest id, statements, solutions and editorials. I don't know whether these materials can be made public (may affect their training value), so I only provided their corresponding links in opentrains in the table. The link for Statements, Solutions and Editorials is in the format of `http://opentrains.snarknews.info/~ejudge/index.cgi?solarc2=CONTEST_ID&sid=SESSION_ID`. You can save the entire page and replace the field `SID_HERE` in the page with yours. Your SESSION_ID can be obtained from the URL that you jumped to after logging in at http://opentrains.snarknews.info. For most of the Open Cup and Petrozavodsk contests, you can find...
A complete list of opentrains contests, For most of the Open Cup and Petrozavodsk contests, you can find the upsolve link in [user:zimpha, The link for Statements, Solutions and Editorials is in the format of `http, The opentrains provides a series of high-quality ICPC training contests. However, its contestlist

Full text and comments »

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

75.
By purplesyringa, history, 5 years ago, translation, In English
Let's face it, Polygon is horrible ![image](https://i.ibb.co/rs7PwmM/7Cu9Z.jpg) Polygon is not world's greatest evil. Polygon doesn't even have a particular defect that makes it horrible. You can't say what's exactly wrong with Polygon. Polygon seems to work, it seems like every feature is supported, but if you touch it here it will fall apart, and if you touch it there a problem (pun not intended) will appear. Or not, depending on your luck. Polygon is like PHP. For those who haven't read the famous rant, I'll cite it for you: > I can't even say what's wrong with PHP, because-- okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in there. > > You pull out a screwdriver, and you see it's one of those weird tri-headed things. Okay, well, that's not very useful to you, but you guess it comes in handy sometimes. > > You pull out the hammer, but to your dismay, it has the claw part on both sides. Still serviceable though, I mean, you can hit nails with the middle of the head holding it...
described in the list of packages when you hover over the link to the generated package, and thislist is

Full text and comments »

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

76.
By MohamedAboOkail, 6 years ago, In English
Codeforces Extensions Hello everyone! I have collected some codeforces extensions that were created by users. <ul> <li>CF-Predictor — Know your rating changes <a href = "https://codeforces.me/blog/entry/50411">Blog Link</a></li> <li>Codeforces Practice Tracker — Browser Extension <a href = "https://codeforces.me/blog/entry/78203">Blog Link</a></li> <li>Presenting Codeforces Optimal Theme <a href = "https://codeforces.me/blog/entry/82680">Blog Link</a></li> <li>UpSolve.me | Efficient Codeforces Practice <a href = "https://codeforces.me/blog/entry/79151">Blog Link</a></li> <li>Colorize standings by used programming language <a href = "https://codeforces.me/blog/entry/1871">Blog Link</a></li> <li>[UPD: 22 July 2020 -- v.1.2] Codeforces Enhancer — Chrome Extension <a href = "https://codeforces.me/blog/entry/18850">Blog Link</a></li> <li>Multiple rating graph with other accounts <a href = "https://codeforces.me/blog/entry/1743">Blog Link</a></li> <li>Google Chrome extension for autom...
Extension Blog Link <https://codeforces.me/blog/entry/73196> * An awesome list, Blog Link <https://codeforces.me/blog/entry/73196> * An awesome list for

Full text and comments »

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

77.
By kartik8800, history, 6 years ago, In English
A course on Dynamic Programming Hello Codeforces! This blog is here to compile the resources that I have created over the past 6 months. I had started with the goal of creating a useful course on algorithms and problem solving, overall I wanted to provide high quality material which is free. So I started with the most interesting topic(for me) dynamic programming and developed an extensive course on the same. ![thumbnail collage](https://i.ibb.co/tD3TWxH/dpcourse.jpg) I feel the course is extremely useful for beginners as well as intermediates to get better at dp, learn some useful techniques and improve their problem solving skills. From the limited reviews that I have received on the content till now I can say that people have found my the content useful and explanations better than many paid courses which people usually opt-for. I wanted to share the overview of the course here so it can reach more people. Overview ======== <strong>Basics of DP: </strong> ------------------------------ I s...
Link to the playlist: [DIGIT DP](https://www.youtube.com/playlist?list, ](https://www.youtube.com/playlist?list=PLb3g_Z8nEv1h1w6MI8vNMuL_wrI0FtqE7) DP on Trees

Full text and comments »

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

78.
By romanandreev, 11 years ago, In English
Codeforces Round #345: editorial [problem:651A] ------------------ Idea author: [user:fcspartakm,2016-03-09], preparation: [user:fcspartakm,2016-03-09]. Main idea is that each second we need to charge the joystick with lowest power level. We can just emulate it or get an $O(1)$ formula, because process is very simple. [problem:651B] ------------------ Idea author: [user:fcspartakm,2016-03-09], preparation: [user:fcspartakm,2016-03-09]. Lets look at the optimal answer. It will contain several segment of increasing beauty and between them there will be drops in the beautifulness. Solution is greedy. Lets sort all paintings and lets select which of them will be in the first increasing segment. We just go from left to right and select only one painting from each group of several paintings with the fixed beauty value. We continue this operation while there is at least one painting left. With the careful implementation we will get $O(n \log n)$ solution. But this solution gives us the whole sequence, but...
Overall algorithm: we store linked lists of edges in vertices, when edge is in both trees we use

Full text and comments »

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

79.
By avighnakc, history, 14 months ago, In English
OI Checklist: update blog (tons of new features), call for suggestions # OI Checklist – Two Weeks of New Features! It’s been about two weeks since I first announced [OI Checklist](https://checklist.spoi.org.in) in [this blog post](https://codeforces.me/blog/entry/145434). The blog was very well received, and I’d like to thank you all for that! In fact, since launch OI Checklist has already grown to 2,261 problems across 18 olympiads and is being used by 214 users. (If you haven’t tried it yet, you can check out the [demo mode](https://checklist.spoi.org.in/demo) to see how it works without signing up.) Over these two weeks, I’ve been working on OI Checklist and added a lot of new features: some functional, some UI/UX improvements, and some smaller tweaks. Here’s a summary of the most important ones: --- ## qoj.ac Sync — Fully Supported ### Full Checklist That’s right! You can now sync with **both oj.uz and qoj.ac**. | ![ ](https://i.snipboard.io/qCMag3.jpg) | ![ ](https://i.snipboard.io/P7N0uT.jpg) | |-------------------------------...
for problem links. The list is checked **top to bottom**, and the first matching source provides the

Full text and comments »

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

80.
By bfsof123, 20 months ago, In English
Learning Notes on the Hopcroft-Tarjan planarity algorithm (With C++ Implementation) **Section 1. Introduction** I have been struggling for weeks to understand the first linear-time planarity algorithm, the [Hopcroft-Tarjan algorithm (HT)](https://www.cs.princeton.edu/courses/archive/fall05/cos528/handouts/Efficient%20Planarity.pdf). Fortunately, I successfully understood it and implemented it. In fact it is very hard to find a verified HT implementation online. Some code, e.g., [LEDA](https://en.wikipedia.org/wiki/Library_of_Efficient_Data_types_and_Algorithms) is not open source. Other open-source planarity tests, e.g., [networkx (LR planarity)](https://github.com/networkx/networkx/blob/main/networkx/algorithms/planarity.py), [boost (Boyer-Myrvold)](https://www.boost.org/doc/libs/1_53_0/libs/graph/doc/boyer_myrvold.html), [Pigale (LR planarity)](https://pigale.sourceforge.net/), use other algorithms. There is [an implementation by Shawn Anderson](https://github.com/shawnwanderson/Hopcroft-Tarjan-Planarity-Testing), however it is partial. I would like to open a blo...
of the same data structure)`. Well, that is **a deque implemented using a singlelinked list**! We

Full text and comments »

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

81.
By Ra16bit, history, 23 months ago, In English
Yandex Cup 2024 Algorithm Finalists [Yandex Cup 2024](https://codeforces.me/blog/entry/134927) onsite finals is happening today in Tashkent, Uzbekistan. Live streams of the event can be found [here](https://yandex.com/cup/2024/#streaming). As there was no official post about Algorithm finals, I've collected the list of finalists here. Interactive version of it is available at the **Competitive Programming Hall of Fame** website: [link](https://cphof.org/advanced/ya_algo/2024). | Yandex Handle | CF Handle | CF Rating | Country | Yandex Finals Before | Best Place | |---------------|--------------|---------|-----------|-----|-----| | [hos.lyric](https://cphof.org/profile/yandex:hos.lyric) | [user:hos.lyric,2024-12-03] | 3349 | Japan | 2 | 2nd place (2014, 2023) | | [yahordubovik](https://cphof.org/profile/yandex:yahordubovik) | [user:244mhq,2024-12-03] | 3108 | Belarus | 1 | 6th place (2023) | | [Fedor Romashov](https://cphof.org/profile/yandex:Fedor%20Romashov) | [user:Ormlis,2024-12-03] | 3088 | Russia...
As there was no official post about Algorithm finals, I've collected the list of finalists here

Full text and comments »

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

82.
By chen_zhe, history, 2 years ago, In English
A very brief introduction to Olympiad in Informatics in mainland China This article relies on ChatGPT-4 for translation. China has been hosting the National Olympiad in Informatics (NOI) since 1984. Over the past forty years, it has developed a unique system. I intend to provide a brief introduction to this system for everyone. In mainland China, about 100,000 people prepare for informatics competitions each year. The first step in these competitions is to participate in the CCF Certified Software Professional Junior/Senior (CSP-J/S). CSP-J is for contestants aged 8-14, while CSP-S is for contestants aged 10-18. CSP-J/S is divided into two stages. The first stage tests general and practical computer science knowledge, such as base conversion, principles of linked lists, and reading programs to answer questions. About 40,000 to 50,000 people pass the first stage of CSP-J/S. The second stage of CSP-J/S focuses on programming. The CSP-J second stage exam lasts 3.5 hours, while the CSP-S second stage exam lasts 4 hours, each with 4 problems. Approxi...
knowledge, such as base conversion, principles of linked lists, and reading programs to answer

Full text and comments »

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

83.
By darkkcyan, history, 6 years ago, In English
[Not tutorial] Sort before insert — A small extension to Merge sort tree Hello Codeforces! This is my first ever blog on Codeforces, and today I wanted to <s>gain contributions</s> share my small invention during my upsolving. I don't know if there existed a similar idea yet, but as far as I can tell, the editorial for the problem that I have solved does not use my idea. I think it would be nice to share with you guys and have your opinions on this idea. <h1>Prerequisite</h1> You should understand what is a segment and what is a merge-sort tree first. All the code in this blog is in <a href="https://codeforces.me/blog/entry/18051">efficient style</a>, therefore you should at least recognize part of it before reading the code. <h1>Idea explanation</h1> <h2>How do we build Merge-sort tree again?</h2> Merge sort tree is a Segment tree, each node of which contains a sorted set/vector of every element in its range. We build it in a bottom-up manner. To build the parent nodes, we merge 2 sets/vectors of the children the same as we do in the merge-...
elements or querying lower/upper bound. Because we have the sorted order, let's create alinked list

Full text and comments »

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

84.
By TimDee, history, 4 months ago, In English
Goodbye, Codeforces 2 [and list of my problems?] Inspired by [this blogpost](https://codeforces.me/blog/entry/155346) I haven't participated in a codeforces contest for more than a year with a half, and don't think that'll change in near future for blah blah blah whatever reason, I feel the same as author of the linked above blogpost, adding from myself maybe only the feeling that competitive programming is not that fun once you don't have any IOIs ahead and can be paid for time spent working, not practicing :D For anyone interested, I'm adding the list of my problems to ever appear at Olympiads so far. Few more words here, even though being High-Effort/Low-Reward, I'm happy for taking (at least few steps on) the path of problemsetting regional/international competitions/olympiads, and would genuinely recommend it to those who finish their high school, but were OI enthusiasts. In the order of my preference (or whichever I recalled earlier lol), not chronologically: - [Gugustiuc (guess the permutation)](https://qoj.ac/con...
Goodbye, Codeforces 2 [and list of my problems?], for blah blah blah whatever reason, I feel the same as author of the linked above blogpost, adding, linked above blogpost, adding from myself maybe only the feeling that competitive programming is not

Full text and comments »

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

85.
By Down_bad_4_haiender288, 2 years ago, In English
[Discussion]: IOI 2024 Local terminal IOI addict/enthusiast here. Last year, a grand total of 0 discussion blogs for the IOI appeared, and around 0 discussions on the tasks were made (despite possibly the most (comparatively) interesting problemset since....2016/2018 or something). For this year, I'd like to take matters into my own hands and open this blog. Dump things here. Predictions. Links for live scoreboards. Writeup for tasks the way it have been for 20217/2019/2021 or something. Problemsetters coming out (not like that, I mean, the way [user:Pajaraja,2024-09-01] did in 2021 (for Fountain Parks) or [user:E869120,2024-09-01] (for Prisoner Challenge)......or the at least 15 times people have done that. Still think that the lack of discussion of IOI2023 tasks was really sad &mdash; actually had to resort to shitty translated Luogu blogs for that. Contest Schedule & Important Links: ================== (Time in GMT+3 (Egypt local time), convert that to your local timezone, dummy!) (A mor...
team. (more to add in later on. Delegation leaders, chug the link of your country's photos and, . You can rest now. The list of links ends here ==================

Full text and comments »

86.
By aropan, 15 years ago, translation, In English
Contests list http://clist.x10.mx <br /><p><span lang="en"><span>translate.google.com:<br /></span></span></p><p><span lang="en"><span>I am glad</span> <span>to present you</span> <span>automatically</span> <span>updated</span> <span>(every hour</span><span>) a list of</span> <span>events</span> <span>with</span> <span>different resources <a href="http://clist.x10.mx">clist.x10.mx</a>.</span> <span>Look</span><span>, criticize</span><span>,</span> <a href="http://feedback.clist.x10.mx/"><span>offer</span> </a><span>....</span> <span>and</span> <span>use</span><span>)</span><br />[cut]<br /><span><b><br /></b></span></span></p><p><b>UPD</b>.<br /></p>Added <a href="http://opencup.ru">opencup.ru</a> <span lang="en"><span>resource</span>.<br /><div><br /></div><div><span style="font-family: verdana , arial , sans-serif;font-size: 12.0px;line-height: 20.0px;background-color: rgb(255,255,255);"><div style="margin-top: 0.0px;margin-right: 0.0px;margin-bottom: 0.0px;margin-left: 0.0px;padding-top: 0.0px;padding-right: 0.0px;p...
Contests list http://clist.x10.mx, ://clist.x10.mx/calendar (http://clist.x10.mx/list <http://clist.x10.mx/<B>list</B>>) , >(every hour) a list of events with different

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

87.
By sharabhagrawal25, history, 6 years ago, In English
Graph Theory COPS Youtube Channel [HINDI + ENGLISH] Hello, Codeforces community The Club of Programmers, IIT BHU is excited to announce the launch of Graph Theory playlist of COPS YouTube channel. The playlist contains some basic and intermediate concepts of graph theory. The videos and the corresponding document not only provide explanation to the concept but also provide a proper roadmap on how to study these concepts along with the practice problems. **The videos are in a mix of Hindi and English.** Graph Theory Playlist link : [https://www.youtube.com/playlist?list=PLLt4yMoVgczV8N1LTzA6eXoWlXU9MTQv7](https://www.youtube.com/playlist?list=PLLt4yMoVgczV8N1LTzA6eXoWlXU9MTQv7) Following topics are covered in the playlist: - [Basic graph theory (Terminologies, dfs and bfs)](https://www.youtube.com/watch?v=egUxXxnASDU&list=PLLt4yMoVgczV8N1LTzA6eXoWlXU9MTQv7&index=1) - [Dijkstra algorithm: Single source shortest path algorithm](https://www.youtube.com/watch?v=3lap9xe7RSQ&list=PLLt4yMoVgczV8N1LTzA6eXoWlXU9MTQv7&index=3&...
practice problems. **The videos are in a mix of Hindi and English.** Graph Theory Playlistlink, Graph Theory Playlist link : [https://www.youtube.com/playlist?list

Full text and comments »

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

88.
By MikeMirzayanov, 8 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...
division will be included in the official standings table. As it is written by link, this is a

Full text and comments »

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

89.
By fatalerror, history, 15 months ago, In English
Python Optimization Tricks in Competitive Programming > For better reading experience in Chinese, please refer to: [LeetCode](https://leetcode.cn/discuss/post/3746464). # Preface This article introduces techniques to reduce runtime in competitive programming using Python, under the premise that the complexity remains **correct** and **unchanged**. Each technique is accompanied by a Speedup on CPython 3.11.5 / PyPy 3.10.13. # I/O ### Use fast input Replace the built-in `input` with `sys.stdin.readline`. Each `input()` call incurs prompt handling and a `sys.stdin` lookup, while `readline()` reads a line directly. The more input lines, the larger the gap. Speedup: CPython ~×4.2; PyPy ~×16.4. ~~~~~ import sys input = lambda: sys.stdin.readline().rstrip() # strip the trailing newline II = lambda: int(input()) LII = lambda: list(map(int, input().split())) ~~~~~ ### Read all input at once Use `sys.stdin.read().split()` to read everything into memory once, then consume as needed. This avoids calling the read fun...
a hash table plus a doubly linked list (LRU), which is costly; a handwritten array can be indexed, parameters into a tuple, hashes them, and stores results in a hash table plus a doublylinked list (LRU

Full text and comments »

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

90.
By YouKn0wWho, 5 years ago, In English
Editorial of Codeforces Round #735 (Div. 2) The problem names are based on my favorite characters out there. Yes, [problem:1554E] are my most favorite character UwU. I have tried to make the editorials as interactive as possible. Enjoy. [tutorial:1554A] <spoiler summary="Code(C++)"> ~~~~~ #include<bits/stdc++.h> using namespace std; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while (t--) { int n; cin >> n; vector<int> a(n); for (auto &x: a) { cin >> x; } long long ans = 0; for (int i = 1; i < n; i++) { ans = max(ans, 1LL * a[i] * a[i - 1]); } cout << ans << '\n'; } return 0; } ~~~~~ </spoiler> <spoiler summary="Code(Python)"> ~~~~~ import sys input = sys.stdin.buffer.readline t = int(input()) for _ in range(t): n = int(input()) a = list(map(int, input().split())) ans = 0 for i in range(n - 1): ans = max(ans, a[i] * a[i + 1]) print(ans) ~~~~~ </spoiler> [tutorial:1554B] <sp...
range(t): n = int(input()) a = list(map(int, input().split())) ans = 0 for i in range(n

Full text and comments »

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

91.
By DBND, 6 weeks ago, In English
Beating Treaps & Splay with a Simple Idea: A Fast, Amortized Dynamic Segment Tree with Insertion ## The Origin & The Benchmarks: A Hardware-Aware Approach A few months ago, I independently conceptualized an idea for an amortized dynamic data structure. However, it wasn't until recently that I finally found the time to sit down and write a truly optimized, production-ready implementation for it. Curious to see if anyone else had thought of this, I dug deep into the Codeforces archives and stumbled upon a heavily forgotten [blog post from 12 years ago](http://codeforces.me/blog/entry/12285). The author successfully implemented the core base-logic: traversing down to a leaf and splitting it into two new children. **However, there was a major bottleneck in that ancient version:** It relied on **AVL Tree Rotations** (`left_rotate`, `right_rotate`) to keep the height balanced. In modern competitive programming, heavy pointer-chasing and branch-heavy rotation conditions destroy Cache Locality and inflate the constant factor massively. I realized that instead of doing local...
know the tree doesn't degenerate into a linked list (height $O(N)$)?, will degenerate into a skewed structure, much like a linked list. The height of the tree will easily

Full text and comments »

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

92.
By Priyansh31dec, 11 months ago, In English
Video Solutions for CSES Problemset by TLE Eliminators Hello everyone! I have some exciting news to share from the TLE Eliminators team. We are now making video solutions for the [CSES Problemset](https://cses.fi/problemset/), aiming to cover all the beginner-intermediate sections of the CSES Problemset such as `Introductory Problems`, `Sorting and Searching`, `Sliding Window Problems`, `Bitwise Operations`, `Dynamic Programming`, `Graph Algorithms`, `Range Queries`, `Tree Algorithms`, `Mathematics`, `String Algorithms`. Why CSES? This is perfect for beginners and helps you do solid topic-wise practice, introducing you to all the standard concepts in a topic first. Once you know these, it becomes much easier to tackle random or new problems later on. We want to simplify this learning process for you. We have made the following progress so far. 1. `Introductory Problems Set`: Completed 100% &mdash; [Playlist Link](https://www.youtube.com/watch?v=A9C7rO_R888&list=PLcXpkI9A-RZLNzhkMB3SyNfagr1LzIGrp) 2. `Searching and Sorting Se...
Set`: Completed 100% — [Playlist Link ](https://www.youtube.com/watch?v=2HNAKo3jmr4&list, 1. `Introductory Problems Set`: Completed 100% — [Playlist Link ](https://www.youtube.com, 2. `Searching and Sorting Set`: Completed 100% — [Playlist Link ](https://www.youtube.com, 3. `Sliding Window Problems Set`: Completed 100% — [Playlist Link ](https://www.youtube.com, 4. `Dynamic Programming Set`: 1st half is done, 2nd half is in progress — [PlaylistLink

Full text and comments »

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

93.
By HaccerKat, history, 19 months ago, In English
TeamsCode Spring 2025 Contest Editorial Sorry for the long wait. All problems were written, prepared, and editorialized by [user:Yam,2025-03-23], [user:hyforces,2025-04-14], [user:culver0412,2025-04-15], [user:HaccerKat,2025-03-23], [user:alexlikemath007,2025-03-23], [user:jay_jayjay,2025-03-23], [user:n685,2025-03-23], [user:Mustela_Erminea,2025-03-23], [user:Jasonwei08,2025-03-23], [user:eysbutno,2025-03-23], [user:training4usaco,2025-03-23], [user:Nyctivoe,2025-03-23], and [user:gggg0,2025-03-23]. The problems (with problem credits) can be found in the [Novice Gym](https://codeforces.me/gym/105819) and [Advanced Gym](https://codeforces.me/gym/105818). Also thanks to our testers for providing valuable feedback and to our logistics and web team for making TeamsCode possible! [Novice A/](https://codeforces.me/gym/105819/problem/A)[Advanced A: Lily Pads](https://codeforces.me/gym/105818/problem/A) ================================================================================================================= <spoi...
the structure. To do this, we can use a linked list.

Full text and comments »

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

94.
By ICPCNews, 3 years ago, In English
Northwestern Europe Regional Contest 2023: live broadcast schedule Hello, Codeforces! <img alt="NWERC 2023 logo" src="/predownloaded/93/50/9350bf3e0a5d44b0b686211a5b3c988b7643ecd6.png" style="height: 170.0px;max-width: 100.0%;max-height: 100.0%;" align="right"> We are glad to invite you to follow NWERC 2023! The 2023 Northwestern Europe Regional Contest will be held from the 24th till 26th of November 2023. The contest will be held on the campus of the Delft University of Technology, Netherlands. NWERC is an official regional contest of ICPC which draws students' teams from colleges and universities throughout all over the Northwestern part of Europe. The team that solves the most problems at the end of the contest qualifies for the ICPC World Finals 2024, which is planned on September 2024, Kazakhstan. There will also be an online spectator contest for you to solve the problems alongside the contestants. The contest will start at 10:30 CET on Sunday, November 26th. You can register at https://spectator.nwerc.eu/. Please join us on th...
List of useful links:

Full text and comments »

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

95.
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...
standings table. As it is written by link, this is a compulsory measure for combating unsporting

Full text and comments »

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

96.
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 ...
array. At every moment we keep a list of "candidates" for minimum values throughout the process. That

Full text and comments »

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

97.
By striver_79, history, 6 years ago, In English
YouTube Channel for Video Editorials I have been uploading video editorials(B, C and D mostly) for Div-2 and Div-3 rounds. The videos are generally updated within 5/6 hours after the contest ends. This blog will contain all the video links. It will be updated after every contest gets over and the videos are uploaded. **Round 645:** - [Problem D](https://codeforces.me/contest/1358/problem/D) &mdash; [Link](https://www.youtube.com/watch?v=JnGwOVE16-g) **Educational Round:** - [Problem D](https://codeforces.me/contest/1354/problem/D) &mdash; [Link](https://www.youtube.com/watch?v=fgEe-iPdqeI) (N log^2 Approach) (Binary Search + Fenwick Trees) - [Problem D](https://codeforces.me/contest/1354/problem/D) &mdash; [Link](https://www.youtube.com/watch?v=imHu-B73MlI) (N log N Approach) (Binary Lifting on Fenwick Trees) **Round 643:** - [Problem C](https://codeforces.me/contest/1355/problem/C) &mdash; [Link](https://www.youtube.com/watch?v=Z-gBO2i2LhA) **Round 642:** - [Problem F](https://codef...
- [ Problem C](https://codeforces.me/contest/1342/problem/C) — [Link](https, - [Problem B](https://codeforces.me/contest/1348/problem/B) — [Link ](https://www.youtube.com, - [Problem B](https://codeforces.me/contest/1350/problem/B) — [Link ](https://www.youtube.com, - [Problem C](https://codeforces.me/contest/1337/problem/C) — [Link ](https://www.youtube.com, - [Problem C](https://codeforces.me/contest/1348/problem/C) — [Link ](https://www.youtube.com, - [Problem C](https://codeforces.me/contest/1350/problem/C) — [Link ](https://www.youtube.com, - [Problem D](https://codeforces.me/contest/1337/problem/D) — [Link ](https://www.youtube.com, - [Problem D](https://codeforces.me/contest/1339/problem/D) — [Link ](https://www.youtube.com, - [Problem D](https://codeforces.me/contest/1341/problem/D) — [Link ](https://www.youtube.com, - [Problem D](https://codeforces.me/contest/1343/problem/D) — [Link ](https://www.youtube.com, - [Problem D](https://codeforces.me/contest/1348/problem/D) — [Link ](https://www.youtube.com, - [Problem D](https://codeforces.me/contest/1350/problem/D) — [Link ](https://www.youtube.com, /contest/1350/problem/D) — [Link](https://www.youtube.com/watch?v=aFNR6bGCrhU& list

Full text and comments »

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

98.
By SuprDewd, history, 10 years ago, In English
AlgoWiki: A wiki dedicated to competitive programming <img align="right" src="https://wiki.algo.is/img/logo.png" alt="AlgoWiki logo" /> Hi everyone. Over the past couple of years I've been collecting problems, articles, and competitive programming resources that I find interesting. It's already grown to dozens of sheets in multiple Google Sheet documents, and is a pretty bad mess. As an effort to organize this list and make it public, I decided to turn it into an online wiki dedicated to competitive programming: [AlgoWiki](https://wiki.algo.is/). The url is **wiki.algo.is**, so it should be easy to remember. I'm far from done migrating stuff into the wiki, but I think there's already quite a bit of useful information in there. I tried to prioritize algorithms/data structures/techniques that are less known, and then listed problems and articles that I thought were especially useful for learning/practicing the given topic. In some cases I've additionally extracted/written content about the given topic, with notes that po...
that can be solved using Minkowski sums, linked to comments/editorials that might give some hints for, ). Another case in point: the link to the third problem on the Minkowski sum pagelinked to above

Full text and comments »

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

99.
By heuristica, history, 6 years ago, In English
Heuristic algorithm for Hamiltonian path in directed graphs (It's a translated version of my blog at https://peehs-moorhsum.blog.uoj.ac/blog/6384. ) Finding a Hamiltonian path in a directed graph is a well-known NP problem. However, about a year ago, I came up with the following heuristic algorithm which has GREAT performance on random graphs(by first generating a hamiltonian path, adding random edges, then randomly permuting indices) and many CP problems. Here is the idea of the algorithm: We maintain a subset $S$ of edges, ensuring there's no cycle and each vertex has in-degree and out-degree at most 1. Whenever $|S|$ reaches $n-1$, we find a hamiltonian path. We start with $S$ empty. Each time we pick a random edge $e \notin S$. If we can add $e$ to $S$ without violating any rule, we simply add it to $S$. Otherwise, if $e$ won't create a cycle and violate with exactly one edge e', we replace e' with $e$ with 50% probability. Repeat until $|S|$ reaches $n-1$. We can use LCT to check cycles. Here's my code, which takes le...
) { access(a); rev[a] ^= 1; } void link(int a, int b, ; } void link(int a, int b) { makeroot(a); fa[a] = b

Full text and comments »

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

100.
By UnexpectedValue, 4 years ago, In English
CSES DP Section Editorial (Part 2) While looking up an editorial for a CSES task, I recently stumbled upon [CSES DP Section editorial](https://codeforces.me/blog/entry/70018) blog by [user:icecuber,2023-02-07]. Noticing that a few new tasks had been added since the blog was posted 2 years back; I decided to take his permission and write this blog, which contains editorials to the newly added tasks and acts as a sequel to his blog. I would like to thank [user:dominique38,2023-02-10] for being the most enthusiastic co-author possible, [user:defnotmee,2023-04-29] for being the second most enthusiastic co-author (he wanted the title himself), [user:Perpetually_Purple,2023-02-10] for helping me out and giving suggestions, [user:AntennaeVY,2023-02-10] for suggestions on the understandability and formatting of the blog; and finally, [user:icecuber,2023-02-10] himself for going over the blog and giving me confidence in the form of a final thumbs-up! The editorials may at some point appear excessively lengthy, but that is...
similar it is from our previous approach), but here is [a link to the implementation of it](https

Full text and comments »

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

101.
By competitive__programmer, 5 years ago, In English
Graph Theory Playlist Hello everyone, After concluding my DP playlist on YouTube where I discussed my solutions to 18 intermediate level DP problems (rated 1600 to 2000), I just started a Graph Theory Problem Solving playlist where I plan to post my solutions to intermediate level graph theory problems every 2nd day during the month of June 2021. [DP Playlist] (https://www.youtube.com/playlist?list=PLzVLIdIx9dQxwAN5mMkzdvK2B4rV8879j) [Graph Theory Playlist] (https://www.youtube.com/playlist?list=PLzVLIdIx9dQwzso2IwXCQq3aEicK02iKF) [Tutorial on DFS on Tree] (https://www.youtube.com/watch?v=0vNXkdPserI) The problem list is as under: 1) **Kefa and Park (Round 321 Div 2 C Rated 1500)** &mdash; DFS on a Tree [Problem Link] (https://codeforces.me/contest/580/problem/C) [Video Editorial Link] (https://www.youtube.com/watch?v=hXv0KBoFDBY) 2) **Graph Without Long Directed Paths (Round 550 Div 3 F Rated 1700)** &mdash; Bipartite Graphs; 2-Coloring [Problem Link] (https://codeforces.me/...
during the month of June 2021. [DP Playlist] (https://www.youtube.com/playlist? list, [Video Editorial Link] (https://www.youtube.com/watch?v=giodIzHAxV0&list

Full text and comments »

102.
By adamant, 12 years ago, translation, In English
Skip-list Hi everyone! I recently read about such an interesting data structure as skip-list. It seemed to me, the structure is very interesting and at the same time easy to use. That is the reason I decided to experiment with the structure in various problems and try to implement the various modifications of it. [cut] "Basic" operations are well described in this [entry](http://en.wikipedia.org/wiki/Skip_list) from wikipedia. So I will not give them too much time. **Basic implementation.** Here is "pure" variant of skip-list &mdash; implemented only the basic operations &mdash; find, insert, erase. [code](http://ideone.com/XnXIFl) **Adding order statistics functions.** Now we need to add two new functions `find_by_order()` and `order_of_key()`. In order to do this, in balanced binary trees we used to store the size of subtrees. But here we just should store the length of links. After this both functions can be implemented easy enough. In first function we change binar...
Skip-list, Hi everyone! I recently read about such an interesting data structure as skip- list. It seemed to

Full text and comments »

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

103.
By ICPCNews, 3 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...
great universities of eight ICPC regions. Teams qualified to ICPC WF Luxor: - [Officiallist

Full text and comments »

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

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

Full text and comments »

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

105.
By YMSeah, history, 6 years ago, In English
Ordered Set and Multiset Alternatives for Languages Without Built-In Libraries I have been doing competitive programming for some months now. While attempting problems above 1800 in difficulty, I noticed that some of them required the use of ordered sets/multisets that support lookup, addition and deletion of elements in O(log(n)) time. Their solutions usually involve the use of std::set or std::multiset in C++. However, I code primarily in Python and there are no built-in packages available on Codeforces. Normally outside of Codeforces I just import sortedcontainers.sortedlist which I use like an Order Statistic tree. Here I discuss some strategies which I have used to overcome these issues. I hope that it helps others who are stuck so that they do not give up on their favourite languages. For C++ users, this may not be as useful, but you can still see how alternative data structures may be used to solve problems. The example I use here is CSES &mdash; Concert Tickets (for those with no CSES account, see [here](https://www.technicalkeeda.in/2020/10/concert-ti...
). This linked-list with path compression runs quickly. For my submission for this question, it runs, **Method 2: Linked List with Path Compression (like DSU)** ----------------------------------------------------------, **Method 2: Linked list with path compression** : [submission:151410511], /linked list etc. to perform equivalent functions. Time complexity: O(log(n)) for search, insert and

Full text and comments »

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

106.
By Sacha, history, 9 months ago, In English
[Tutorial] Auxiliary Trees for QlogQ offline queries about Dynamic Forest _This blog post is a submission for the [Codeforces Month of Blog Posts Pt. III](https://codeforces.me/blog/entry/149422) challenge. Thank you [user:cadmiumky,2026-02-09] for the initiative!_ Hello, Codeforces! Recently I heard a short tale about one idea on algocourses.ru (from [user:teraqqq,2026-02-01]) and I realized the idea is powerful, so probably it should be more recognized. **This post has been written with my best knowledge. If something is incorrect, please let me know!** #### **Intro** Dynamic Forest queries are usually solved with [Link Cut Tree (LCT)] (https://youkn0wwho.academy/topic-list/lct). However, for offline queries there's a powerful Divide&Conquer technique that avoids the heavy implementation of LCT. This blog explains this technique. Spoiler: LCT is faster. <hr> Related techniques <span style="color: gray; font-size: 70%;">($N$ denotes the number of vertices and $Q$ denotes the number of queries.)</span>: - [Auxiliary/Virtual tree](https:...
Dynamic Forest queries are usually solved with [Link Cut Tree (LCT)] (https://youkn0wwho.academy

Full text and comments »

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

107.
By competitive__programmer, 6 years ago, In English
Dynamic Programming Playlist Hello everyone, I just started my [YouTube channel] (https://www.youtube.com/channel/UCnZ5rC2_JY0EuYMGMiAbISg) in which I have started posting videos related to competitive programming. My first playlist is on [Dynamic Programming] (https://www.youtube.com/playlist?list=PLzVLIdIx9dQxwAN5mMkzdvK2B4rV8879j) and I will be uploading solutions for 16 DP problems in the month of May (with videos coming every second day.) This playlist is aimed at those who have a conceptual understanding of what DP is and want to raise their DP problem solving level so that they are able to solve medium level DP problems (of CF rating from 1600 to 2000). Please have a look at my channel and consider subscribing if you like the content. I have also uploaded a general video on how to get better at Dynamic Programming which should be helpful for all skill levels: [How to get better at Dynamic Programming] (https://www.youtube.com/watch?v=WV5vI_p0L9Q) The problem list is as under: 1) **Fl...
first playlist is on [Dynamic Programming] (https://www.youtube.com/playlist? list, [Video Editorial Link] (https://www.youtube.com/watch?v=q3mKhWxIGxc&list

Full text and comments »

108.
By pilliamw, history, 8 months ago, In English
Codeforces needs a Better Rules Page In light of recent events and general trends in competitive programming over the last few years, it's become increasingly clear (and frustrating) to me about how ineffective the current rules page in Codeforces is. Here's a challenge for you &mdash; using **only the Codeforces platform (no Google/search engines)**, try to find the answers **in-text** to the following five questions: - What's an "open hacking phase", and why do hacks sometimes give points but sometimes not? - If you resubmit a solution that passed pretests due to a bug you found, which submission time is used? - What online resources are you allowed to use? Language documentation? StackOverflow excerpts? - What are the punishments for cheating? - What kinds of blog posts are appropriate on the platform? See the issue here? One could argue that people could easily search up and find the answers to some of these questions on external websites or unofficial blog posts, but consider this: *when was the last tim...
"RULES" tab to that navigation bar at the top, and have it link to a *single* page that lists, rules page that can be accessed in the relatively simple "Details/FAQ -> CTRL-F for 'rules'link, ' link" pathway. And get this — **it's all listed in one HTML page!** Truly revolutionary

Full text and comments »

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

109.
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 ...
built to provide maximum automation and to relieve the contestant as much as possible. Alist of

Full text and comments »

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

110.
By MikeMirzayanov, 3 years ago, In English
Complaints on Comments <img src="/predownloaded/f0/ff/f0ff581246db486e2d6a28398f591770f01a0747.png" style="width: 400px; float: right; margin: 0 1em 1em 1em;"/> Hello! Now, if you've downvoted a comment, you can report it. You should do this if you're certain that one of the rules is being violated. Currently, the list of rules is as follows: * <b>Hate/Offensive</b>: The publication contains signs of hatred, racial slurs, derogatory language or intolerance. Please maintain a respectful tone; critical comments should include thoughtful reasoning. * <b>Threats/Harassment</b>: Content that contains explicit threats or harassment, including cyberbullying or stalking, is subject to censorship. Codeforces aims to create a safe and respectful environment for its users. * <b>Vi...
list of rules is as follows: * Hate/Offensive: The publication

Full text and comments »

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

111.
By arthur_9548, 6 months ago, In English
Editorial: VII UnBalloon Contest We hope everyone enjoyed the problems of [contest:106523]! This editorial contains the description of the solutions and their implementation. Feel free to discuss them in the comments! #### Problem A - Idea: [user:lucassala,2026-05-17] - Preparation: [user:lucassala,2026-05-17] <spoiler summary="Solution"> This is a classic problem where we can solve the queries offline. First, we receive all the queries, calculate the response for each node, and then respond. To calculate the response for each node, we will perform a DFS starting at vertex $1$ and create a map where we maintain the frequency of each color along the path from the root to the current node in the DFS. When we enter a new vertex, we add $1$ to the frequency of the current vertex's color in the map, and when we leave that node, we subtract $1$ from that color's frequency. Furthermore, we must ensure that all colors in the map have a positive frequency, removing any colors that reach a frequency of $0$ from the map...
We can build the Suffix Automaton of this list. This can be done using the usual automaton

Full text and comments »

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

112.
By jt3698, 6 years ago, In English
CodeHunt: A Site for Problem Filtering and User Comparison Hi Coders! We have launched **[CodeHunt](https://codehunt.cc)**! ![ ](/predownloaded/de/da/deda488c878f2180f04d332b4f26d3285fc4c63b.png) **[CodeHunt](https://codehunt.cc)** is made to help **Codeforces** and **UVa Online Judge** users filter their problems with convenience and ease. You can also compare yourself with friends and rivals to motivate your practice and growth. What inspired us to make CodeHunt? ---------------------------------- Before any other site, we practiced our competitive programming using **UVa**, assisted, of course, by the incredible site, [uHunt](https://uhunt.onlinejudge.org/), made by _Felix Halim_. As we began to participate in **Codeforces** contests and solved more and more problems here, we never had the same level of motivation for the long grind as we did when using **uHunt**. We realized it was because there wasn’t a tool out there for **Codeforces** that was as convenient in tracking problems. After a while of looking for the right tool...
) - Multiple ways to **sort** the list of problems - Submitting to **same problems** is **linked

Full text and comments »

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

113.
By tharunbalaji31, history, 4 years ago, In English
Middle of Linked List | JAVA & C | Rabbit and Tortoise Algorithm # Intuition The problem is to identify the middle element or node of the given Singly Linked List and return second middle element if the length of List is even. Basically there are two approaches to solve this problem: - Approach 1: Brute Force $TC:O(N) + O(N/2)$ - Approach 2: Tortoise Rabbit Algorithm $TC:O(N/2)$ # Approach 1 In the Brute Force approach, we will be calculating the length of Linked List by traversing through each element using temp pointer. Then calculate the half of length ($length/2$). Once again traverse through the Linked List and move the head variable until half of its length is reached, after reaching return the head pointer. Now the head pointer contains the chain from middle element of that List. - Time complexity: O(N) + O(N/2) - Space complexity: O(K) # Code ``` struct ListNode* middleNode(struct ListNode* head){ struct ListNode* ptr = head; int length=0; int mid; while(ptr != NULL){ ptr = ptr->next; ...
Middle of Linked List | JAVA & C | Rabbit and Tortoise Algorithm, end of List or the last node of List we have Tortoise pointer at the middle node of theList. Then, # Approach 1 In the Brute Force approach, we will be calculating the length of Linked List by, # Intuition The problem is to identify the middle element or node of the given SinglyLinked List

Full text and comments »

  • Vote: I like it
  • -2
  • Vote: I do not like it

114.
By sharabhagrawal25, history, 6 years ago, In English
[For Beginners] Video Tutorials COPS Youtube Channel Hello, Codeforces community The Club of Programmers, IIT BHU is excited to announce the completion of beginners playlist of COPS YouTube channel. The content is made for beginners to enable them to kickstart their journey in the field of competitive programming. The videos and the corresponding document not only provide explanation to the concept but also provide a proper roadmap on how to study these concepts along with the practice problems. Youtube Channel link : [https://www.youtube.com/channel/UC01TZlNfu29QgG4FmUqVsdg/featured?view_as=subscriber](https://www.youtube.com/channel/UC01TZlNfu29QgG4FmUqVsdg/featured?view_as=subscriber) I am also providing the concept wise link to the videos for the beginners- - [Array, vector and pair](https://www.youtube.com/watch?v=bQ7rNIS3ZGs&list=PLLt4yMoVgczX0qAe_Q1ZHpDdd3_IRrCx6&index=1&t=1s) - [STL String](https://www.youtube.com/watch?v=899Dck1YF6M&list=PLLt4yMoVgczX0qAe_Q1ZHpDdd3_IRrCx6&index=2) - [Time and space complexit...
study these concepts along with the practice problems. Youtube Channel link : [https

Full text and comments »

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

115.
By 3tao1n, history, 8 years ago, In English
Translation of China NOIP Qualification Round This article is an English translation of the NOIP Round 1 (the Qualification Round) problems. [cut] Here are some backgrounds about it. * [user:matthew99,2018-10-21] has written an [Introduction to Chinese OI contests](http://codeforces.me/blog/entry/51462), but he ignored this for some reason; maybe this exam is too easy for him in his province. * It is literally a "preliminary contest". * Basically, this is a qualification round for NOIP. * This is a written examination. * The exam lasts for 2 hours. * The total score is 100. You may need to get ~80 scores (in provinces like Zhejiang) or ~20 scores (in provinces like Inner Mongolia) to pass. * This translation may be not 100% exact, but you can feel the flavor of the NOIPR1. In part IV and V, the translator modified and formatted the source codes with `clang-format` . ### Part I: Single Choice Problems 2 score for each problem. ##### 1. In the following four numbers in different positional notation, whic...
The following program reads $P$ and calculates $Q$ with double-linked list. It is guaranteed that

Full text and comments »

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

116.
By Yaser_Nimreh, history, 4 years ago, In English
Simply Linked List ```cpp #pragma once #include <iostream> using namespace std; template <class type> struct node { type value; node* next; node(type v, node* n = 0) { value = v; next = n; } }; template <class type> class list { node <type>* head; public: list() { head = 0; } bool empty()const { return (head == 0); } int size()const { int count = 0; for (node <type>* temp = head; temp != 0; temp = temp->next) count++; return count; } void print()const { for (node <type>* temp = head; temp != 0; temp = temp->next) cout << temp->value << " "; cout << "\n"; } void push_front(type element) { head = new node<type>(element, head); } void push_back(type element) { if (empty()) head = new node<type>(element); else { node <type>* temp = head; while (temp->next != 0) temp = temp->next; temp->next = new node<type>(element); } } void insert(type element, int position) { if (p...
Simply Linked List, template class list { node * head; public: list() { head = 0

Full text and comments »

  • Vote: I like it
  • -30
  • Vote: I do not like it

117.
By Yaser_Nimreh, history, 4 years ago, In English
Doubly Linked List ```cpp #pragma once #include <iostream> using namespace std; template <class type> struct node { type value; node* next, * previous; node(type v, node* n = 0, node* p = 0) { value = v; next = n; previous = p; } }; template <class type> class list { node <type>* head; public: list() { head = 0; } bool empty()const { return (head == 0); } int size()const { int count = 0; for (node <type>* temp = head; temp != 0; temp = temp->next) count++; return count; } void print_forward()const { for (node <type>* temp = head; temp != 0; temp = temp->next) cout << temp->value << " "; cout << "\n"; } void print_backward()const { if (!empty()) { node <type>* temp = head; while (temp->next != 0) temp = temp->next; while (temp->previous != 0) { cout << temp->value << " "; temp = temp->previous; } cout << temp->value << endl; } } void push_front(type element) ...
Doubly Linked List, ) { value = v; next = n; previous = p; } }; template class list { node , template class list { node * head; public: list() { head = 0

Full text and comments »

  • Vote: I like it
  • -29
  • Vote: I do not like it

118.
By Yaser_Nimreh, history, 4 years ago, In English
Simply Circular Linked List ```cpp #pragma once #include <iostream> using namespace std; template <class type> struct node { type value; node* next; node(type v, node* n = 0) { value = v; next = n; } }; template <class type> class list { node <type>* tail; public: list() { tail = 0; } bool empty()const { return (tail == 0); } int size()const { if (!empty()) { int count = 0; node <type>* temp = tail->next; do { count++; temp = temp->next; } while (temp != tail->next); return count; } return 0; } void print()const { if (!empty()) { node <type>* temp = tail->next; do { cout << temp->value << " "; temp = temp->next; } while (temp != tail->next); cout << "\n"; } } void push_front(type element) { if (empty()) tail->next = tail = new node<type>(element); else tail->next = new node<type>(element, tail->next); } void push_back(type element) { if (e...
Simply Circular Linked List, template class list { node * tail; public: list() { tail = 0

Full text and comments »

  • Vote: I like it
  • -28
  • Vote: I do not like it

119.
By tahuruzzoha, history, 3 years ago, In English
Rust programming language for problem-solving. Intro ----- Rust is proving to be a productive tool for collaborating among large teams of developers with varying levels of systems programming knowledge. Low-level code is prone to various subtle bugs, which in most other languages can be caught only through extensive testing and careful code review by experienced developers. In Rust, the compiler plays a gatekeeper role by refusing to compile code with these elusive bugs, including concurrency bugs. By working alongside the compiler, the team can spend their time focusing on the program’s logic rather than chasing down bugs. ### Now, let's look at some basic data structure implementations in Rust: #### This Rust code demonstrates the creation and printing of an **array**. Let's break down the key components: ~~~~~ fn main() { // Declares an array named 'arr' containing elements of type i32 with a length of 3. let arr: [i32; 3] = [1, 2, 3]; // Prints the content of the array using the debug formatting...
illustrates the implementation of a **simple linked list** using the **Box** type for heap, #### This Rust code illustrates the implementation of a **simple linked list** using the **Box, - When the program is executed, it will print the structure of the linked list:, - let list = Some(Box::new(Node {...}));: Initializes a linked list with two nodes. - The first, - println!("{:?}", list);: Prints the linked list using the println! macro with the {:?} format, - struct Node: Defines a struct named Node representing a node in the linked list. - data: i32, >, } fn main() { // Creating a linked list with two nodes let list = Some(Box::new, Linked List Initialization:, Printing the Linked List:, These examples cover arrays, vectors, linked lists, hash maps, and a basic stack. Rust's ownership, This code represents a basic singly linked list with two nodes. Each node is allocated on the heap

Full text and comments »

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

120.
By coderdhanraj, history, 3 years ago, In English
Invitation to Insomnia Qualifier 2024 Hello Codeforces! **Computer Club, MNNIT Allahabad**, India is glad to invite you to the annual programming competition of MNNIT, **Insomnia**, which is an ACM-ICPC style team programming contest of **2.5 hours** duration held on Codeforces during its annual technical fest **Avishkar**. The team can consist of **up to 3 members**. Contest Details: - Qualifiers: - Start Time: [Saturday, March 16, 22:30 IST](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Insomnia+Qualifier+2024&iso=20240316T223000&p1=2408) - Duration: 2.5 hours - Finals: - Start Time: [Monday, March 18, 12:00 IST](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Insomnia+Finals+2024&iso=20240318T120000&p1=2408) - Duration: 3 hours The **Top** **25 global teams** and the **Top 25 teams** from MNNIT (based on the result of Qualifiers) will qualify for the Finals. The prize distribution for global teams is mentioned below: ![ ](/predownloaded/66/2e/662e...
/1vbPCPCLiWwbEv8h_0LcvyA_0Q5HSgNKGmB02PNtmzA4/edit#gid=0) is the list of invited teams for the Final Round of INSOMNIA 2024. The invitelink

Full text and comments »

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

121.
By kartik8800, history, 6 years ago, In English
Beginner Friendly Series on Dynamic Programming This series of videos are focused on explaining dynamic programming by illustrating the application of DP through the use of selected problems from platforms like Codeforces, Codechef, SPOJ, CSES and Atcoder. After going through this series, you should find yourself confident in approaching dynamic programming problems and also implementing them in a reasonable amount of time. I will also live code and submit the solutions to the problem on the coding platform from where the problem comes. Some Basic elements of Dynamic Programming ================== Some general ideas and my thoughts about DP to help you get started:<br> Part 1: [https://youtu.be/24hk2qW_BCU](https://youtu.be/24hk2qW_BCU)<br> 1. What is Divide and Conquer?<br> 2. What is Dynamic Programming?<br> 3. Types of DP problems.<br> Part 2: [https://youtu.be/yfgKw6BUZUk](https://youtu.be/yfgKw6BUZUk)<br> 1. What is a DP-state?<br> 2. Characterizing a DP-state.<br> 3. What is a recurrence?<br> 4. T...
will make sure that this list of problems will keep growing, cheers! Link for introduction to

Full text and comments »

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

122.
By shauncodes, history, 16 months ago, In English
CFRecommender — Personalized problem recommendation tool #### **UPDATE 2:** ------------- Saving codeforces questions for **revision and upsolving** is now live on the [website](https://cfrecommender.vercel.app/). 1. Sign in with google so that no one else has access to your personal revision list. ![Sign in with google](https://i.postimg.cc/R0wNFg5q/Screenshot-from-2025-07-09-14-03-14.png) 2. Link your account to your codeforces handle by submitting a compilation error within 60 seconds. ![Linking account](https://i.postimg.cc/Vsh1xXph/Screenshot-from-2025-07-09-14-06-19.png) 3. Now you have access to create and edit your upsolve list. Add problems by just pasting a codeforces problem link and it will fetch the problem for you! ![Upsolve list](https://i.postimg.cc/GhsrdH1m/Screenshot-from-2025-07-09-14-07-12.png) #### **UPDATE 1:** ------------- There has been an overwhelming response from users worldwide, and I am very grateful for the same. I also received valuable feedback from a lot of you, and have tried imple...
codeforces problem link and it will fetch the problem for you! ![Upsolve list ](https://i.postimg.cc, list. Add problems by just pasting a codeforces problem link and it will fetch the problem for you

Full text and comments »

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

123.
By stefdasca, history, 3 years ago, In English
[Unofficial] Educational Codeforces Round 161 Editorial Since the editorial is still unpublished yet as I was writing this blog, I decided to write an editorial for the problems that were given at yesterday's contest. For tasks A-E I also published video editorials ([A-C](https://www.youtube.com/watch?v=WPueAdG03Po), [D-E](https://www.youtube.com/watch?v=aTI-CLjoRCU)) [problem:1922A] In order to solve this problem, we must observe that each position is independent from each other and it is enough for us to fix only one position in order to see if we can get both $a$ and $b$ match the template while $c$ doesn't. Thus, it will be enough to check if $a_i \neq c_i$ and $b_i \neq c_i$ for that to work, as we could then put an uppercase letter and discard $c$ right away. Solution code: [submission:242416975] Video editorial: [Link](https://www.youtube.com/watch?v=WPueAdG03Po) Alternatively, this can also be done in a much more complicated fashion with bitmask dp where $dp_{(i, j)}$ is $1$ if we can get a configuration up to positio...
adjacent monsters, we can either use sets or use a linked-list like approach, where for each position

Full text and comments »

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

124.
By ekzhang, history, 6 years ago, In English
Online Workspace for Codeforces Problems Hello all, Like you, I enjoy solving Codeforces problems on the go. However, sometimes I am not working on my computer with all my environment and setup. There are many automated problem parsers and test runners to help make solving Codeforces problems painless, but they all require a complicated installation process. About a year ago, I was introduced to [CS Academy](https://csacademy.com/), which I thought had an amazing interface for solving problems. It shows the problems and your code side-by-side, and you can automatically run your program on the example test cases. Also, there is auto-saving in case you accidentally close your window. Why can't we have this for Codeforces? I couldn't find anything on the web that was easy to set up and fun to use, so I made my own online workspace at [wkspace.herokuapp.com](http://wkspace.herokuapp.com/). ![Screenshot of wkspace](https://i.imgur.com/2wT2u6x.png) Here are some features: - No sign-up or installation required - P...
- List workspaces you have recently edited - Share a read-only paste of your code bylink - Support

Full text and comments »

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

125.
By Mousa_Aboubaker, 19 months ago, In English
NAOI 2025 Teams [NAOI 2025](https://naoi2025.algerianoi.com/) is after 3 weeks, and we've just sent the participants who will represent Libya here is the list of the official teams: [link](https://naoi2025.algerianoi.com/teams), and I'm making this blog to have all the participants who will compete in NAOI 2025 with their codeforces handles if you have the details for your country's participants, write them in a comment like this: Contestant Name (codeforces handle if it exists) 1st time at NAOI, X attempts left let's write all the contestants in this blog! let's start with my country contestants: - Mousa Aboubaker ([user:Mousa_Aboubaker,2025-03-28]) &mdash; 1st time at NAOI, 0 attempts left - Albara Abdulhafith ([user:Albara_Abdulhafith,2025-03-28]) &mdash; 1st time at NAOI, 0 attempts left - Fadel Elsenusi ([user:Fadel_Elsenusi,2025-03-28]) &mdash; 1st time at NAOI, 3 attempts left - Ahmed Albakoush ([user:ahmed1611,2025-03-28]) &mdash; 1st time at NAOI, 0 attempts left - Abd...
here is the list of the official teams: [link ](https://naoi2025.algerianoi.com/teams), and I'm

Full text and comments »

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

126.
By heuristica, history, 5 years ago, In English
Heuristic algorithm for Hamiltonian path in undirected graphs Here is the code for undirected case. It's quite similar to directional one, but we only need to keep total degree $\le 2$ for each node. I haven't tested it yet, so I'm not sure if it works well. To do: 1. do more tests 2. function for hamiltonian cycle 3. When create a cycle, might replace an edge on the cycle with the new edge ~~~~~ #include <bits/stdc++.h> using namespace std; namespace hamil { template <typename T> bool chkmax(T &x,T y){return x<y?x=y,true:false;} template <typename T> bool chkmin(T &x,T y){return x>y?x=y,true:false;} #define vi vector<int> #define pb push_back #define mp make_pair #define pi pair<int, int> #define fi first #define se second #define ll long long namespace LCT { vector<vi> ch; vi fa, rev; void init(int n) { ch.resize(n + 1); fa.resize(n + 1); rev.resize(n + 1); for (int i = 0; i <= n; i++) ...
) { access(a); rev[a] ^= 1; } void link(int a, int b, ); rev[a] ^= 1; } void link(int a, int b) { makeroot(a

Full text and comments »

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

127.
By ed1d1a8d, 13 years ago, In English
Spam Blogs need to Go Over the past few months, the frequency and magnitude of spam posts has increased dramatically on CodeForces, and today it has gotten to the point where it is a serious inconvenience to the community. When the entire recent actions list is full of spam blogs save for one post on the contest from that day: [Picture Reference Link](http://puu.sh/7ysj6.png), something must be done. **Firstly**, some direct observations: - Almost all spam blog posts are created by users that are extremely new - Spam blog users post their blogs almost immediately after account creation - Spam blog users have NO submitted problems or registered contests **Secondly**, I'd like to note (and to refresh your memory) that CodeForces does have a Captcha system in place for registration. This means that all the spam users are more likely than not created by real human beings and not bots (I would commend anyone who is able to make a sufficiently accurate OCR program). From these observations I wou...
**COMPILED LIST OF POTENTIAL SOLUTIONS** _(Links to comments below)_, . When the entire recent actions list is full of spam blogs save for one post on the contest from

Full text and comments »

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

128.
By parveen1981, history, 6 years ago, In English
New (?) Data Structure: Array Linked List (for beginners) Hi guys,<br> I was solving [this](https://codeforces.me/contest/1506/problem/G) problem and I came up with somewhat wrong solution. Although my solution was wrong but I came up with new data structure. I don't know if you know this but here it is.<br> At first, I want to describe what I wanted to do and for what:<br> 1. We are given a linked list in which nodes are numbered from $1$ to $n$ and they are all connected ( 1-2-3-4-...-n).<br> 2. I wanted to remove some nodes whenever I want in $O(1)$.<br> <br> So we can maintain two arrays here: $next$ and $prev$. $next[i]$ will tell us the next node which $i$ is connected to and $prev[i]$ will tell us the previous node which $i$ is connected to.<br> So, initially we will have $next[i]=i+1$ and $prev[i]=i-1$ <br> Now, to remove some node, we can do the following:<br> $next[prev[i]]=next[i]$<br> $prev[next[i]]=prev[i]$<br> So this is the basic remove operation and you can customize it however you like.<br> <spoiler summary="cod...
New (?) Data Structure: Array Linked List (for beginners), to do and for what: 1. We are given a linked list in which nodes are numbered from $1$ to $n

Full text and comments »

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

129.
By Error_Yuan, history, 2 years ago, In English
How to Participate in Luogu Contests **UPD**: (From [user:MatrixGroup,2024-07-13]) To copy Markdown for discuss and articles, you can: For discuss, use the code: ``` console.log(_feInstance.currentData.post.content); ``` For articles, use: ``` console.log(JSON.parse(document.getElementById('lentille-context').innerText).data.article.content); ``` *** Luogu is a famous OJ (Online Judge) in China. Many users of Codeforces may know it, but don't know how to participate contests on Luogu. So I'm writing this blog to offer a brief tutorial. I suppose that you do not have a Luogu account, so let's start from registering. ### Step 1. Create An Account Enter the site: [link](https://www.luogu.com.cn/auth/register) Here is the English translation for this page. ![ ](https://cdn.luogu.com.cn/upload/image_hosting/z38wtrkv.png) You need to fill in: + username, + password (and confirm), + the secret code in the picture, + your email, (and click the "send verification code" button) + chec...
registering. ### Step 1. Create An Account Enter the site: [link ](https://www.luogu.com.cn

Full text and comments »

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

130.
By bira37, history, 7 years ago, In English
A little list of tutorials (for beginner and intermediate contestants) Hello! I'd like to share with you a simple and little guide that I made with [user:bfs.07,2019-08-02], originally aimed to help the people from my college to start studying competitive programming. However, I thought it might be interesting for some other people too. When I started to study competitive programming, I found it was a bit difficult to find good tutorials. I couldn't find every single topic I wanted to study in only one place, and when you don't know what to study, you can't just search using Google. Looking through Codeforces I found lots of tutorials, guides with useful informations and even some lists compiling interesting tutorials found on the platform. However, I didn't find a list compiling tutorials from more than one website. Then, I decided to do that. This list (which I called "Competitive Programming Study Guide for C++ Users") contains links to a large number of tutorials divided by categories. These tutorials are the ones I used to learn, or found g...
A little list of tutorials (for beginner and intermediate contestants), didn't find a list compiling tutorials from more than one website. Then, I decided to do that, This list (which I called "Competitive Programming Study Guide for C++ Users") contains links to a, You can access it via this link: [Competitive Programming Study Guide for C++ Users](http://bira37

Full text and comments »

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

131.
By sprkgoyal, history, 6 years ago, In English
Editorial of NITS Local #30 #### [NITS Local #30](https://codeforces.me/contestInvitation/4458b50ba97223c64d69c2c883efd136975c6e08) [Maximize the XOR](https://codeforces.me/gym/294724/problem/A) **Author:** [user:amit_dwivedi,2020-09-16] <spoiler summary="Tutorial"> There are many ways to solve this problem. One of which is described here. All we have to do is find the maximum number of indices such that both strings have different values. We can do this by sorting one string in increasing order and another one in decreasing order. Now count of these indices gives us the number of set bits and the remaining are unset bits. Time Complexity: $O(n \log n)$ </spoiler> <spoiler summary="Solution"> ~~~~~ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); string s, t; cin >> s >> t; sort(s.begin(), s.end()); sort(t.begin(), t.end()); reverse(t.begin(), t.end()); string ans = ""; for(int...
This problem can be solved using a linked-list. We can maintain a, 1. Serve: Delete the node at the head position of the linked list., 3. Mafia X: Insert the node at the beginning of the linked list.

Full text and comments »

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

132.
By MikeMirzayanov, 11 years ago, translation, In English
Codeforces: What We Did in 2015 <img src="http://mama-rasskazu.ru/uploads/posts/2015-08/1440572760_f105e8f59f1e0a010d1d065c71de75c6.jpg" style="float:right; margin:0 1em 1em 1em;"/> Hello! In 2015 we have not only engaged in the organization of rounds and championships. Every day we write the code, debug, test and explore a variety of tools and technologies to make Codeforces better. Even if in some periods you have not seen great changes on the website, it does not mean that the development was stopped &mdash; just some of the innovations relate solely to infrastructure, architecture or administrative interfaces and are not visible to the users. I have collected in a list of all the innovations, which touch users in some sense. This faceless list includes results of many days of work of each member (sometimes with prefix ex-) of Codeforces technical team: [user:MikeMirzayanov,2015-12-28], [user:MaximShipko,2015-12-28], [user:kuviman,2015-12-28], [user:fcspartakm,2015-12-28], [user:Avalanche,2015-12-28]. The...
are not visible to the users. I have collected in a list of all the innovations, which touch

Full text and comments »

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

133.
By SecondThread, history, 3 years ago, In English
Hacker Cup Shirts 2023 Meta Hacker Cup Shirts ================== Hacker Cup prizes are back this year, and the shirts are back in black! The **top 2000 participants** in [Round 2](https://www.facebook.com/codingcompetitions/hacker-cup/2023/round-2) will win a shirt. If you qualify for [Round 3](https://www.facebook.com/codingcompetitions/hacker-cup/2023/round-3) and finish in the top 200, you'll win a shirt with a top-200 badge on the sleeve instead of the normal shirt. Just like last year, T-Shirts will be able to be claimed in your [Hacker Cup Profile](https://www.facebook.com/codingcompetitions/profile) after we have finished plagiarism checks for the Round 3. <strike>(or after we have finished plagiarism checks for Round 2 if you didn't qualify for Round 3 and have no chance of winning a top-200 shirt)</strike> ![ ](https://wumbogames.github.io/cfPictures/hc2023profileprize.png) ![ ](https://wumbogames.github.io/cfPictures/hc2023shirt.png) You must claim your shirt by **December 15th*...
support prize shipments to the following countries at this time:

Full text and comments »

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

134.
By ATSTNG, history, 2 years ago, In English
[Feature request] Past locations and organizations in user social settings Codeforces allows users to choose their locations and organizations in "Social" tab in profile settings. ![ ](/predownloaded/20/36/2036297fc136bd095cca5f6382171a8397cc091e.png) If configured, this information is shown in user profile to everyone and also includes user into filtered rating list of selected country, city and organization. This is a nice functionality, but I've always felt that this is incomplete. People tend to change locations and organizations over time, but currently there can be only one location and only one organizaton. But which one to choose? There are multiple options that seem reasonable - Your current location/organization - Location/organization/team where you had peak performance - Your alma mater - Your origin/place of birth From what I've seen different people resolve this ambiguity in different ways. This has it's impact on filtered rating lists. You will see a person in organization in these cases: - Active user who is currently in ...
list of selected country, city and organization. This is a nice functionality, but I've always felt

Full text and comments »

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

135.
By DuyMinh3005, 5 months ago, In English
[Tutorial] How to format a blog <i>This blog focuses more on the functions (which help you format a blog), not the tips and tricks.</i> <br> Since many recent blogs are hurting my eyes (I'm talking to you, [user:MEGATRON_HACKER,2026-06-15]...), I decided to write a blog to share some tips and tricks about how to format a blog. <b> This post has been written with my best knowledge. If something is incorrect please let me know! </b> <b style="color:white;font-size:5px"> I copied this sentence from [<b style="color:white;font-size:5px">this blog</b>](https://codeforces.me/blog/entry/104522)...</b> <br> Here's a table of contents if you guys need it: ### <b>Table of Contents:</b> <ol> <li> <b>Codeforces specific features</b> </li> <li> <b>Math</b> </li> <li> <b>Emoji</b> </li> <li> <b>Change font, font size, color, background color of text, and text's alignment</b> </li> <li> <b>Tables</b></li> <li> <b>YouTube videos</b> </li> </ol> <p style="font-size:0px"> This blog was written by ...
lists: Create a bulleted or numeric list. As you can see, I'm using the bulletedlist now.

Full text and comments »

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

136.
By Sazzon, history, 8 years ago, In English
"Looking for a challenge ?" — Where to submit your codes Hello codeforces, as you may know, the famous book ["Looking for a challenge?"](http://www.lookingforachallengethebook.com/) is quite beloved by our community, given it has really interesting/hard problems and editorials from problem's writer itself. Recently I got back to my copy, craving to know if I could solve it entirely. On each question statement, the book gives you a URL for that particular question. The problem is, they are outdated. The last time I tried to upload a solution to that URL, at least it gave me another option to it. But now, this is what we see: ![ ](/predownloaded/a7/06/a706d3890d43578fc22c9cae711a78dea096ad3d.png) For those who don't know polish (Or don't know the magic of google translate), this domain is no longer being properly used to host the questions. After searching through the web (also here), I couldn't find the site that I once visited, and fortunately I found! Here it is: https://szkopul.edu.pl/ Since some of you do not have a cop...
But fear not! If you have the particular missing link, please leave a comment so we can make it

Full text and comments »

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

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

Full text and comments »

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

138.
By white_square, history, 3 years ago, In English
This week I learned.. Hey, <spoiler summary="Hamming Code"> Hamming code is a 7 digit long code in which digit d0-d4 represent the outermost or in dependent cells and d5-d7 represent the dependent cells. It has a unique property that if you change any digit in a valid hamming code you could find out which digit you changed. b5=(b2+b3+b4)%2 b6=(b1+b3+b4)%2 and b7=b7=(b1+b2+b4)%2 Now suppose if b2 was changed you know b2 was changed because it is independent, but suppose if b5 is changed then you can know which unique(in dependent cell) was changed. </spoiler> <spoiler summary="Topological sorting"> Question alien sort on topological sorting. The question is follows, you are given a set of strings sorted by some manner, you have to find by which manner they are sorted. As we know that if things are sorted so obviously arr[0]<arr[1], so we can check where these two strings differ, and create a dependency based on it, because arr[0] was before arr[1] for a reason, we check what made ar...
I was wondering if this question can be done by linked list or not, if you have done it withlinked

Full text and comments »

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

139.
By UzuHa_NaruSuke, history, 2 years ago, In English
Transforming a Hidden Passion: The Rise of Our College's CP Club A year ago, the Competitive Programming (CP) club at our college was a small, almost hidden community. At that time, only two of us actively participated in CP contests: I was a Pupil, and my friend was a Specialist. Fast forward to today, and our club has grown dramatically. We now proudly have five Experts among us, a testament to our collective effort and passion. How did we achieve this transformation? It wasn’t magic; it was a combination of strategic initiatives and a supportive environment. We organized engaging events like Code UnCode (You can search about it on LinkedIn), which not only challenged the students in the college but also sparked their interest and excitement. After every Codeforces (CF) and CodeChef (CC) round, we hold Post Contest Discussions. These sessions have become a cornerstone of our community, where members can share their strategies, learn from each other, and collectively improve their skills. But perhaps most importantly, we celebrated every achi...
personalized emails, but I don’t have access to the email IDs linked to their CF account Any suggestions for

Full text and comments »

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

140.
By SecondThread, history, 2 years ago, In English
Hacker Cup Shirts 2024 Meta Hacker Cup Shirts ================== Hacker Cup shirts are back this year! If you placed in the top 2000 of [Round 2](https://www.facebook.com/codingcompetitions/hacker-cup/2024/round-2), you'll have a shirt available on your Hacker Cup Profile page. If you placed in the top 200 of [Round 3](https://www.facebook.com/codingcompetitions/hacker-cup/2024/round-3), you'll win a shirt with a top-200 badge on the sleeve, instead of the normal shirt. ![ ](https://wumbogames.github.io/cfPictures/AvailableExample.png) ![ ](https://wumbogames.github.io/cfPictures/Shirts2024.png) You must claim your shirt by **December 13th**. We will not be shipping shirts after the 13th. Due to regulations, Meta is also not able to support prize shipments to the following countries at this time: <spoiler summary="Country List"> - Belarus &mdash; Suspended - Central African Republic &mdash; Suspended - Comoros &mdash; Not Served - Cuba &mdash; Not Served - Equatorial Guinea &mdash; Su...
: - Belarus — Suspended - Central African Republic

Full text and comments »

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

141.
By Hamed_, history, 8 months ago, In English
Trick Bites: Daily CP Tricks & Video Upsolves Hello Codeforces! This is my very first blog post here, Lately I've been working on a series called **Trick Bites**. ### The Idea I wanted to share some special CP tricks. Some of them are uncommon but surprisingly easy (like Dinkelbach's algorithm), while others are just common tricks that everyone needs to know. I've started releasing a new problem every day to highlight a specific trick. With each problem, I upload a short, straight-to-the-point Arabic video explaining the trick and the optimal solution. ### Why this blog? I wanted to create this blog to be a permanent archive. I will be updating this exact post daily with the new problem links and video solutions. My hope is that by saving all this content in one organized place, it can become a useful resource for anyone looking to learn some tricks! --- ### The Trick Bites Archive (Updated Daily) [Group Link](https://codeforces.me/group/reRlOrZJrU/contests) *(I will update this list every day with the late...
looking to learn some tricks! --- ### The Trick Bites Archive (Updated Daily) [GroupLink

Full text and comments »

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

142.
By A2SV_Group6, history, 21 month(s) ago, In English
A2SV G6 — Round #4 (Editorial) [Here](https://codeforces.me/contestInvitation/a2c03a5976fa02f50b4e11d6f1fda6e29cd7e083) is the contest link. #### [A. A+ Student](https://codeforces.me/gym/590053/problem/A) <spoiler summary="Hint 1"> For each student, calculate how much they need to exceed the maximum score of the other two students. If they are already leading, no points are needed. </spoiler> <spoiler summary="Hint 2"> The required points for a student are the difference between the highest of the other two scores and their own score, plus one (to ensure strict inequality). If already higher, this value is zero. </spoiler> <spoiler summary="Solution"> <p> To solve this problem, we need to determine the minimum additional points each student requires to have a strictly higher score than the other two.</p> **Approach:** 1. For each student, identify the maximum score among the other two students. 2. Calculate the difference between this maximum score and the student's current score. If the stud...
For space complexity, we need to store each monster as a node in the linked list, which takes $O , To handle this efficiently, we use a circular doubly linked list. Since each monster has a left , You can use a linked list to handle the monsters insertion and removal, # Create and insert the new monster into the linked list new_monster = ListNode(next_index, head = ListNode(1, initial_ugliness) head.next = head # Make the list circular by linking the

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

143.
By A2SV_Group5, history, 2 years ago, In English
A2SV G5 — Round #42 (Special Round from Remote Team) Editorial [Here](https://codeforces.me/contestInvitation/b5c3d42e3e26e2846fbf6c7364baa94ae6654a52) is the link to the contest. The last two problems are from Codeforces' problemset. #### [A. Algorithm Test I](https://codeforces.me/gym/546592/problem/A) <spoiler summary = "Solution"> If we have $n$ distinct balloons, first we have $n$ choices to burst, then $n - 1$ and so on. Hence, totally we have $n!$ ways to burst the balloons. </spoiler> <spoiler summary="Code"> ```python3 from math import factorial N = int(input()) distinct_balloons = set(map(int, input().split())) n = len(distinct_balloons) print(factorial(n)) ``` </spoiler> #### [B. Algorithm Test II](https://codeforces.me/gym/546592/problem/B) <spoiler summary="Solution"> <p> Since there is frequent removal and insertion, a linked list (a doubly linked one) is a good fit for the solution. To keep track of the first occurrences of the numbers we can utilize a hashmap with queues as values. </p...
Since there is frequent removal and insertion, a linked list (a , instance of the first $y$, it will be as easy as manipulating pointers of the linked list., it from the linked list as well as the queue.

Full text and comments »

  • Vote: I like it
  • -1
  • Vote: I do not like it

144.
By dominique38, history, 9 months ago, In English
Beginner's Guide to Greedy _This blog post is a submission for the [Codeforces Month of Blog Posts Pt. III challenge](https://codeforces.me/blog/entry/149422). Thank you [user:cadmiumky,2026-02-10] for the initiative!_ This is how I wish I had been introduced to Greedy. Learning _how to prove_ is the truly valuable skill, one that I believe good Greedy problems test rigorously. ### **Introduction** After struggling with proofs for quite a while, there are a few things I realized. Greedy proofs are very dependent on the rules of the problem. Loosely speaking each optimization problem gives you observations, from those observations, you realize that if you take certain choices while avoiding all others, then it will always be optimal. That realization is termed **Greedy**. There are a lot of optimization problems, but only a small subset allows you to break the problem into smaller independent subproblems where solving them optimally leads to the best global answer. This property, known as Optimal Sub...

Full text and comments »

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

145.
By mtnshh, history, 6 years ago, In English
Divide by Zero 2021 and Codeforces Round #714 (Div. 2) [The Programming Club, IIT Indore](https://www.linkedin.com/company/progclub-iiti) is proud to present our flagship event, **Divide By Zero**! The contest will take place on [contest_time:1513]. This round will be rated for all participants with a rating lower than 2100. ![Divide By Zero 2021](/predownloaded/bd/91/bd91b097406e37c0d35b474bbf0d95b5a097d840.jpeg) Thanks to the following people for making the round possible: - [user:KAN,2021-04-10] for coordinating throughout the round. - [user:kalpitk,2021-04-10], [user:ajit,2021-04-10] and [user:7dan,2021-04-10] for setting the problems. - [user:dvshah,2021-04-10], [user:bhanushali,2021-04-10], [user:sundesh,2021-04-10], [user:AniketSangwan,2021-04-10], [user:krishanu21saini,2021-04-10], [user:somyamehta_24,2021-04-10] and [user:hk2102,2021-04-10] for their contribution to the problemset. - [user:Um_nik,2021-04-10], [user:dorijanlendvaj,2021-04-10], [user:chctxdy68,2021-04-10], [user:Osama_Alkhodairy,2021-04-10], [user:Scarle...
leaderboard! **Update**: Here is the list of winners who won T-shirts. We will contact you guys soon

Full text and comments »

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

146.
By red_coder, 15 years ago, In English
LINKED LIST below is the function for adding some number to the end of the linked list....... ~~~~~ int add_at_end(struct node **q,int num) { struct node *temp; if(*q==NULL) { temp= malloc(sizeof(struct node)); temp->data=num; temp->link=NULL; *q=temp; } else { temp=*q; while(temp->link!=NULL) { temp=temp->link; } r=malloc(sizeof(struct node)); r->data=num; r->link=NULL; temp->link=r; } return 0; } ~~~~~ now my question is what is the need of using double pointer for 'q' , why cant we do the same task using single pointer as below.... ~~~~~ int add_at_end(struct node *q,int num) { struct node *temp; if(q==NULL) { temp= malloc(sizeof(struct node)); temp->data=num; temp->link=NULL; q=temp; } else { temp=q; while(temp->link!=NULL) { temp=temp->link; } r=malloc(sizeof(struct node)); r->data=num; r->link=NUL...
LINKED LIST, ) { temp= malloc(sizeof(struct node)); temp->data=num; temp->link=NULL; *q=temp, ) { temp= malloc(sizeof(struct node)); temp->data=num; temp->link=NULL; q=temp; } else, below is the function for adding some number to the end of the linked list .......

Full text and comments »

  • Vote: I like it
  • -2
  • Vote: I do not like it

147.
By ko_osaga, history, 6 years ago, In English
[Gym] XXI Open Cup. Grand Prix of Korea Hello! I'm happy to announce XXI Open Cup. Grand Prix of Korea. * Contest link: [https://official.contest.yandex.ru/opencupXXI/contest/20794/enter](https://official.contest.yandex.ru/opencupXXI/contest/20794/enter) * Contest time: 2020/10/11 Sunday, 17:00 Korea Standard Time (UTC+9). For external accounts, the contest is ready now. * Division 1 Problemsetters: [user:ainta,2020-10-09], [user:jh05013,2020-10-09], [user:kdh9949,2020-10-09], [user:ko_osaga,2020-10-09], [user:tlwpdus,2020-10-09]. * Division 2 Problemsetters: [user:Diuven,2020-10-11], [user:etaehyun4,2020-10-11], [user:jh05013,2020-10-09], [user:jihoon,2020-10-11], [user:kdh9949,2020-10-09], [user:ko_osaga,2020-10-09] * **Codeforces Gym**: [Division 1](https://codeforces.me/gym/102759) [Division 2](https://codeforces.me/gym/102760) Special thanks to [user:xiaowuc1,2020-10-09] for revising our English. List of relevant previous contests: * [XVIII Open Cup. GP of Korea](https://codeforces.me/blog/entry/575...
Hello! I'm happy to announce XXI Open Cup. Grand Prix of Korea. * Contest link: [https

Full text and comments »

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

148.
By Rajveer_100, history, 5 years ago, In English
Building my own Custom Order-Statistic Tree using RB-Trees! Hey Guys! ========= I am really so happy to share my custom Order-Statistic Tree using Red Black trees, with the Select(x, i) and Rank(x)...which allow in finding the order statistic and the rank of the key element in log(n) time... Now I do know that PBDS in C++ does exist, but as a challenge I built this..with great hardwork..and also took reference from CLRS which helped me in understanding the working of this data structure... At first I actually encountered this problem in CSES named Josephus Problem, and that could be solved using Circular Doubly Linked Lists (in O(N) time) as well, but even O(NlogN) would suffice so I thought of doing so...A pretty fun experience in building own custom stuff, apart from the STL... Also wanted the opinion of you guys, on how can I improve my work or further make some new functionalities to it in the future, or even build more such data structures allowing iterators like begin() and end() for the same..As far as the debugging part I ...
solved using Circular Doubly Linked Lists (in O(N) time) as well, but even O(NlogN) would suffice so I

Full text and comments »

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

149.
By SecondThread, history, 4 years ago, In English
Meta Hacker Cup Shirts 2022 Meta Hacker Cup Shirts ================== The Hacker Cup Team has done a bunch of work over the past year to streamline the shirt claiming process, and we're excited for you to finally see what we've added. You can now see the Hacker Cup Prizes you've earned in the past (and the ones available to claim this year) on your profile, with tracking codes, links to claim them, and your claim codes built into the site. Emails this year will also be coming from us, rather than from our third party, which should help prevent them from being marked as spam. If you participated in Meta Hacker Cup this year and placed in the top 2000 of [Round 2](https://www.facebook.com/codingcompetitions/hacker-cup/2022/round-2), **you can now claim your shirt** on your [Hacker Cup profile page](https://www.facebook.com/codingcompetitions/profile). ![ ](https://wumbogames.github.io/cfPictures/listed_prizes.png) ![ ](https://wumbogames.github.io/cfPictures/shirts.png) You must claim your shirt b...
="Country List"> - Belarus - Central African Republic - Comoros - Cuba - Equatorial Guinea - Falkland

Full text and comments »

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

150.
By forgotter, history, 7 years ago, In English
Google FooBar challenge My friend [user:one_punch,2020-04-29] recently shared a Google foobar challenge referral with me. I've completed most levels of it and really liked few of those questions. (We can talk more on questions separately). Now, I myself have two more referrals to invite others. I have come up with idea that interested people (cf users) can fill up a form, so I could have a list of interested peoples. I'd sort the list in decreasing order of rating and one by one invite most of them. With only two referrals, how can I invite everyone? After **I send a referral to someone (on list), that person would send me one (new) referral back** and I will again be left with two referrals and this can keep going on until the list is exhausted or someone doesn't sends back a referral. Something about challenge:<br> Total levels : 5<br> Total questions : 1+2+3+2+1<br> Language : Java/ Python 2.7 (yes,it sucks!)<br> A referral is given after completing of level 2 and level 4.<br> After co...
Update: The list conatins 166 people. On average, the referral passes through 4 people in a day (So

Full text and comments »

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

151.
By competitive__programmer, 5 years ago, In English
DP on Trees Playlist Hello everyone After concluding my DP and Graph Theory playlist on YouTube, I just started a DP on Trees playlist where I plan to post my solutions to intermediate level DP on Trees problems from various sources every 2nd day during the month of July 2021. Here are the links to my playlists: [DP Playlist (18 problems discussed)] (https://www.youtube.com/playlist?list=PLzVLIdIx9dQxwAN5mMkzdvK2B4rV8879j) [Graph Theory playlist (12 problems discussed)] (https://www.youtube.com/playlist?list=PLzVLIdIx9dQwzso2IwXCQq3aEicK02iKF) [DP on Trees playlist (current)] (https://www.youtube.com/playlist?list=PLzVLIdIx9dQxCKaiktxELrtXtnItgAAIr) I have uploaded 2 tutorials on DP on Trees in case you are new to the topic: [Tutorial Part 1](https://www.youtube.com/watch?v=8cQryxznvwk) [Tutorial Part 2](https://www.youtube.com/watch?v=X0NdgO4KnVc) The problem list is as under: **1) Parsa's Humongous Tree (Round 722 Div 1 A Rated 1600)** [Problem Link] (https://codeforces....
: [DP Playlist (18 problems discussed)] (https://www.youtube.com/playlist?list

Full text and comments »

152.
By SummerSky, 10 years ago, In English
Solutions to Codeforces Beta Round #22 A, B, C, D, E A. Second Order Statistics This problem asks to find out the smallest element which is strictly larger than the minimum one. One simple way to solve this is to sort the array a[n] which stores the input data in an increasing order, and then find the first element that is different from a[0]. If such an element exists, then output this as the answer; otherwise output "NO" since all elements are exactly the same. B. Bargaining Table This is equivalent to finding out a rectangular which contains no '1's and has the largest perimeter at the same time. A trivial method is to check each feasible rectangular, i.e., enumerate the upper left point which takes O(mn) complexity and for each fixed upper left point, enumerate the bottom right point which takes O(mn) complexity as well, and finally check that whether this rectangular consists of only '0's or not, which takes O(mn) complexity. If it contains no '1's, then calculate the current perimeter and update the value of largest perime...
component but with only single direction, which is in fact a linked list, where s1 and ti denotes the, implement a DFS (a linked list as a special DFS), it turns out that we will surely end up with a, special linked list with only one node), and never forget to add such (si,ti).

Full text and comments »

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

153.
By cfalas, history, 7 years ago, In English
IOI vs CF performance: 2019 edition In response to blogs such as [this](https://codeforces.me/blog/entry/57700) and [this](https://codeforces.me/blog/entry/66211), I have made a similar graph for IOI 2019. I was interested in finding how I could expect to do if I qualified, and the only metric I have at the time is CF rating (since there isn't anywhere to submit the problems as of now) <spoiler summary="Spoiler"> not really, I was just bored of solving some more old OI problems. </spoiler> <spoiler summary="Spoiler 2"> I, wanted to post this before ratings change and I become pupil once again, so I had to do the extra effort of not only scraping stats.ioinformatics.org, but also ranking.ioi2019.az, since stats.ioinformatics.org didn't update to include the results of the contest. Edit: I forgot to post it last night, so I am green :( </spoiler> So, here it is: ![ ](https://i.ibb.co/f47cwFB/Figure-1.png) Here are some things to take into consideration: - A lot of the participants didn't have th...
linked CF account(!) - Mean ratings for each medal: (only with the ratings of the participants that

Full text and comments »

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

154.
By OmarAfterMidnight, history, 4 months ago, In English
A New Way to Practice Competitive Programming With Friends Hi Codeforces! I am [user:OmarAfterMidnight,2026-06-30], and together with [user:AdhamAfterMidnight,2026-06-30] we have been working on a project called **VoidHub**. During our preparation for the ECPC, [user:AdhamAfterMidnight,2026-06-30] and I were looking for a way to make practicing more exciting. We wanted something that would push us to solve more problems under real contest pressure while competing directly against each other. That is when we came up with the idea of building a platform for 1v1 programming battles using problems from Codeforces, Online Judge, and HackerRank. This experience genuinely brought back my motivation for competitive programming while helping us prepare for the ECPC in a much more enjoyable and competitive way. Today, I am happy to finally share the result: **VoidHub**. Website: [https://voidhub.co](https://voidhub.co) ## What is VoidHub? VoidHub is a real-time duel platform for competitive programming. You invite a friend, ch...
For Codeforces, the language list is fetched from the linked Codeforces session, so it matches the

Full text and comments »

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

155.
By cjquines, history, 9 years ago, In English
On designing a Codeforces shirt I heard about the Codeforces shirt design the day before the deadline, and I looked at the designs and they were almost all memes. I thought of making a serious design, since I am not good at memes. (I am also not good at comp prog.) Most programming shirts that I liked have nice abstract patterns based on algorithms, like the [Yandex.Algorithm 2015 shirt](http://codeforces.me/blog/entry/44549?#comment-293712). So I wanted to add a bunch of cool diagrams of algorithms. And I decided to use black, because, well, black is nice. I came up with the design of overlaying algorithms in the Codeforces logo, but I could not draw enough different diagrams, so I used three components. You can see the whole design here: #### Overall ![ ](https://i.imgur.com/mfFORa9.png) I was inspired by the typography of [Material Design](https://material.io/), as well as the [old Google Design](https://web.archive.org/web/20160207175056/https://design.google.com/). So I used [Roboto Mono](https://fo...
. 8. Binary tree. No binary tree in particular, just a regular old binary tree. 9.Linked list. This

Full text and comments »

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

156.
By cadmiumky, 11 months ago, In English
Codeforces Month of Blog Posts Pt. III (win $400) _This blog is inspired by ~peltorator,2025-12-22's [Month of Blog Posts](https://codeforces.me/blog/entry/110840) and ~bashkort,2025-12-22's [Month of Blog Posts Pt. II](https://codeforces.me/blog/entry/133806)_ **TL;DR:** Post an interesting Codeforces blog until February 11th and be eligible to win up to $400. #### Intro Like my predecessors, I think I like competitive programming. Not having the chance recently to be active within it lately, and given I expect to receive an unwarranted sum of money soon enough, I thought that it may be put to good use through such an investment, as I know myself I had multiple blog ideas I wish I'd published that I only came up with under the weight of the incentive. For this reason, I am putting up the sum of **$400** to contention. I've seen at least in the previous edition that distribution changed with the time, and acknowledging that I can't really predict the quality density of the blogs to come up, I mention I reserve the right ...
keep the winners list as short as possible. Additionally, if you want to contribute to this endeavor

Full text and comments »

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

157.
By shisukenohara, history, 2 years ago, In English
How I Came Up With A New Concept After Brainstorming For My University's Major Project ## **How Codeforces Helped Me Brainstorm a New Concept for My University's Major Project** Personally, I think [Leetcode](https://leetcode.com/) is great for getting started with DSA, [AtCoder](https://atcoder.jp/) is excellent for practicing specific algorithm implementations like Binary Search or DP, and then there’s **Codeforces**, which, for me, is perfect for brainstorming. ### **What Happened with My Major Project** So, a bit of context: I’m working on my University’s Major Project, which involves **[Blockchain](https://en.wikipedia.org/wiki/Blockchain)** and **[Artificial Intelligence](https://en.wikipedia.org/wiki/Artificial_intelligence)**. After presenting the [synopsis](https://en.wikipedia.org/wiki/Synopsis), the panellist told me: I should innovate or implement something that doesn’t exist yet or can improve existing technologies. But how do I innovate in a field as crowded as blockchain? It’s already a mature technology. But then I started to think about the c...
Normally, blockchains are like a single linked list. They’re just a long chain of blocks, one after

Full text and comments »

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

158.
By Errichto, 5 years ago, In English
[GYM] 100 Easy Problems (Bootcamp) Target audience: newbies and pupils (rating up to 1400). Group link: https://codeforces.me/group/yg7WhsFsAp/contests (hit "join" on the right). Hi. Enjoy a series of 8 problem lists for beginners. The example topics are strings, arrays, math, and binary search. You are allowed to discuss anything with others, or just look up solutions online. There are also 3 exams, each recommended for a 2-hour individual virtual participation. Use the displayed order, e.g. take exam 1 after day 3. It all should take you 2 weeks of intense bootcamp-like work (or a few months if you take your time). The problems were originally used two years ago in a Saudi Arabia camp. It's a mix of around 70 existing CF problems and 30 new original problems, mainly prepared by [user:kostka,2021-11-18], with some help from me and [user:mustafabar,2021-11-18]. I asked them for permission to publish everything. I will put hints to some problems in this blog (or in the group? not sure). Expect a few v...
Target audience: newbies and pupils (rating up to 1400). Group link: https://codeforces.com

Full text and comments »

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

159.
By niksmiljkovic, history, 9 years ago, In English
Mirror of Bubble Cup X Finals on Codeforces Hi Codeforces! It's our pleasure to announce the 10th edition of Bubble Cup. Bubble Cup is a programing competition organized by [Microsoft Development Center Serbia (MDCS)](https://www.microsoft.com/sr-latn-rs/mdcs), and will be held this weekend. Contest will take place on [Saturday, 2nd of September at 09:30 UTC](https://www.timeanddate.com/worldclock/fixedtime.html?day=2&month=9&year=2017&hour=9&min=30&sec=0), in Belgrade, Serbia. Live results will be available on [the official Bubble Cup website](http://bubblecup.org/CompetitorsCorner/Results/Live) (results will be frozen during the last hour of the competition). Winners will be announced at the closing ceremony. Just like the two previous editions, this final will be followed by an online mirror competition on Codeforces. Mirror will take place on [Sunday, 3rd of September at 10:00 UTC](https://www.timeanddate.com/worldclock/fixedtime.html?day=3&month=9&year=2017&hour=10&min=0&sec=0). Contest will last for 5 hours and ACM I...
[this link](http://codeforces.me/contest/852/standings).

Full text and comments »

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

160.
By Malomalomalomalo, 9 years ago, In English
Understanding Disjoint Set Structures Again, Im writing this both to help others and test myself so I will try to explain everything at a basic level. Any feedback is appreciated.<br> Disjoint Set(DS) data structures are representations of sets (which are all disjoint, sharing no elements) with certain functions: FindSet(x): finds the set of element x<br> UniteSets(x,y): unites the sets x and y<br> MakeSet(x): makes a set with element x<br> ***Disunion(list<elements>)***: removes all elements from other sets and makes a new set with these elements<br> (Note: the disunion operation is not as commonly used as the other operations and is not implemented efficiently, with an O(n) runtime.) DS is used in various algorithms, such as Kruskal's minimum spanning tree finder. This post will proceed with a naive implementation, and then progress to an efficient solution. <h2>The Naive Solution</h2> We construct a forest (group of disjoint trees). Each element has a parent node and a list of children. (The list o...
Lets look at their runtimes: FindSet : O(n), as in worst case the structure is a linked list

Full text and comments »

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

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

Full text and comments »

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

162.
By ICPCNews, 14 months ago, In English
The 2025 ICPC World Finals Baku Salam Codeforces! We are glad to invite you to follow the 2025 ICPC World Finals in Baku, Azerbaijan! <img alt="ICPC WF Baku" src="/predownloaded/e0/0c/e00c1cbead88d5c3243220a3b8331768ff4b7040.png" style="height: 300.0px;max-width: 100.0%;max-height: 100.0%;" align="center"> The event will mark the conclusion of the 2024–2025 ICPC season. Near the 140 university teams from different countries will join the finals. After many regional contests, they will now meet in Baku to fight for the title of ICPC World Champion at the 49th ICPC World Finals. The 2025 ICPC World Finals Baku will start on [September 4, 2025 at 11:00 (UTC+4)](https://www.timeanddate.com/worldclock/fixedtime.html?msg=The+2025+ICPC+World+Finals+Baku&iso=20250904T11&p1=369). We invite everyone to join the live broadcast of the biggest programming event of the year! Teams qualified to ICPC WF Baku: - [Official list](https://icpc.global/worldfinals/teams) - [Non-official list with CF rating](https://cod...
: - [Official list](https://icpc.global/worldfinals/teams) - [Non-official list with CF rating](https

Full text and comments »

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

163.
By BinaryBubble, history, 2 years ago, In English
YouKn0wWho's Topic List ### Hello guys! Most of you know about the legendary one stop CP Topic List created by [user:YouKn0wWho,2024-10-06] (for those who don't know can check it out [here](https://codeforces.me/blog/entry/129419)). Personally I'm not a fan of this cool UI in CP related things. I like it to be simple and it was too complex for my cyan brain to understand. (really personal opinion so don't jump on me for that :D) So what i did is i scraped the ultimate topic list and put it all in a spreadsheet for me and y'all to have it. Here's the link: [CP Topic List](https://docs.google.com/spreadsheets/d/1YfQz0RgE4AIgSyC_BVDLVfoeBUJYcUNxbd1VvQEfFFU/edit?gid=1486069146#gid=1486069146) (Jus make a copy and you'll be able to edit it as your personal sheet) Here's an SS of how my personal one looks like :P ![My Sheet](https://gcdnb.pbrd.co/images/VrirAgFQR6Gb.png?o=1) There's two things I'd also like you to know about this list. - You can **sort** everything by **Serial Number** ...
YouKn0wWho's Topic List, spreadsheet for me and y'all to have it. Here's the link: [CP Topic List ](https://docs.google.com, Here's the link: [CP Topic List](https://docs.google.com/spreadsheets/d

Full text and comments »

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

164.
By Baba, history, 6 years ago, In English
Indian Programming Camp 2020 Hi Everyone, I'm delighted to announce that we will be hosting Indian Programming Camp (IPC) &mdash; 2020 edition online from **November 20th &mdash; November 22nd**. The camp has **no charges** and anyone can **register** and attend. In the past, the IPC camp used to be conducted offline and was mainly targetted towards experienced IOI and ICPC aspirants. You can take a look at the [IPC 2016](https://www.youtube.com/playlist?list=PLi0ZM-RCX5nsTc2Z6woHr5qoF6n3b-thO) and [IPC 2017](https://www.youtube.com/playlist?list=PLi0ZM-RCX5nvImim3_ilsdLOtDDkOWt-X) playlists to get an idea of the format. This year, we are introducing three different tracks &mdash; Div3/Div2/Div1, catering to Beginner/Intermediate/Advanced programmers. Event: **Indian Programming Camp 2020** Dates: **November 20th &mdash; November 22nd, 2020** Platform: **[YouTube](youtube.com)** and **[Unacademy](https://unacademy.com/goal/competitive-programming/LEARNCP)** Tracks: **Div1/Div...
[IPC 2016](https://www.youtube.com/playlist?list =PLi0ZM-RCX5nsTc2Z6woHr5qoF6n3b-thO) and [IPC 2017

Full text and comments »

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

165.
By romanandreev, 11 years ago, translation, In English
Codeforces Round #342 (Div. 2) : editorial [problem:625A] ------------------ Idea author: collaboration, preparation: [user:feldsherov,2016-02-07]. If we have at least $b$ money then cost of one glass bottle is $b - c$. This means that if $a \leq b - c$ then we don't need to buy glass bottles, only plastic ones, and the answer will be $\left\lfloor\frac{n}{a}\right\rfloor$. Otherwise we need to buy glass bottles while we can. So, if we have at least $b$ money, then we will buy $\left\lfloor\frac{n - c}{b - c}\right\rfloor$ glass bottles and then spend rest of the money on plastic ones. This is simple $O(1)$ solution. [problem:625B] ------------------ Idea author: [user:gustokashin,2016-02-07], preparation: [user:thefacetakt,2016-02-07]. Lets find leftmost occurrence of the second word in the first one. We need to add # to remove this occurrence, so where we would like to put it? Instead of the last symbol of this occurrence to remove as many others as we can. After that we will continue this operation after the n...
board after the jump lets store double-linked list of all frogs sorted by their positions. Technical

Full text and comments »

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

166.
By linkyless, history, 2 years ago, In English
The Explanation Dilemma Hello Codeforces! Lately, I’ve become deeply immersed in the world of competitive programming. For me, at least, this has meant a commitment to studying every aspect of it in depth, with the goal of “learning it the right way.” Like many others, I began with the basics—identifying which problems to tackle, figuring out how to practice effectively, and learning how to keep my motivation up during the inevitable struggles. I grappled with questions like whether or not to read editorials. But as I delved deeper, I found myself contemplating broader questions: **How do we truly learn?** And perhaps more importantly, **how do we process and retain information** when we’re trying to master something as intricate as competitive programming? Like any curious person, I dove headfirst into this exploration, and I was surprised by the sheer volume of posts on this plataform that touch on this subject. There are masters who have ventured into the psychological depths, crafting entire article...
list twenty links to explanations that left me confused and frustrated. But I trust I’m not alone in

Full text and comments »

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

167.
By geranazavr555, history, 6 years ago, translation, In English
Latest innovations on Codeforces [January 2021] Hello everyone! The Codeforces team is working hard every day to improve the platform. Here's a quick overview of the latest innovations. ### Mashups deletion Until recently, there was no way on Codeforces to completely remove mashups you created. They stayed "hanging" in the interface and could get in the way if there were a lot of them. Now you can delete the mashups you created. To do this, go to the edit page: ![Edit page](/predownloaded/b7/9a/b79aa087d60620b74275f4c9ba96b43d90cc2e17.png) At the bottom of the page there will be a delete button: ![Delete button](/predownloaded/62/0e/620e4bf636efb22a7cb37ae9e55e85eac556feea.png) Deleting a mashup is reversible, meaning you can restore it if necessary. You can view deleted mashups by clicking on the link below the table with mashups. ### Other innovations - Added filter by contest format (IOI or ICPC) in mashups and gyms. - Compiler versions updated: Python 2 up to 2.7.18, Python 3 up to 3.9.1, Ruby up t...
, meaning you can restore it if necessary. You can view deleted mashups by clicking on thelink below the

Full text and comments »

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

168.
By thecodingwizard, history, 6 years ago, In English
USACO Guide: Curated Resources for Competitive Programming & USACO **11/7/2020 Update**: Now open sourced at https://github.com/cpinitiative/usaco-guide [![USACO Guide Banner](/predownloaded/cd/f4/cdf40be60dc184cc6d1cb18e13d508a2853f75eb.jpg)](https://usaco.guide/) Link: https://usaco.guide/ Recently, a group of experienced USACO contestants (led by the legendary [user:Benq,2020-07-21]) have put together a "USACO Guide" that's designed to take you from any division to Platinum and beyond. It can be accessed here: https://usaco.guide/. Though it's structured around USACO, it can still be used by non-USACO contestants! The guide provides a curated list of tutorial resources you can use to learn a particular topic, as well as a lot of practice problems for you to practice your implementation & application skills. It also comes with progress-tracking tools to help you stay motivated :) This guide is still in the **pre-release** stage: a large number of modules, particularly the more advanced ones, are still incomplete. **We are looking for ...
/) Link: https://usaco.guide/ Recently, a group of experienced USACO contestants (led by the

Full text and comments »

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

169.
By ZhangShan, history, 4 months ago, In English
50 CSES problems with animated editorial and Scriba — a renderer for editorials with animations ! **TL;DR:** I built **[Scriba](https://scriba.judge.zone)** — a free, open-source (MIT) renderer that turns a LaTeX editorial (math, prose, tables, code, **and step-by-step algorithm animations**) into one self-contained, sanitized HTML file. Animations are driven by real code, not hand-drawn frames. To see it on real problems right now: **[50 CSES problems](https://app.judge.zone/problems?tags=cses) where every editorial is explained with an animation** — open any of them and press play. Or write your own in the [playground](https://scriba.judge.zone/playground), no signup. ## Hello, Codeforces! If you've ever written an editorial — for a school contest, a gym, or just a detailed solution comment — you know the drill. The prose and the math are the easy part. Then you hit *"and now the DP table fills up like this"*, and you're hand-drawing cells in `Excalidraw`, screenshotting each state into `step1.png`, `step2.png`, … Then you find an off-by-one in your own explanation, an...
primitives:** array, DP table, matrix/heatmap, graph, tree, stack, queue, deque,linked list

Full text and comments »

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

170.
By Eyssant, history, 6 years ago, In English
Implementation of Linked List in PHP <p>A linked list is a linear data structure, which contains node structure and each node contains two elements. A data part that stores the value at that node and next part that stores the link to the next node as shown in the below image:</p> <div class="imgdiv"><img class="img-responsive" alt="Linked List Node" src="https://www.alphacodingskills.com/imgfiles/linked-list-node-link.PNG" ></div> <p>The first node also known as HEAD is usually used to traverse through the linked list. The last node (next part of the last node) points to NULL. The list can be visualized as a chain of nodes, where every node points to the next node.</p> <div class="imgdiv"><img class="img-responsive" alt="Linked List" src="https://www.alphacodingskills.com/imgfiles/linked-list.PNG" ></div> <h2><a href="https://www.alphacodingskills.com/cpp/ds/cpp-linked-list.php">Implementation of Singly Linked List</a></h2> <h2>Representation:</h2> <p>In PHP, singly linked list can be represented as a class and a No...

Full text and comments »

  • Vote: I like it
  • -12
  • Vote: I do not like it

171.
By SecondThread, history, 10 months ago, In English
Meta Hacker Cup Shirts 2025 - Claim before January 31st! Meta Hacker Cup Shirts ================== Hacker Cup shirts are back this year! If you placed in the top 2000 of [Round 2](https://www.facebook.com/codingcompetitions/hacker-cup/2025/round-2), you'll have a shirt available on your Hacker Cup Profile page. If you placed in the top 200 of [Round 3](https://www.facebook.com/codingcompetitions/hacker-cup/2025/round-3) and solved at least one problem correctly in that round, you'll win a shirt with a top-200 badge on the sleeve, instead of the normal shirt. ![ ](https://wumbogames.github.io/cfPictures/AvailableExample.png) ![ ](https://wumbogames.github.io/cfPictures/Shirts2025.png) You must claim your shirt by **January 31st**. We will not be shipping shirts claimed after the 31st. Due to regulations, Meta is also not able to support prize shipments to the following countries at this time: <spoiler summary="Country List"> - Belarus &mdash; Suspended - Central African Republic &mdash; Suspended - Comoros &mdash; Not Se...
support prize shipments to the following countries at this time:

Full text and comments »

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

172.
By ARSalman23, history, 3 years ago, In English
Some STL-related problems STL Vector 1. Sereja and Dima Link: https://codeforces.me/problemset/problem/381/A 2. Distinct Count Link: https://www.hackerearth.com/practice/data-structures/trees/binary-search-tree/practice-problems/algorithm/distinct-count/ STL String 1. String Task Link: https://codeforces.me/problemset/problem/118/A 2. The Palindrome Link: https://www.hackerearth.com/problem/algorithm/the-palindrome-2/ 3. Petya and Strings Link: https://codeforces.me/contest/112/problem/A 4. Haiku Link: https://codeforces.me/contest/78/problem/A 5. LexoGeek Link: https://www.hackerearth.com/problem/algorithm/lexogeek-e6450fb7/ 6. Dubstep Link: https://codeforces.me/problemset/problem/208/A 7. Pangram Link: https://codeforces.me/contest/520/problem/A STL Pair 1. Indian Summer Link: https://codeforces.me/contest/44/problem/A 2. Rank List Link: https://codeforces.me/problemset/problem/166/A 3. Games Link: https://codeforces.me/contest/268/problem/A...
2. Rank List Link: https://codeforces.me/problemset/problem/166/A

Full text and comments »

  • Vote: I like it
  • -17
  • Vote: I do not like it

173.
By Errichto, 5 years ago, In English
3 Hard Interactive Problems Hi. I think these are nice medium-hard interactive problems. I will discuss solutions in a stream today at https://www.twitch.tv/errichto. UPD, recording is here https://youtu.be/9oEihYrAR5kUPD and I added text solutions in this blog. P1. **Mostly A** &mdash; You're given two integers $N$ and $K$ ($N \leq 50\,000$, $K \leq 10$). You need to find a hidden string of length $N$ with lowercase English characters a-z. At most $K$ characters are different than 'a'. You can choose your own string of length $N$ and you will get info YES/NO whether your string is lexicographically smaller than the hidden one. There is no explicit limit on the number of queries. There's still some time limit (say, 2 seconds). Hard version: Minimize the number of queries. <spoiler summary="slow solution"> It seems reasonable to discover characters one by one from left to right. Let's say that we already know the prefix `raay` and we're looking for the fifth character. We can binary search it in $...
, say $X_0$. You need bignums! Let's imagine a huge list of sorted possible strings, indexed from

Full text and comments »

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

174.
By DELETED02, 16 years ago, translation, In English
Useful links <p class="MsoNormal"><span class="apple-style-span"><b style="mso-bidi-font-weight: normal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;; color:red;background:white;mso-ansi-language:EN-US">Hi everyone!</span></b></span><span class="apple-converted-space"><b style="mso-bidi-font-weight:normal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:red;background: white;mso-ansi-language:EN-US">&nbsp;</span></b></span><span class="apple-style-span"><b style="mso-bidi-font-weight:normal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:red;background: white;mso-ansi-language:EN-US">Here are the useful links of olympiad programming.</span></b></span><span class="apple-converted-space"><b style="mso-bidi-font-weight:normal"><span style="font-size:10.0pt;font-family: &quot;Arial&quot;,&quot;sans-serif&quot;;color:red;background:white;mso-ansi-language:EN-US">&nbsp;</span></b...
above in one list:

Full text and comments »

  • Vote: I like it
  • -8
  • Vote: I do not like it

175.
By marks39, 3 years ago, In English
All the algorithms/techniques I have used "I'm just in a mood to shitpost. Don't take it too seriously." -Um_nik #### Graphs - DFS - BFS - 0-1 BFS - Kruskal's - Dijkstra's - Bellman-Ford - 2-Coloring - Prim's - Floyd-Warshall - Johnsons - Ford-Fulkerson - Dinics - Edmonds-Karp - Level Graphs - SCC - 2VCC/2ECC - 2-Sat - Dominator-Trees - Hopcroft-Karp - Hungarian - MCMF - Top Sort - Blossom's - Eulerian Cycle - Hamiltonian Cycle - TSP - Functional Graphs - Augmenting Paths #### DP - Range DP - Divide and Conquer DP - Convex Hull Trick - Space Save - Alien Trick - Bitmask DP - State Switch - Digit Descent #### Strings - Hashing - KMP - Z-function - Trie - Aho Corasick - Suffix Automaton - Suffix Tree - Suffix Array - Eertree - Manachers #### Data Structures - Segment Tree - Prefix Sum - DSU - DSU Rollback - Treap - Binary Indexed Tree - Queue - Stack - Priority Queue - Linked List - Sets - Maps - Bitsets - Ordered Statisic Tree - Lazy Propagation - Li Chao...
Indexed Tree - Queue - Stack - Priority Queue - Linked List - Sets - Maps - Bitsets - Ordered

Full text and comments »

  • Vote: I like it
  • -17
  • Vote: I do not like it

176.
By yashdeora, history, 6 years ago, In English
Best Data Structures resources for learning competitive programming Basics of algorithm =================== 1. [What is an Algorithm explanation with an example](https://programmingoneonone.com/what-is-algorithm-in-programming.html) 1. [Algorithm Design and Analysis](https://datastructure.us/algorithm-design-and-analysis.html) 1. [Classification of algorithms](https://datastructure.us/classification-of-algorithms.html) 1. [Evaluating and Expressing an algorithm](https://datastructure.us/evaluating-and-expressing-algorithm.html) 1. [What is Data Structures and algorithms](https://programmingoneonone.com/what-is-data-structures-and-algorithms.html) 1. [How to calculate running time of an algorithm](https://programmingoneonone.com/how-to-calculate-running-time-of-an-algorithm.html) 1. [Worst, Everage and Best-case analysis of algorithm](https://programmingoneonone.com/worst-average-and-best-case-analysis-of-algorithm.html) 1. [Big o notation](https://programmingoneonone.com/big-o-notation.html) 1. [Big o notation examples](https://programmingone...
### Other types of linked list 1. [Merge two linked list ](https://programmingoneonone.com/merge, 1. [Linked list in data structures](https://programmingoneonone.com/linked-list -in-data, Circular linked list -------------------- 1. [Circular linked list in Data structure](https, Doubly linked list ------------------ 1. [Doubly linked list ](https://programmingoneonone.com, Linked list and its types ===========

Full text and comments »

  • Vote: I like it
  • -20
  • Vote: I do not like it

177.
By EnumerativeCombinatorics, history, 8 years ago, In English
Applying for PhD in CS: Is it possible for competitive programmers with no CS-related degrees? Hello, I am majoring in theoretical ecology at the University of Tokyo. I am scheduled to graduate from the current MSc program in March 2020, and I am planning to get in a Ph.D. program (outside Japan, due to financial and other problems). My interests are mathematical/computational biology/ecology, combinatorics, graph theory, exponential algorithms, etc. Currently, my biggest concern is that I have no CS degrees, or even something related to CS. I graduated from the University of Tokyo in ecology BSc. However, I have achievements and contributions in competitive programming area more than average (How 'more than average'? This is my list [Link](https://tozangezan.github.io/)). Is it possible for non-CS students with competition achievements like me to get in CS PhD program to research algorithms? How are the chances? Does it depend on schools or region? I have no one to ask about it because almost all the redcoders are CS or mathematics major, and especially in Japan, very ...
competitive programming area more than average (How 'more than average'? This is mylist [Link

Full text and comments »

178.
By elena, 13 years ago, translation, In English
How to add contest to Gym from Polygon By all appearances, most contests in "Gym" were not prepared via [Polygon](http://polygon.codeforces.com/). Nevertheless, someone might find it useful to read a little more instructions on creating a training contest from Polygon problems. You won’t need the Wizard for that. So, let’s assume that we have some contest prepared in Polygon, and each contest problem has a complete package. Let’s start with preliminaries on Polygon. 1. Grant "codeforces" user write access permissions to the contest. <BR/> <small> _The fastest strategy is as follows: add "codeforces" user to the list of Contest developers, then grant write access by using drop-down lists in the <B>Manage access</B> popup. Then you won't have to manage access in each individual problem._ </small> 2. For all problems, make complete packages containing the latest version of the problem. <BR/> <small> _Make sure that all problems have names and all other components (except for the Note): otherwise, a package c...
the list and its properties will be open to changes by clicking Edit link at the rightmost

Full text and comments »

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

179.
By T1duS, history, 5 years ago, In English
India ICPC — Gwalior-Pune 2020 Regionals Hi Codeforces, **ICPC Gwalior-Pune 2020 Regional Round will be held on [Codedrills](https://codedrills.io/) tomorrow.** **Contest Details** - Contest Link — [ICPC Gwalior-Pune 2020 Regional Round](https://codedrills.io/contests/icpc-gwalior-pune-2020-regional-round) - Date & Time — 18 August 2021, Wednesday, 18:00 IST - Duration — **4 Hours** - There is a ranklist freeze of 60 minutes. Ranklist will freeze at 21:00 IST. - There will be 10-13 questions to solve - Will follow standard ICPC scoring system (20 minutes penalty and 1 point per problem) - The problems may not be sorted by difficulty **Selection Criteria** - Top *few* teams will advance to World Finals <spoiler summary="Spoiler"> ![ ](https://i.kym-cdn.com/photos/images/newsfeed/001/462/400/978.jpg) </spoiler> **Clarifications** - Only ask the clarifications about the problems by messaging the [private clarification group via discuss](https://discuss.codedrills.io/g/clarifications). - Do not a...
://codedrills.io/) tomorrow.** **Contest Details** - Contest Link — [ICPC Gwalior-Pune 2020 Regional

Full text and comments »

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

180.
By jeroenodb, 4 years ago, In English
Twelve cool problems about binary search If you're looking for some binary search practice, this blog might be for you. I have compiled a list (I've heard lists are very popular on CodeForces) of some problems I really liked. The only criteria I used is that the solution for the problem has to be vaguely related to binary search. And I also tried to have some variety in the problems I chose, so they are not all the same type of application of binary search. Here are 12 problems, in a roughly increasing order of difficulty, that are vaguely (or less vaguely) related to binary search: 1. [problem:1672E] 1. [Median of two sorted arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/description/) Although the time limit doesn't enforce it, try to make a $O(log(n+m))$ solution. 1. [IOI 2013 Cave](https://oj.uz/problem/view/IOI13_cave) or if you prefer the Codeforces archive: [IOI 2013 Cave](https://codeforces.me/group/32KGsXgiKA/contest/103763/problem/D) 1. [IOI 2020 routers](https://oj.uz/problem/view/IOI20_...
list (I've heard lists are very popular on CodeForces) of some problems I really liked. The only

Full text and comments »

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

181.
By codex666, history, 6 years ago, In English
Is there any way to speedup the graph based solution to this CodeJam problem? Dear Brethren, I was trying out this Google CodeJam 2019 round 1A problem PYLON, https://codingcompetitions.withgoogle.com/codejam/round/0000000000051635/0000000000104e03#analysis I devised a DFS based backtracking solution, the problem is I donot know how to keep track of visited states in an efficient manner. The way I am doing is right now, I am starting from a random state and I am doing a DFS traversal and each time I push a node on to the stack I make sure it is not something we have already encountered on the path, by keeping track of a linked list! So for every update onto the I am doing a linked list traversal all the way to the root. I am able to solve test case 1, but cannot solve test case 2. Please suggest if it is possible to do the backtracking more efficiently. Thank you! ~~~~~ #include <bits/stdc++.h> typedef long long ll; using namespace std; struct Node { Node* par; pair<int, int> vl; int cnt; }; void tracePtr(Node* nd) { vector<pair<i...
something we have already encountered on the path, by keeping track of a linked list! So for every

Full text and comments »

  • Vote: I like it
  • -6
  • Vote: I do not like it

182.
By bihariforces, history, 15 months ago, In English
A WhatsApp Bot for Codeforces Analytics, Visualizations, and More Hello Codeforces community, ------------------ I wanted to share a useful WhatsApp-based AI assistant that might help with our competitive programming workflows. The idea is to bring essential tools directly into your chat, saving the time you'd spend switching between different websites. One of the most interesting features is its ability to generate a "true performance" graph for any user, which visualizes your performance rating in every contest. How to Use ------------------ Click the link to open a chat: [Whatsapp Chat Link](https://puch.ai/mcp/ycGISc7uVo) Send the pre-filled message that appears. The bot will then be active and you can start sending commands. Available Tools ------------------ Here is a list of its few functionalities. You can ask for them in natural language (e.g., "plot my rating graph" or "recommend a problem for me"). ###Analytics & Information `get_codeforces_user_stats`: Fetches detailed stats for one or more users. `recommend_problems`:...
the link to open a chat: [Whatsapp Chat Link](https://puch.ai/mcp/ycGISc7uVo) Send the pre-filled

Full text and comments »

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

183.
By Zlobober, 9 years ago, translation, In English
IOI 2017, first round <center><a style="font-size:20pt;" href="http://scoreboard.ioi2017.org/Ranking.html">Live Results</a></center> Hi everybody! I am writing this post from a sunny Tehran where the 29th International Olympiad in Informatics is being held. Me and Mikhail [user:Endagorion,2017-07-30] Tikhomirov are here as a part of Russian Federation delegation on the Olympiad. In about four hours the first round of the main competitive programming school student event of the year starts. Russian Federation is presented by one of the youngest team ever in the history of Russia on IOI consisting of:<br /> Vladimir [user:voidmax,2017-07-30] Romanov, Denis [user:Denisson,2017-07-30] Shpakovskiy, Alexandra [user:demon1999,2017-07-30] Drozdova and Egor [user:egor.lifar,2017-07-30] Lifar. In Russian version of this post me together with [user:Endagorion,2017-07-30] are going to make a text coverage of what is happening on the contest. We will mainly concentrate on Russian delegation there, so we ar...
information. - [List](http://stats.ioinformatics.org/contestants/2017) of the contestants according to the

Full text and comments »

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

184.
By kartik8800, history, 6 years ago, In English
Introduction to DP with Bitmasking Hello Codeforces! This series of videos are focused on explaining dynamic programming by illustrating the application of DP with bitmasking through the use of selected problems from platforms like Codeforces, Codechef, SPOJ, CSES and Atcoder. After going through this series, you should find yourself confident in solving problems which require the use of dp and bitmasks and also implementing them in a reasonable amount of time. I will also live code and submit the solutions to the problem on the coding platform from where the problem comes. Some Basic elements of Dynamic Programming ------------------ Some general ideas and my thoughts about DP to help you get started:<br> Part 1: [https://youtu.be/24hk2qW_BCU](https://youtu.be/24hk2qW_BCU)<br> 1. What is Divide and Conquer?<br> 2. What is Dynamic Programming?<br> 3. Types of DP problems.<br> Part 2: [https://youtu.be/yfgKw6BUZUk](https://youtu.be/yfgKw6BUZUk)<br> 1. What is a DP-state?<br> 2. Characterizing ...
how to solve and implement problems which use dp+bitmask concepts. Problem link: [statement

Full text and comments »

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

185.
By notsoawesome, history, 7 years ago, In English
useful links Tricks: [here](https://codeforces.me/blog/entry/57282)(Thanks to [user:Underdog_eagle,2020-04-13]) awesome list: [here](https://codeforces.me/blog/entry/23054)(Thanks to [user:lnishan,2020-04-13]) competitive programming tutorials: [here](https://www.topcoder.com/community/competitive-programming/tutorials/) a2oj: [here](https://www.a2oj.com/) problem classifier(spoj) :[here](http://problemclassifier.appspot.com/) code library :[here](http://code-library.herokuapp.com/) calendar :[here](https://www.hackerrank.com/calendar) about typing speed :[here](https://codeforces.me/blog/entry/23615)(Thanks to [user:Penguin,2020-04-13]) some intense templates : [here](https://codeforces.me/contest/611/submission/15119710)(Thanks to [user:MinakoKojima,2020-04-13]) Topic wise Coding Resources : [here](https://codeforces.me/blog/entry/23204) (Thanks to [user:hsk,2020-04-13]) Way to practice competitive programming :[here](https://codeforces.me/blog/entry/66909) (Th...
// Share this list and comment more useful links like this which needs serious attention of noob

Full text and comments »

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

186.
By SummerSky, 9 years ago, In English
Notes on Codeforces Beta Round #74, A, B, C, D, E(Orthogonal List) [problem:90A] There are at most 300 students, and thus we can directly simulate the whole process, i.e., what happens in each minute. The simulation terminates when no students are left. [problem:90B] The implementation is straightforward. We can enumerate each letter, and only those that appear exactly once in the corresponding row and column should be output. [problem:90C] An interesting problem. Suppose that $\Delta x$ elements are taken away. To guarantee that the $n-1$ sums keep the same, the changing quantity for each element must be $-\Delta x, \Delta x, -\Delta x, \Delta x,...$. Therefore, if $n$ is an even number, it is impossible to take away any elements, since the total sum can not be changed. For an odd number $n$, it can be seen that to take away $\Delta x$ elements, we have to carry out $\Delta x + \frac{n-1}{2}\times \Delta x=\frac{n+1}{2}\times \Delta x$ moves. For each minute, at most $m$ moves can be conducted, and thus $\Delta x \le \frac{2m}{n+1}...
Notes on Codeforces Beta Round #74, A, B, C, D, E(Orthogonal List)

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

187.
By nehl, 5 months ago, In English
I got tired of forgetting who my friends were on CF, so I built a tool to fix it. Hey Codeforces, A few months ago, I realised I had a really annoying problem. I was scrolling through the standings after a round, trying to see how my batchmates and a few seniors did, and I completely blanked on half their handles. Between keeping track of college friends, study groups, and a few friendly rivals across CF, AtCoder, and LeetCode, it was getting impossible to remember who was _xX_dragon_slayer_99_Xx_ and who was _math_wizard_007_. I was basically keeping a mental spreadsheet just to figure out who to discuss problems with. I couldn't find a good existing solution, so I decided to just build one for myself. It’s a Chrome extension called **Constellation**. Initially, I just built it to do one thing: swap out cryptic handles with real names right on the page. But as I kept using it, I kept adding little features that I found myself wishing I had during my own contest prep. I’ve been using it for a while now, and it’s honestly been such a massive quality-of...
- **A Master Directory:** The popup acts as a central hub. You can link a single person's CF

Full text and comments »

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

188.
By hyforces, 20 months ago, In English
TeamsCode Spring 2025 Virtual Programming Contest **UPD: The problems from the contest are available for upsolving at these links: [Novice Division Gym](https://codeforces.me/gym/105819) and [Advanced Division Gym](https://codeforces.me/gym/105818).** **UPD 2: The editorial for the contest can be found at [this link](https://codeforces.me/blog/entry/141840).** Hello Codeforces! [TeamsCode](http://teamscode.org) is excited to announce the [TeamsCode Spring 2025 Virtual Programming Contest](https://www.teamscode.org/contests/spring-2025)! It will take place on [**Saturday, April 05 from 11:00 AM to 5:30 PM Pacific Time / 2:00 PM to 8:30 PM Eastern Time**](https://www.timeanddate.com/worldclock/fixedtime.html?msg=TeamsCode+Spring+2025+Online+Programming+Contest&iso=20250405T11&p1=283&ah=6&am=30). **Teams of up to 4 members will have 3 hours to solve 12 problems.** There are two divisions: Novice and Advanced, so no matter what skill level you are, there is a place for you. The guest speaker event will feature Ion Barbus, a...
).** **UPD 2: The editorial for the contest can be found at [this link ](https://codeforces.com

Full text and comments »

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

189.
By Ahnaf.Shahriar.Asif, history, 9 years ago, In English
How to learn step by step to be a good programmer !!! Hello everybody , how are you ? Today I am going to describe some contents (programming) Which can be helpful for contestants. At first I assume that you all know about C/C++ language . But It doesn't matter . I think you also know about conditional logic , loop , datatype(input/output) , strings, array, function , basic bitwise operation etc . I think then you should learn lots of Mathematical terms such as : Prime number , GCD , LCM , Eular's Totirnt Function , Bigmod , Modular inverse , Extended GCD , combinatorics, permutation , combination , inclusion exclusion principle ,probability , Expected value , Base conversation , Big integer , cycle , Gawssian elimination etc etc........ **Then.....** you have to learn about sorting and searching . like : Insertion sort , bubble sort , merge sort , selection sort , merge sort , county sort etc . NOTE : THERE IS A THING NAMED "qsort" function is C language.....don't use it . There is an algorithm named "anti-qsort" . If you u...
you have a task to learn lots of data structures . Such as : Linked list , Stack,Queue,heap

Full text and comments »

190.
By Arpa, history, 7 years ago, In English
User List of ICPC World Finals 2020 Participants Hi. I used [this](https://codeforces.me/blog/entry/73791) blog and created a [user list](https://codeforces.me/blog/entry/21912) of ICPC World Finals 2020 participants. Here is the [link](https://codeforces.me/list/9b4768120f443743d66f19b000f3fc66). For example, you can use it for filtering the scoreboards. [Here](https://codeforces.me/contest/1320/standings?list=9b4768120f443743d66f19b000f3fc66) is the filtered scoreboard of yesterday's contest.
User List of ICPC World Finals 2020 Participants, Hi. I used [this](https://codeforces.me/blog/entry/73791) blog and created a [userlist](https, I used [this](https://codeforces.me/blog/entry/73791) blog and created a [user list](https

Full text and comments »

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

191.
By Ashishgup, 5 years ago, In English
India ICPC — Amritapuri 2020 Preliminary Round Hi Codeforces, **ICPC Amritapuri 2020 Preliminary Round** will be held on [Codedrills](https://codedrills.io/contests/icpc-amritapuri-2020-preliminary-round) today. ![ ](https://storage.googleapis.com/cdcontent/images/Amrita%20Banner.png) **Contest Details** * Contest Link — [ICPC Amritapuri 2020 Preliminary Round](https://codedrills.io/contests/icpc-amritapuri-2020-preliminary-round) * Date & Time — [7 August 2021, Saturday, 18:00 IST](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Amritapuri+Online+Round&iso=20210807T18&p1=438&ah=2&am=30) * Duration — **2.5 Hours** * There will be **6** problems to solve * Will follow standard ICPC scoring system (20 minutes penalty and 1 point per problem) * The questions may not be sorted by difficulty **Selection Criteria** * 700 slots are available for the regional (out of ~4400 teams registered for online round) * Top team from each institution is selected first, to compete in the regional round * Rest of the...
://storage.googleapis.com/cdcontent/images/Amrita%20Banner.png) **Contest Details** * ContestLink — [ICPC

Full text and comments »

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

192.
By RNR, history, 7 years ago, In English
Push Relabel Algorithm Tutorial The main difference between Augmenting path algorithms and Push-Relabel is that: - Augmenting path algorithms maintain a flow(capacity constraints and conservation constraints are valid) and augment it some s-t path in each iteration to increase its value. We iterate untill there exists no s-t path in the current residual network. - Push-Relabel algorithm takes a different approach, it works with pre-flow(conservation constraint is violated &mdash; the amount of flow into a vertex can exceed the amount of flow exiting it, the difference(`flow_in-flow_out`) in the amount present at that vertex is called excess, excess >= 0). This algorithm starts with a pre flow and terminates with an actual flow, eliminates all the excesses. We start with s-t disconnected and work towards a feasible flow. To eliminate excess at a vertex it has the following function: ~~~~~ Push(v): choose an outgoing edge (v, w) of v in Residual graph G_f (if any) // push as much flow as possible ...
these nodes will never be active.) If for every i we maintain linked lists of nodes with the

Full text and comments »

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

193.
By trekhleb, 8 years ago, In English
Algorithms and Data Structures in JavaScript Hello Readers! I've recently launched [JavaScript Algorithms and Data Structures](https://github.com/trekhleb/javascript-algorithms) repository on GitHub with collection of classic algorithms and data-structures implemented in ES6 JavaScript with explanations and links to further readings and YouTube videos. There is also [Algorithms and Data Structures YouTube playlist](https://www.youtube.com/playlist?list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8) that contains all the videos mentioned in that repository so you may just go and take this hand-made online learning course :) So I guess you've already grasp main idea of the project - ** helping developers to learn and practice algorithms and do it in JavaScript** . [cut] To make this process even smoother I've tried to put some **graphical illustrations** for each algorithm and data structure where it was possible just to make the idea behind those algorithms to be easily grasped and memorized. You also may find some practical i...
- Linked List - Queue - Stack - Hash Table - Heap - Priority Queue - Trie - Tree (Binary

Full text and comments »

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

194.
By goryinyich, 15 years ago, In English
Codeforces Beta Round #74 - Short editorial except Div. 1 E <p>Very strange contest. On the one hand - interesting problems, on the other hand - very disbalanced difficulty. To my mind, problem scoring should be the following:</p><div>Div. 1: 1000-1500-1500-1000-???</div><div>Div. 2: 500-500-1500-2000-2000</div><div><br></div><div>That's why I don't very like this contest. But, once again, problems were interesting, thanks to the author!</div><div><br></div><div>Now short editorial.</div><div><br></div><div>Problem A - Cableway (div. 2)</div><div>The only thing in this problem is to write expression for time of the arrival for final group of students of each color. This could be done with the following code:</div><div><div>ans = 30 + 3*((r+1)/2-1);</div><div>if (g) ans = max (ans, 31 + 3*((g+1)/2-1));</div><div>if (b) ans = max (ans, 32 + 3*((b+1)/2-1));</div></div><div><br></div><div>Problem B - African crossword (div. 2)</div><div>Due to the small restrictions, the problem could be solved with the straightforward O(n*m*(n+m)) algo of finding ...
To speed the process up, one can use linked lists to get next cell with chip in O(1). The more

Full text and comments »

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

195.
By striver_79, history, 8 years ago, In English
Help in Addition of two linked lists in O(1) Given 2 Linked Lists containing single digit as data representing number with most significant digit at head and least significant at the tail return the addition of both. The solution must not reverse the given linked lists and do it in O(n) time complexity and constant space complexity(Recursive solution will take O(n) space because of stack). For example: 9 -> 3 -> 2 -> 2 -> + 3 -> 4 -> 8 -> 3 -> = 1 -> 2 -> 8 -> 0 -> 5 . Can anyone help me out ?
Help in Addition of two linked lists in O(1), Given 2 Linked Lists containing single digit as data representing number with most significant, The solution must not reverse the given linked lists and do it in O(n) time complexity and constant

Full text and comments »

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

196.
By bashkort, 2 years ago, In English
LI2 Contests Announcement — Free Programming Course Hi everyone! I'm thrilled to invite you to the **LI2 Contest &mdash; free collection of high-quality contests to master every topic** &mdash; here, on Codeforces! [Group Link! Click here!](https://codeforces.me/group/jtU6D2hVEi/blog) ### Current avialibale list of topics: Loops; Prefix Sums; Sortings; Binary Search; Recursion; Sweepline; Two Pointers; Linear Data Structers (stack, queue, etc); Graphs, DFS, BFS; Dynamic Programming; DSU; Shortest Paths; Minimum Spanning Tree; Greedy; ... ### Why this course? I believe that finding high-quality problems is the hardest part of practice, especially when you are only getting your feet wet with competitive programming. There are many lectures and articles, but not so many open collections of problems for each topic. ### Time-tested I guarantee you that this course is time-tested, **I used it myself**. LI2 is short for Boarding Lyceum №2 in Kazan &mdash; the school I study in. So we've been using this course for...
-quality contests to master every topic** — here, on Codeforces! [Group Link! Click here!](https

Full text and comments »

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

197.
By GPT_Blogs, history, 3 years ago, In English
Mastering the Art of Competitive Programming: A Roadmap to Success **Introduction:** Competitive Programming (CP) is more than just solving problems; it's a journey of continuous learning, improvement, and mastering the art of algorithmic thinking. Whether you're a beginner or an intermediate coder, this blog aims to guide you through the steps to become proficient in Competitive Programming. **Understand the Basics:** Before diving into complex algorithms, ensure you have a solid understanding of the basics of programming languages, data structures, and algorithms. This forms the foundation for advanced problem-solving. **Choose the Right Language:** Select a programming language you are comfortable with and one that is widely accepted in the CP community. Common choices include C++, Python, and Java. Familiarity with your chosen language is crucial for efficient problem-solving. **Explore Data Structures:** Master essential data structures like arrays, linked lists, stacks, queues, trees, and graphs. Understanding when to use each struc...
**Explore Data Structures:** Master essential data structures like arrays, linked lists, stacks

Full text and comments »

  • Vote: I like it
  • -27
  • Vote: I do not like it

198.
By geniucos, history, 10 years ago, In English
Invitation to new OI style contest Info(1) Cup Hello everyone! I'm writing this entry to invite you all to take part in [the first edition of Info (1) Cup contest](http://info1cup.com/). It is an individual contest with algorithmic tasks and we will accept only C++ sources. The contest itself has 2 parts, both of which held online. **You can still take part in the online mirror in any frame of 5 hours before [time](https://www.timeanddate.com/countdown/generic?iso=20170412T15&p0=5121&msg=infO%281%29+Cup+International+Round+-+Online+Mirror+END&font=cursive&csz=1). We invite you all to participate. The tasks should be challenging for everyone The [live scoreboard](http://open.info1cup.com:8890/Ranking.html) of the online mirror is on.** PS: As in all the other contests that have online mirrors, I kindly ask you not to discuss the tasks until all the rounds and their online mirrors end. After that, on the official site, you'll find the editorials of the problems. The first one consists of a national contest in which only ...
international competitions to give them the link to the official registration form. Ohh and about the

Full text and comments »

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

199.
By Vladosiya, history, 3 years ago, In English
Codeforces Command Lines (2023-10-06) Hello, Codeforces! We've compiled a list of command lines that Codeforces uses to compile and run solutions in various languages and compilers. It is up-to-date as of today (2023-10-06), and we will make efforts to keep it current in the future, but this is not guaranteed. [cut]<br/> Language/Tool |Bitness|Compilation/Build Command |Run Command | |----------------------------------|-------|--------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------| |GNU GCC C11 5.1.0 |32 |gcc -std=c11 -static -DONLINE_JUDGE -fno-asm -lm -s -Wl,--stac...
Hello, Codeforces! We've compiled a list of command lines that Codeforces uses to compile and

Full text and comments »

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

200.
By rachitiitr, history, 9 years ago, In English
YouTube Playlist for Dynamic Programming Hi I have already released the playlist for Codechef August Long Challenge 2017 [here](https://www.youtube.com/playlist?list=PLfBJlB6T2eOskPRsFcdPTFnC2UcAyFrhq). A lot of coders face issues with DP as a beginner.. It can be very scary at first, and I understand that. This is my attempt where I have started a playlist on YouTube where in I will publish videos starting from beginner level, and slowly delve into complex yet interesting problems associated with Dynamic Programming. [DP Playlist Link](https://www.youtube.com/playlist?list=PLfBJlB6T2eOtMXgK3FLUTawHjzpIEySHF) [DP Tutorial Video Link](https://www.youtube.com/watch?v=tb_14w_-mNw) In my first video, I've taken a "E" level problem(its easy, but the contraints can be upgraded to make it tougher) from Codeforces and explained 1. The intuition behind the DP states. 2. How do we decide the DP states. 3. How do we find the DP recurrence relations. My next video for Dynamic Programmin...
[DP Playlist Link](https://www.youtube.com/playlist?list =PLfBJlB6T2eOtMXgK3FLUTawHjzpIEySHF

Full text and comments »

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

201.
By quasisphere, 11 years ago, In English
A short guide to suffix automata A short guide to suffix automata ================================ This is supposed to be a short intro to suffix automata &mdash; what they are, how they are constructed, and what can they do? It seems that people have had trouble finding an explanation in English (the most popular source mentioned is [e-maxx.ru](http://e-maxx.ru/algo/suffix_automata)). I don't speak Russian, so this will be mainly based on the paper [Automata for Matching Patterns](http://www-igm.univ-mlv.fr/~mac/REC/DOC/B4.ps) by Crochemore and Hancart. **Disclaimer:** I am not an expert in the subject, and I am yet to use the automaton in an actual competition. Comments and corrections are welcome! What is a suffix automaton? --------------------------- A **suffix automaton** $A$ for a string $s$ is a minimal finite automaton that recognizes the suffixes of $s$. This means that $A$ is a directed acyclic graph with an initial node $i$, a set of _terminal_ nodes, and the arrows between nodes are labeled ...
$ but there is no link forward to the next node 2. the next longest string in the class $q$ has the

Full text and comments »

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

202.
By Zlobober, 11 years ago, In English
Facebook Hacker Cup 2016 Round 2 Tomorrow (January 23rd) at 10:00 AM PST / 21:00 MSK there will be a second round of Facebook Hacker Cup. Don't miss! I still don't know how to get to the dashboard from the official page (http://facebook.com/hackercup) through the links. Can somebody of the officials that spend time on CodeForces teach me how do I get there in deterministic manner? Maybe a video tutorial? Or maybe you can just <s>make design compatible with human</s> put the big link to it somewhere on the main page? After all, it is the most important link people want to see on the competition page :( For those having the same headache with getting there, a link to the list of all rounds: [link](https://www.facebook.com/hackercup/past_rounds/). Let's discuss problems here.
For those having the same headache with getting there, a link to the list of all rounds: [link

Full text and comments »

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

203.
By slow_hare, history, 6 years ago, In English
Recursive Function to delete a Node in the linked list. ~~~~~ void del(node* &head, int val) { if (head == NULL) { cout << "Element not present in the list\n"; return; } if (head->info == val) { node* t = head; head = head->link; delete (t); return; } del(head->link, val); } ~~~~~ **Intuition:** - We are passing node* (node pointer) as a reference to the 'del' function (as in node* &head). - Suppose node containing 'val' is the first node, head = head->next changes the actual head in the main function which now points to the current beginning of the list (which was second node before deletion). - Deleting any other node, now since **current node* is derived from previous node's next** and previous node's next is passed by reference , thus we can say that the pointer being on the **current node can alter previous node's next**. - Thus when we do head = head->next means **previous node's next gets changed to head->next** w...
Recursive Function to delete a Node in the linked list., present in the list\n"; return; } if (head->info == val) { node* t = head, ** which is the required operation while deletion of a node in the linked list.

Full text and comments »

  • Vote: I like it
  • -28
  • Vote: I do not like it

204.
By Updown, 7 years ago, In English
Round #628 Video Solutions and Coaching I made video solutions to all the problems (A-F) of Round #628 which you can find in this playlist [here](https://www.youtube.com/playlist?list=PLTDB_sARFkANcjgcyUkrOR7_1UOwS_4vi) or using the links below. [Problems A and B](https://www.youtube.com/watch?v=NypbGDJzLqQ&list=PLTDB_sARFkANcjgcyUkrOR7_1UOwS_4vi&index=1) [Problem C](https://www.youtube.com/watch?v=esodAk_DDiw&list=PLTDB_sARFkANcjgcyUkrOR7_1UOwS_4vi&index=2) [Problem D](https://www.youtube.com/watch?v=Yb_cHZ67YPM&list=PLTDB_sARFkANcjgcyUkrOR7_1UOwS_4vi&index=3) [Problem E](https://www.youtube.com/watch?v=8QBSXGei06s&list=PLTDB_sARFkANcjgcyUkrOR7_1UOwS_4vi&index=4) [Problem F](https://www.youtube.com/watch?v=lCvprds-ZwM&list=PLTDB_sARFkANcjgcyUkrOR7_1UOwS_4vi&index=5) As a side note, with all my extra time from staying home, I'm coaching people who spend 6-10+ hours a week coding with targeted problems to improve rating. If you are interested, fill out [this form](https://docs.google.com/forms/d/e/1FAIpQLS...
[here](https://www.youtube.com/playlist?list =PLTDB_sARFkANcjgcyUkrOR7_1UOwS_4vi) or using the links

Full text and comments »

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

205.
By ko_osaga, history, 7 years ago, In English
[Gym] XX Open Cup. Grand Prix of Korea **Update 2019/11/07.** The contest is now in [Gym](https://codeforces.me/gym/102391). Thanks to [user:MikeMirzayanov,2019-11-07] for uploading it. Have fun! Hello! I'm happy to announce XX Open Cup. Grand Prix of Korea. * Contest link: [http://official.contest.yandex.ru/opencupXX/contest/14556/enter](http://official.contest.yandex.ru/opencupXX/contest/14556/enter) (Only visible for users with OpenCup login) * Contest time: 2019/10/13 Sunday, 17:00 Korea Standard Time (UTC+9). * Problemsetters: [user:ainta,2019-10-12], [user:Cauchy_Function,2019-10-12], [user:jh05013,2019-10-12], [user:ko_osaga,2019-10-12], [user:kriii,2019-10-12], [user:.o.,2019-10-12]. Thank you! * Testers: All problemsetters, [user:kdh_9949,2019-10-12], [user:InuyamaAoi,2019-10-12], [user:wxhtxdy,2019-10-12], [user:tzuyu_chou,2019-10-12], [user:xiaowuc1,2019-10-12], [user:chenjb,2019-10-12]. Thank you! List of relevant previous contests: * [XVIII Open Cup. GP of Korea](https://codeforces.me/blog/ent...
Cup. Grand Prix of Korea. * Contest link: [http://official.contest.yandex.ru/opencupXX/contest

Full text and comments »

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

206.
By 74TrAkToR, history, 2 years ago, translation, In English
Codeforces Round 954 (Div. 3) Hello! [contest:1986] will start at [contest_time:1986]. You will be offered 7 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 problems** and **2 hours and 15 minutes** to solve them. 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 standings table. As it is written by link, this is a compulsory measure for combating unsporting behavior. To qualify as a _trusted participant of the third d...
division will be included in the official standings table. As it is written by link, this is a

Full text and comments »

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

207.
By A2SV_Group6, history, 18 months ago, In English
A2SV G6 — Round #13 [Editorial] [Here](https://codeforces.me/contests/607625) is the contest link. All problems are from Codeforces' problemset except problem D. #### [A. Can I Get Your Number ?](https://codeforces.me/gym/607625/problem/A) <spoiler summary = "Hint1"> <p>We don’t have to check the common prefixes of all the given strings</p> </spoiler> <spoiler summary = "Hint2"> <p>We only need to find the longest common prefixes of the lexicographically smallest and largest strings among the given <b>n</b> strings.</p> </spoiler> <spoiler summary = "Solution"> <p> First let’s accumulate the given strings in an array and sort them. Then if a prefix is common for both the first and the last strings, then it’s known for sure that it’s also a prefix for all the strings in between as the array is in sorted order the strings are binary strings. We can use one for loop and check up to which point the first and the last strings are identical and that will be our answer. </p> <p></p> <p><b>Tim...
linked vertices reveals a fundamental cycle property. That is if vertices u and v are already

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

208.
By Ripatti, 15 years ago, translation, In English
Solutions for Coferorces Beta Round #81 <p><b>A</b>. (<a href="http://codeforces.me/contest/105/problem/A">link</a>) In this problem you should do just that is written in the statement. At the first you should read all skills and multiply all levels of them by koefficient $k$. Next you should drop all skills which have level less than 100. After that you should add all new skills from the second list but only those thah are not present in the second list. At the end you should sort all skills by thier names and output them.<br>[cut]<br>***<br><br>Problem with precision in this problem a bit shocked an author. This catch was not planned. Author's solution and all verifying solutions use integer arithmetic and think about probably problems didn't occur. In other side, it confirms following rule in the olympiad programming: be careful with comparation of floating numbers and if it is possible do it in integers.<br><br><b>B.</b> (<a href="http://codeforces.me/contest/105/problem/B">link</a>) Solution of this problem is search ...
A. (link <http://codeforces.me/contest/105/problem/A>) In this problem you

Full text and comments »

Announcement of Codeforces Beta Round 81
  • Vote: I like it
  • 0
  • Vote: I do not like it