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 errorgorn, history, 6 years ago, In English
Codeforces Round #723 (Div. 2) Editorial [problem:1526A] ------------------ Setter: [user:antontrygubO_o,2021-05-28] Preparer: [user:errorgorn,2021-05-28] <spoiler summary="Hint 1"> Notice that the array size is even length. Usually in such problems, we would split the array into $2$ equal parts. Can you figure out what those $2$ parts are? </spoiler> <spoiler summary="Hint 2"> We sort the array and split it into the big half and the small half. </spoiler> <spoiler summary="Solution"> The main idea is that we can split the numbers into the two halves, the big half and small half, we can place the bigger half at the odd positions and the smaller half at the even positions. This works because the smallest big number is larger than the biggest small number. Hence, the mean of any two small numbers is smaller than any big number, and the mean of any two big numbers is bigger than any small number. </spoiler> <spoiler summary="Code (C++)"> ```c++ //雪花飄飄北風嘯嘯 //天地一片蒼茫 #include <bits/stdc++.h> #inc...
Codeforces Round #723 (Div. 2) Editorial, $2a -1 \leq b$ and $n+a \leq 2b$. Therefore, $n+3a-1 \leq 3b$. Then, $\frac{n-1}{3} \leq b, Using algebra, $a-1 \leq b-a$ implies $2a -1 \leq b$ and $n+a \leq 2b$.

Full text and comments »

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

2.
By Vladithur, history, 2 years ago, In English
EPIC Institute of Technology Round Summer 2024 (Div. 1 + Div. 2) Editorial Hope you liked the problems! We apologize for the (very?) weak tests in H. Editorials for problems will be added over time (and hints), for now, please take a look at the available hints and model solutions. <spoiler summary="Easter eggs"> <spoiler summary="A"> ForceCodes is a reference CrossCode, you should try it. </spoiler> <spoiler summary="C"> Basil is one of the characters in OMORI, you should also try it. </spoiler> <spoiler summary="D"> "World is Mine" is one of Hatsune Miku's most well known songs, and a fan-made MV has a lot of cakes in it) I originally wanted to make the characters names Miku and Sweetheart(from OMORI), but decided to stick to Alice and Bob to keep the statement clean. </spoiler> <spoiler summary="E"> The epigraph is a reference to KonoSuba. </spoiler> <spoiler summary="H"> The epigraph is a quote from Celeste (you should try it), and the title is a reference to one of it's locations, Mirror Temple, but only now there are fumo...
EPIC Institute of Technology Round Summer 2024 (Div. 1 + Div. 2) Editorial, // Here, (2a - 1) + (2b - 1) + (2a - 1) = n int a = 3 * (n + 3) / 16; int y = min(ry, ly, ; } // Here, (2a - 1) + (2b - 1) + (2a - 1) = n int a = 3 * (n + 3) / 16; int y = min(ry

Full text and comments »

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

3.
By catalystgma, history, 2 years ago, In English
Exponential Length Substrings in Pattern Matching Hi all, I would like to share with you a part of my undergraduate thesis on a Multi-String Pattern Matcher data structure. In my opinion, it's easy to understand and hard to implement correctly and efficiently. It's (relatively) competitive against other MSPM data structures (Aho-Corasick, suffix array/automaton/tree to name a few) when the dictionary size is specifically (uncommonly) large. I would also like to sign up this entry to [user:bashkort,2024-10-04]'s [Month of Blog Posts](https://codeforces.me/blog/entry/133806):-) Many thanks to him and peltorator for supporting this initiative. #### Abstract This work describes a hash-based mass-searching algorithm, finding (count, location of first match) entries from a dictionary against a string $s$ of length $n$. The presented implementation makes use of all substrings of $s$ whose lengths are powers of $2$ to construct an offline algorithm that can, in some cases, reach a complexity of $O(n \log^2n)$ even if there are $O...
split $s$ like this, since any chain has length $O(\log n)$. <div style="text-align: center, <div style="text-align: center;">

Full text and comments »

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

4.
By _Seele_Vollerei_, history, 4 months ago, In English
Report: Contest-Time Solution Hints Linked to NotOnlySuccess I am writing this blog to report a competitive-integrity issue involving the Codeforces user [user:NotOnlySuccess,2026-08-09] and a website associated with their content. The main issue is simple: **problem-specific solution material and hints for an ongoing Codeforces contest were made available before the contest ended.** # 1. Solution material published before the contest ended During [Codeforces Round 1116 (Div. 1, Div. 2)](https://codeforces.me/blog/entry/155668), an article titled [CF Round 1116 (Div. 1+2)](https://mp.weixin.qq.com/s/P3QJqmQFRsLlW9GX_y_8YQ) was published on a WeChat public account at August 10, 2026, 00:37 (UTC +8). The Codeforces contest ended at August 10, 2026, 01:05 (UTC +8). Therefore, the article was publicly available **28 minutes before the contest ended**. ![ ](/predownloaded/e5/8e/e58ea523bd7a61b7bdd20d83d2d16a0672f1cca0.png) The article already contained problem-specific solution material. For readers who do not understand Chinese...
Chinese, here is a direct translation of the relevant part of the article for **Div. 2A — Three Numbers on, article for **Div. 2A — Three Numbers on the Blackboard**:

Full text and comments »

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

5.
By wuhudsm, history, 16 months ago, In English
Codeforces Round 1040 (Div. 1, Div. 2) Editorial Thank you for participation and we hope you enjoy this round :) <spoiler summary="How did you find the contest?"> - Great: - Good: - Average: - Bad: - Trash: </spoiler> <spoiler summary="Which problem is your most favourite?"> - D2A: - D2B: - D1A: - D1B: - D1C1: - D1C2: - D1C3: - D1D: - D1E: - D1F1: - D1F2: </spoiler> <spoiler summary="Which problem you hate the most?"> - D2A: - D2B: - D1A: - D1B: - D1C1: - D1C2: - D1C3: [likes:favorite,2039E3_...
Codeforces Round 1040 (Div. 1, Div. 2) Editorial, Amazing problem: , (); } ``` Amazing problem: , Bad problem: , Didn't solve: , Good problem:

Full text and comments »

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

6.
By Geothermal, history, 7 years ago, In English
Codeforces Round #644 (Div. 3) — Unofficial Solutions Hi all! I'm here to share my solutions to today's Div. 3 round, since I managed to finish the round relatively quickly and thought that my approaches might be of some use to others. Feel free to leave questions in the comments! --- #A &mdash; Minimal Square Without loss of generality, let's say $A \leq B$, that is, $B$ is the larger side-length. We claim that the minimum side length is $\max(2A, B)$, hence, the answer is $\max(2A, B)^2$. This is relatively easy to observe just by looking at the sample cases and trying different configurations, but I'll prove this claim below in case you're curious. To prove this, we first show that $\min(2A, B)$ is a valid side-length. To achieve this, just stack the two rectangles on top of each other, with the two short sides stacking vertically and the long sides overlapping. (This looks much like the solution given in the problem statement for the second test case.) The vertical side-length of the block formed will be $2A$, and...
Codeforces Round #644 (Div. 3) — Unofficial Solutions, that the minimum side length is $\max(2A, B)$, hence, the answer is $\max(2A, B)^2$. This is, -length must also be greater than $2A$ through messy casework, so the side-length must be at least $\max, Hi all! I'm here to share my solutions to today's Div. 3 round, since I managed to finish the, Since a side-length of $\max(2A, B)$ is both attainable and optimal, our answer is $\max(2A, B)^2, To prove this, we first show that $\min(2A, B)$ is a valid side-length. To achieve this, just

Full text and comments »

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

7.
By GlebsHP, history, 11 years ago, translation, In English
Codeforces Round #327 problems analysis I like the idea of [user:Endagorion,2015-10-25] to supplement the problems analysis with small challenges, somehow related to the problem preparation, it's generalization, or more effective solution. Following this, some problems in this analysis are also complemented with this sort of tasks. Div. 2A (Wizards' Duel) ------------------ Idea of the problem: Roman Gusarev, development: [user:timgaripov,2015-10-25]. Let's start with determining the position of the first collision. Two impulses converge with a speed $p + q$, so the first collision will occur after $\frac{L}{p + q}$ seconds. The coordinate of this collision is given by the formula $x_1 = p \cdot \frac{L}{p + q}$. Note, that the distance one impulse passes while returning to it's caster is equal to the distance it has passed from the caster to the first collision. That means impulses will reach their casters simultaneously, and the situation will be identic to the beginning of the duel. Hence, the second collision ...
предложить читателю подобные вопросы по некоторым задачам. Div. 2A (Поединок волшебников, . Div. 2A (Wizards' Duel) ------------------ Idea of the problem: Roman Gusarev, development, Div. 2A (Wizards' Duel) ------------------ Idea of the problem: Roman Gusarev, development

Full text and comments »

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

8.
By djm03178, 2 years ago, In English
Div. 2 C's are NOT getting easier Recently, after like every Div. 2 contest I see some blogs/comments saying that ~2C problems are getting easier. What's the evidence? They say these problems have _many_ solves. No, I think it's the opposite. Definite number of solves is not a good measure for evaluating the difficulty. A not too precise, but statistically more reliable way to evaluate the difficulty of a 2C problem would be calculating `(# of official solves on C) / (# of official solves on A)`, assuming that most people have always been able to solve 2A. Let's calculate them for recent 10 Div. 2-only contests' (not counting Educational rounds) C problems: - [contest:1993] : 6755/19951 (33.86%) - [contest:1995] : 2384/13980 (17.05%) - [contest:1990] : 3490/11867 (29.41%) - [contest:1988] : 7239/12234 (59.17%) - [contest:1983] : 5504/16414 (33.53%) - [contest:1982] : 7654/14965 (51.15%) - [contest:1978] : 5115/12031 (42.52%) - [contest:1979] : 9051/17663 (51.24%) - [contest:1981] : 1128/10942 (10.31...
Div. 2 C's are NOT getting easier, been able to solve 2A.

Full text and comments »

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

9.
By Pyqe, 3 years ago, In English
Codeforces Round #902 (Div. 1, Div. 2, based on COMPFEST 15 — Final Round) Editorial ## [2A](https://codeforces.me/contest/1877/problem/A). Goals of Victory Author: [user:nandonathaniel,2023-10-08] Developer: [user:nandonathaniel,2023-10-08] <spoiler summary="Tutorial"> [tutorial:1877A] </spoiler> ## [2B](https://codeforces.me/contest/1877/problem/B)/[1A](https://codeforces.me/contest/1876/problem/A). Helmets in Night Light Author: [user:ArvinCiu,2023-10-08] Developer: [user:gansixeneh,2023-10-08] <spoiler summary="Tutorial"> [tutorial:1876A] </spoiler> ## [2C](https://codeforces.me/contest/1877/problem/C). Joyboard Author: [user:Pyqe,2023-10-08] Developer: [user:gansixeneh,2023-10-08] <spoiler summary="Tutorial"> [tutorial:1877C] </spoiler> ## [2D](https://codeforces.me/contest/1877/problem/D)/[1B](https://codeforces.me/contest/1876/problem/B). Effects of Anti Pimples Author: [user:Pyqe,2023-10-08] Developer: [user:Pyqe,2023-10-08] <spoiler summary="Tutorial"> [tutorial:1876B] </spoiler> ## [2...
Codeforces Round #902 (Div. 1, Div. 2, based on COMPFEST 15 — Final Round) Editorial, ## [2A](https://codeforces.me/contest/1877/problem/A). Goals of Victory

Full text and comments »

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

10.
By JaySharma1048576, 3 years ago, In English
Codeforces Round 921 (Div. 1, Div. 2) Editorial I hope you enjoyed the round. Here is the editorial. Do provide your feedback on each problem so that we can improve upon them the next time. #### [2A. We Got Everything Covered!](https://codeforces.me/contest/1925/problem/A) Author: [user:JaySharma1048576,2024-01-27] <spoiler summary="Hint 1"> The smallest length for such a string is $n\cdot k$. </spoiler> <spoiler summary="Tutorial"> The smallest length possible for such a string is $n\cdot k$. <spoiler summary="Why?"> To have the string $\texttt{aaa}\ldots\texttt{a}$ as a subsequence, you need to have at least $n$ characters in the string as $\texttt{a}$. Similarly for all $k$ different characters. So, that gives a total length of at least $n\cdot k$. </spoiler> In fact, it is always possible to construct a string of length $n\cdot k$ that satisfies this property. One such string is $(a_1a_2a_3\ldots a_k)(a_1a_2a_3\ldots a_k)(a_1a_2a_3\ldots a_k)\ldots n$ times where $a_i$ is the $i^{th}$ letter of English alph...
Codeforces Round 921 (Div. 1, Div. 2) Editorial, This problem is essentially "Implement the checker for Div. 2A". It, #### [2A. We Got Everything Covered!](https://codeforces.me/contest/1925/problem/A) Author, ="Fun fact"> This problem is essentially "Implement the checker for Div. 2A". It was not among the

Full text and comments »

11.
By omsincoconut, 21 month(s) ago, In English
Codeforces Round 1008 (Div. 1, Div. 2) Editorial I hope everyone enjoyed the tasks, and thank you for participating. Thank you to the coordinators and testers for suggesting solutions and modifications to the tasks, as I alone wouldn't be able to solve my own tasks or make it to how it is right now. Also thank you to them for dealing with me since July. Please tell me in the comments if the editorial is written incorrectly or unintelligibly somewhere. I'm not the best at phrasing some things, and would appreciate amendments to the editorial. [problem:2078A] <spoiler summary="Hint"> Something doesn't change after each operation. </spoiler> <spoiler summary="Solution"> The average of the entire array doesn't change after each operation. Simply check whether the average value of $a$ is $x$ or not. Time complexity: $\mathcal{O}(n)$ per test case. Submission: [submission:310297520] </spoiler> [problem:2078B] <spoiler summary="Hint 1"> Try to put as many people in cell $n$ as possible. </spoiler> <spoile...
Codeforces Round 1008 (Div. 1, Div. 2) Editorial, originally proposed as a Div. 2 only. It was changed to Div. 1 + Div. 2 because we found task 1G, which, - 1A/2C was proposed as 2A., - 2B was proposed as 2A.

Full text and comments »

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

12.
By Gheal, 5 years ago, In English
Infoleague Spring 2022 Round Editorial <spoiler summary="Vote your favourite problem"> <spoiler summary="Div 2"> Div 2A &mdash; The Hatchet Div 2B &mdash; Floor Or Xor Div 2C &mdash; Yet Another Constructive Problem Didn't participate, idc </spoiler> <spoiler summary="Div 1"> Div 1A &mdash; Bamboo Coloring Div 1B &mdash; Xor Or Floor Div 1C &mdash; Jump Didn't participate, idc </spoiler> </spoiler> [103633A &mdash; The Hatchet](https://codeforces.me/gym/103633/problem/A) ------------------ Author: [user:tibinyte,2022-03-30] <spoiler summary="Rate Problem"> 1700 or less 1800 1900 2000 2100 or more Didn't solve it, idk </spoiler> <spoiler summary="Solution"> ### Subtask 1 : $N \le 10^2$ This subta...
Div 2A

Full text and comments »

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

13.
By 123gjweq2, 3 months ago, In English
Is this a good problem + can you please help me gauge its difficulty? The other day I came up with a problem and I'd appreciate some honest feedback as to whether or not it's a good (enjoyable/interesting) problem. I'd also appreciate it if you could gauge its difficulty by voting below. And I'd appreciate any feedback. **Problem Statement:** You are given an integer $n$ where $1 \le n \le 2000$. Consider a square grid with $n$ rows and $n$ columns. You are tasked with arranging the first $n^2$ whole numbers (that is, the integers $0, \,1, \,2 \,...\, n^2 - 3,\,n^2 - 2,\,n^2 - 1$) inside the grid, with exactly one number on each cell of the grid. A frog starts in the bottom-left cell of the grid. The number of the cell the frog is currently on will tell the frog a magnitude and a direction to jump. Specifically, say the frog is at a cell that contains the number $a$. The frog will then jump a magnitude of $\lfloor \frac{a}{4} \rfloor + 1$ units in the direction of $a \mod 4$. As for the direction, let a value of $0$ represent a jump to the...
div $2A$

Full text and comments »

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

14.
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...
Codeforces Round 983 (Div. 2) Editorial, Given four integers $a \le b \le c \le d$, if $(a, b, d)$ are side, Imagine that you have $x$ white socks and $y$ black socks. What would, Try to find a solution with $k = 2$ and $k = 4$, assuming $n$ allows, ? Imagine that you have $x$ white socks and $y$ black

Full text and comments »

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

15.
By dapingguo8, 8 months ago, In English
Codeforces Round 1092 (Div. 1, Div. 2, Based on THUPC 2026 — Finals) Editorial We apologize for both the late editorial and the statement leaking issues. Unfortunately, as the problem authors, we never had any chances to prevent the leaking. Still, feel free to downvote if you have dissatisfaction due to these. But what so ever, we hope you can enjoy the problems. [problem:2216A] Idea by [user:Warriors_Cat,2026-04-13] <spoiler summary="Solution"> The method is simple: for $i = k, k - 1, \dots, 1$ successively, we adjust the courses at the $i$-th level of course wish one by one directly to the $(k+1)$-th level. It is easy to check that the adjustment is valid. The number of steps is at most $nk \le 1000$. </spoiler> <spoiler summary="Code(C++)"> ~~~~~ #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <cstdlib> using namespace std; #define ll long long #define rep(i, x, y) for(int i = x; i <= y; ++i) #define per(i, x, y) for(int i = x; i >= y; --i) inline int read(){ int x = 0, f = 1; cha...
Codeforces Round 1092 (Div. 1, Div. 2, Based on THUPC 2026 — Finals) Editorial, $\sqrt{2}$. Let the final answer be $a+b\sqrt{2}$; we then output $2a+3b$, and it is easy to verify, Let the final answer be $a+b\sqrt{2}$; we then output $2a+3b$, and it is easy to verify that this

Full text and comments »

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

16.
By stas_sl, 4 years ago, In English
Round #874 (Div. 3) — some statistics <img src="/predownloaded/07/e7/07e7ad4bd50ecd89752d2201070960f87acefb9f.png" style="width: 400px; margin-left: auto; margin-right: auto; display: block;" /> <img src="/predownloaded/63/d3/63d3ccc84aebe979404ee105d95a91645e46ea73.png" style="width: 600px; margin-left: auto; margin-right: auto; display: block;" /> <img src="/predownloaded/2b/41/2b41f20a0f1a1b0b8a6417c865fd34e0ea3df15e.png" style="width: 500px; margin-left: auto; margin-right: auto; display: block;" /> <img src="/predownloaded/14/57/14573f4a4eb09902aaea95330179bfd69f030b4d.png" style="width: 600px; margin-left: auto; margin-right: auto; display: block;" /> <img src="/predownloaded/86/c9/86c914a818132252f07b043cbf67026414d9ab4f.png" style="width: 600px; margin-left: auto; margin-right: auto; display: block;" /> <img src="/predownloaded/26/66/2666fb43ad8e9337d9cceed2aadbff3113be3917.png" style="width: 700px; margin-left: auto; margin-right: auto; display: block;" /> <img src="/predownloaded/81/63/8163a5bb9ae...

Full text and comments »

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

17.
By diskoteka, 3 years ago, translation, In English
Codeforces Round #885 (Div.2) Editorial [problem:1848A] Idea: [user:diskoteka,2023-07-16] <spoiler summary="Tutorial"> [tutorial:1848A] </spoiler> <spoiler summary="Solution"> ~~~~~ #include <bits/stdc++.h> using namespace std; #define int long long int32_t main() { int t; cin >> t; while (t--) { int n, m, k; cin >> n >> m >> k; int x, y; cin >> x >> y; string ans = "YES\n"; for (int i = 0; i < k; ++i) { int xx, yy; cin >> xx >> yy; if ((x + y) % 2 == (xx + yy) % 2) { ans = "NO\n"; } } cout << ans; } return 0; } ~~~~~ </spoiler> [problem:1848B] Idea: [user:diskoteka,2023-07-16] <spoiler summary="Tutorial"> [tutorial:1848B] </spoiler> <spoiler summary="Solution"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n, k; cin >> n >> ...
Codeforces Round #885 (Div.2) Editorial, Codeforces Round #885 (Div.2) Разбор, ) * (k - 4x) // (-80)x^2 + (20k - 4s)x + (sk) // -b/2a = (5k-s)/40 int x = (5 * k - s, ) { // (s + 20x) * (k - 4x) // (-80)x^2 + (20k - 4s)x + (sk) // -b/2a = (5k-s)/40 int x, /2a = (5k-s)/40 int x = (5 * k - s) / 40; x = min(x, k / 4); int res = s * k; if

Full text and comments »

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

18.
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...
difficulty: Level 1: Div 2A Level 2: Div 2B Level 3: Div 2D Level 4: Div 2E, Estimated difficulty: Level 1: Div 2A Level 2: Div 2B Level 3: Div 2D Level 4

Full text and comments »

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

19.
By specia1, history, 5 months ago, In Russian
Пошаговый разбор для новичков. Order Capital Round 2 (Codeforces Round 1104, Div. 1 + Div. 2) Всем Привет! ![ ](/predownloaded/92/d1/92d185b9a970affe38f3d3b1f1660b5a3a7e8055.png) Меня зовут Максим и я очень давно хочу достичь рейтинга 3000. Я верю, что для этого мне надо научиться мыслить, как человек, у которого уже есть 3000 рейтинга. Очень часто в разборах пишут фразы "заметим, что..." или "докажем вот такой факт..." и дальше идет долгое доказательство этого факта. А то, каким образом я должен к этому факту прийти, как эта мысль должна зародиться у меня в голове, никто нигде не пишет. Я думаю, что не только у меня есть эта проблема, поэтому вместо того, чтобы ждать понятный разбор, я решил начать с себя. Именно поэтому, я решил написать пошаговый разбор, где я буду описывать ход своих мыслей и действий, которые позволяют мне придумать эти самые идеи. Также, я создал группу по прокачке навыков спортивного программирования для людей с рейтингом 1200- , чтобы помочь им стать лучше и достигнуть рейтинга 1500+. Если хотите больше об этом узнать, рекомендую прочитать [ЭТО...
Пошаговый разбор для новичков. Order Capital Round 2 (Codeforces Round 1104, Div . 1 +Div. 2), мы хотим, чтобы $a + a = b, b + b = a$, то есть $2a=b,2b=a$. Что тогда? , ; число, на которое мы заменим единицы. Тогда мы хотим, чтобы $a + a = b, b + b = a$, то есть $2a=b,2b

Full text and comments »

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

20.
By aropan, 15 years ago, translation, In English
Codeforces Beta Round #92 - Analysis <div align="center"><b>Div-2. [[problem:124A]]</b><br /><div align="left">Let's iterate through the each item and check whether it is appropriate to the conditions $a \le i-1$ and $n - i \le b$ (for $i$ from $1$ to $n$). The first condition can be converted into $ a +1\le i$, and the condition $n - i \le b$ in $ n - b \le i$, then the general condition can be written $ max (a +1, n-b) \le i$ and then our answer can be calculated by the formula $ n-max (a +1, n-b) +1 $.<br />[[submission:835581,The author's solution]]<br /></div></div><div align="center"><b><br />Div-2. [[problem:124B]]</b><br /><div align="left">Let's try all possible ways to rearrange digits in the numbers and check the difference between maximum and minimum number.<br />[[submission:835584,The author's solution]]<br /></div></div><div align="center"><b><br />Div-1. [[problem:123A]]<br />Div-2. [[problem:124C]]</b><br /><div align="left">All positions except the first and those whose number is a prime greater $|s| / 2...
<div align="center"> Div-1. [[problem:123B]] Div-2. [[problem:124D]], <div align="center">Div-2. [[problem:124A]] <div align="left">Let's iterate through the, <div align="center">Div-2. [[problem:124A]] div>Можно было перебирать каждую позицию

Full text and comments »

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

21.
By Bufu, 4 months ago, In English
Codeforces Round 1115 (Div. 2) Editorial Thank you for participating in Codeforces Round 1115 (Div. 2)! We hope you enjoyed the problems. The round was prepared by [user:Bufu,2026-08-06] and [user:TomitaMatei,2026-08-06], and coordinated by [user:cry,2026-08-06]. --- #### [problem:2252A] <spoiler summary="Solution"> The boss's shield permanently activates and blocks all subsequent damage only when two cards of the exact same value are played back-to-back. Importantly, the card that actually triggers the shield still deals its normal damage. This means we want to play as many cards as possible *before* being forced to place two identical cards adjacent to each other. We should only do this on the very last card we play. Let the most frequent card in our hand have a damage value of $X$, and let its frequency be $F$. Let the number of all *other* cards be $O = n - F$. To maximize the number of $X$ cards we can play, we must use the $O$ "other" cards as separators. By placing an "other" card between ever...
Codeforces Round 1115 (Div. 2) Editorial, two original conditions. We only need to enforce $a < c$: if $a=c$, then the equation becomes $0=2a, Thank you for participating in Codeforces Round 1115 (Div. 2)! We hope you enjoyed the problems

Full text and comments »

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

22.
By lydrainbowcat, 14 years ago, In English
Codeforces Round #185 Hello,everyone! Codeforces Round #185 will take place on [Sunday, May 26th at 19:30MSK (23:30CST)](http://www.timeanddate.com/worldclock/fixedtime.html?day=26&month=5&year=2013&hour=19&min=30&sec=0&p1=166). This round is initiated by [user:Zanoes,2013-05-25], and here are the problem setters: - Div.1E & Div.2B —— [user:Zanoes,2013-05-25] (**Zhang Gaoxiang**) - Div.1D & Div.1A —— [user:liouzhou_101,2013-05-25] (**Wang Qisheng**) - Div.1C & Div.1B & Div.2A —— [user:lydrainbowcat,2013-05-25] (**Li Yudong**) Testers are [user:roosephu,2013-05-25](Luo Yuping), [user:FredaShi,2013-05-25](Shi Haoyue), [user:sjynoi,2013-05-25](Sun Jiayu), [user:sevenkplus,2013-05-25](Gu Yuzhou), [user:xiaodao,2013-05-25](Tang Feihu) and [user:Riatre,2013-05-25]. Especially thanks [user:Gerald,2013-05-25] for helping us to prepare the round, [user:MikeMirzayanov,2013-05-25] for the great platform and [user:Delinur,2013-05-25] for translation. Score will be standard...
—— [user:liouzhou_101,2013-05-25] (**Wang Qisheng**) - Div.1C & Div.1B & Div.2A, —— [user:liouzhou_101,2013-05-26] (Ванг Квишенг), - Div.1C, Div.1B, Div.2A —— [user:lydrainbowcat,2013-05-26] (Ли, .1A —— [user:liouzhou_101,2013-05-25] (**Wang Qisheng**) - Div.1C & Div.1B & Div .2A

Full text and comments »

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

23.
By botaninvestments, 9 years ago, In Russian
Отчет о деятельности Botan Investments за сентябрь + рассказ Михаила Рубинчика о том, как зарабатывать в АСМ В сентябре в грантовой программе фонда Виктора Шабурова **Botan Investments** приняли участие 16 вузов. Больше всего студентов пришли на тренировки в ТПУ (Томск) &mdash; 42 человека, СГУ (Саратов) &mdash; 32 человека, УрФУ (Екатеринбург) &mdash; 24 человека. Больше всего тренировок за сентябрь провели КФУ (Казань) &mdash; 11 тренировок и МГУ (Саранск) &mdash; 9 тренировок. Также в сентябре к программе для преподавателей присоединились новые участники, это ННГУ им. Н. И. Лобачевского (Нижний Новгород) и ОГУ (Оренбург). **Botan Investments** выступил спонсором квалификационного этапа Четвертьфинала ACM-ICPC Южного подрегиона, олимпиады по программированию в рамках международного форума “Объединяя параллели” на Дальнем Востоке и технического форума РИФ.Технологии. <br><br> <center> <div style="width: 90%;"> <img src="/predownloaded/f9/e6/f9e66485e385a863a06004e16492fbf254d6b0a1.jpg" style="width: 90%; display: inline;"/> </div> <small>Олимпиада по программированию в рамках форум...
<div style="width: 70%;"> , > <div style="width: 90%;">

Full text and comments »

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

24.
By Baraa-Ahmed, 7 months ago, In English
Hebron Code Jam 2026: Online Mirror <img src="/predownloaded/77/35/77357d80c34bbbd6d7d2ac5097b87f98439f8793.jpg" style="float:right; margin: 0 16px 12px 0; max-width: 220px;"> Hello codeforces, We are excited to invite you to the online mirror of [Hebron Code Jam 2026](https://codeforces.me/contestInvitation/08c4a29296d44fee0b3989a60509c5d0f9eedd2d). The contest is held onsite at Hebron University as an annual competition. The online mirror of Hebron Code Jam 2026 is an ICPC-style team contest that will be held starting at [Wednesday, April 29, 2026 at 17:00](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Hebron+2026&iso=20260429T17&p1=426&ah=5). The contest is 5 hours and meant for teams of up to three people. The contest spans a wide range of difficulties (Div. 2A to Div. 2F or even harder), with problems appropriate for both beginners and experienced participants. [Contest link!](https://codeforces.me/contestInvitation/08c4a29296d44fee0b3989a60509c5d0f9eedd2d) The problems were prepared and auth...
difficulties (Div. 2A to Div. 2F or even harder), with problems appropriate for both beginners and, people. The contest spans a wide range of difficulties (Div. 2A to Div. 2F or even harder), with

Full text and comments »

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

25.
By galen_colin, 6 years ago, In English
Community-prepared testing rounds Since the two failures of the contests last weekend, a lot of people have expressed that they want to help Codeforces in some way, but there isn't much many of us can actually do about the system. At the same time, there have also been a lot of (reasonable) requests for a testing round before round 656. So let's put those two together. Why don't we set some potential testing rounds? Maybe they should be rated, maybe they shouldn't, but in any case, they should be interesting enough to draw in participants like normal rounds do. It's probably not a good idea to "sacrifice" rounds not rated for Div. 1, as some have suggested, because that still wastes the efforts of the setters. So what I'm suggesting is that we prepare rounds with the specific intent of them being testing rounds. Some advantages of this system: - If these rounds are unrated, there's much less pressure for original/novel problems (and probably fewer problems will be rejected), so more of these rounds will be able t...
Div. 1, as some have suggested, because that still wastes the efforts of the setters. So what I'm

Full text and comments »

Announcement of Testing Round #XVII
  • Vote: I like it
  • +257
  • Vote: I do not like it

26.
By botaninvestments, 10 years ago, In Russian
Отчет о деятельности Botan Investments за октябрь + интервью тренера команд ИКТиИБ ЮФУ Сергея Тарасова В октябре одно из наиболее значимых событий &mdash; четвертьфинал ACM. Виктор Шабуров уже не первый год является спонсором четвертьфинала Южного подрегиона в Саратове. Botan Investments поздравляет всех участников, занявших призовые места, и прошедших в полуфинал! В Южном подрегионе среди вузов-участников грантовой программы фонда в полуфинал вышли: СГУ (Саратов), Самарский Университет (Самара), ВолгГТУ (Волгоград), УлГТУ (Ульяновск), ЮФУ (Ростов-на-Дону и Таганрог), КФУ (Казань), МГУ (Саранск), в Северном подрегионе &mdash; САФУ (Архангельск), в Восточном &mdash; ПГНИУ (Пермь), УрФУ (Екатеринбург), УГАТУ (Уфа), в Центральном &mdash; ЯрГУ (Ярославль), в Западно-Сибирском (ТПУ, СИбГУТИ). В этом месяце в нашей программе 17 активных университетов, а по количеству активных участников и проведенных тренировок лидируют Уральский федеральный университет (тренер Михаил [user:MikhailRubinchik,2016-10-03] Рубинчик) и Саратовский государственный университет (тренер Михаил [user:MikeMirz...
<div style="width: 100%;">

Full text and comments »

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

27.
By SecondThread, history, 5 years ago, In English
Road to LGM Continues: Red Redemption 2 Good morning! I just published a video about my performance (+173) on Global Round 20 and the past Div 1 Round. It's heavily edited, only includes highlights, and is definitely more entertaining than the usual screencasts, so I thought I'd post about it here. [Go check it out](https://www.youtube.com/watch?v=_UWFfaE_8NM). Here's the thumbnail! ![ ](/predownloaded/ed/2a/ed2aefdd5a539ee147c4e3896f78e0842d8feb4c.png) If you want to see me in the Top 10 Contributors so you don't have to go to my profile to check my color, you know what to do.
past Div 1 Round. It's heavily edited, only includes highlights, and is definitely more entertaining

Full text and comments »

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

28.
By buachudanike, history, 4 weeks ago, In English
Codeforces Round 1132 (Div. 2) — Editorial (Unofficial) ##### NOTE: THIS IS AN UNOFFICIAL EDITORIAL FOR THE CONCERNED ROUND SINCE THEY WERE TAKING TOO LONG [A1. 15K4JR3B (Easy Version)](https://codeforces.me/contest/2284/problem/A1) <spoiler summary="Tutorial"> Both versions have the same underlying idea: we want to maximize the product of two sums. The optimal construction places one point at $(x, 0)$, another at $(0, y)$, and the third at the origin. The doubled area of the resulting triangle is $$ xy. $$ In the easy version, every move has length $1$. Therefore, if we split the $n$ operations into two groups, the sums of the groups are simply their sizes. Let the sizes be $x$ and $n-x$. We need to maximize $$ x(n-x). $$ This product is maximized when the two groups are as balanced as possible. Hence, we take $$ x = \left\lfloor\frac{n}{2}\right\rfloor, \qquad n-x = \left\lceil\frac{n}{2}\right\rceil. $$ The answer is therefore $$ \boxed{\left\lfloor\frac{n}{2}\right\rfloor \left\lceil\frac{n}{2...
Codeforces Round 1132 (Div. 2) — Editorial (Unofficial), $2a[i]$., Bertrand's postulate, for every integer $a[i] > 1$, there is a prime strictly between $a[i]$ and $2a[i

Full text and comments »

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

29.
By Boredgrammer, history, 3 years ago, In English
Are recent Div 2A/2B harder than previous 2A/2B? Hey Everyone, I have just started practicing on static A2OJ ladder [link] (https://a2oj.netlify.app/ladder11) for rating <=1300. I could solve most of the problems without looking at editorial and most of them were from older Div2 contests. Recently, I participated in a div 2 contest and couldn't solve any question. Virtually Participated in couple of recent Div 2 contest still couldn't solve any. Then I tried Div 3 and Div 4 and I could solve couple of questions in them.Thus I think recent div 2 contests are harder than div 2 contests conducted before introduction of div 3 and div 4. Now comming to the point considering the low frequency of Div 3 and Div 4 contest, what should be the approach to practice problems so that i am able to solve div 2 A and B. I tried grinding through the recent Div 2A and 2B and found those very difficult. when I solve recent problems with ratring from 1000-1100 I am not able to solve them at all whereas I am able to solve most of the problems wi...
Are recent Div 2A/2B harder than previous 2A/2B?, the recent Div 2A and 2B and found those very difficult. when I solve recent problems with ratring, through the recent Div 2A and 2B and found those very difficult. when I solve recent problems with ratring, Recently, I participated in a div 2 contest and couldn't solve any question. Virtually Participated

Full text and comments »

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

30.
By UTPC_Admin, history, 2 years ago, In English
UTPC Fall 2024 Contest #1 Hello, Codeforces! [UTPC](https://www.cs.utexas.edu/users/utpc/index.html), the competitive programming organization at the University of Texas at Austin, is happy to invite you to participate in the first contest of the UTPC Fall contest season which will be held on [Friday, September 13, 2024 at 6:00PM UTC-5 (CDT)](https://www.timeanddate.com/worldclock/fixedtime.html?msg=UTPC+Fall+2024+Contest+%231&iso=20240913T18&p1=24&ah=2). You will be given 8 problems (roughly ordered by difficulty) and 2 hours to solve them, with standard ICPC scoring. There will be a wide range of difficulties -- anyone is welcome to participate! We have will two divisions, Div. 2 for beginners to competitive programming and Div. 1 for people with some experience. This is a **team** contest, meaning that you are allowed to compete in teams of up to 3 members (it is totally acceptable to compete without teammates as well). This is (of course) not an official Codeforces round, and is thus unrated. The p...
-- anyone is welcome to participate! We have will two divisions, Div. 2 for beginners to competitive

Full text and comments »

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

31.
By Agnimandur, history, 6 years ago, In English
Paying for College with Codeforces ![Go to College with Codeforces ](/predownloaded/0a/97/0a977cc3bf1e7b07b76839aee28eb6e64f30d890.png) ### Do You Want to Go to College? Are You Good At Writing Codeforces Rounds? If so, then read on ahead! You will learn how quick and easy it is to go to college with the help of Codeforces! <br/> <br/> ### College is Expensive. The cost of MIT, a prestigious American university, is 53,790 USD per year. Even though scholarship is usually available, the average American student ends college with 37,000 USD in student debt! [[Source](https://www.cnbc.com/2017/07/13/heres-how-much-it-costs-to-go-to-college-in-the-us-compared-to-other-countries.html)] Student loan is also very pricey, with the average loan charging 5.8% interest per year. [[Source](https://www.nerdwallet.com/article/loans/student-loans/student-loan-interest-rates)] However, Codeforces pays its problem setters big money! For a combined, Div 1+2 round, you can earn an average of approximately 400 USD. [[Source...
big money! For a combined, Div 1+2 round, you can earn an average of approximately 400 USD

Full text and comments »

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

32.
By Ascension36, history, 9 months ago, In English
CF Round Filter — Browser Extension Hello everyone! I'd like to share with you a helpful extension I have been working on [CF Round Filter](https://chromewebstore.google.com/detail/cf-round-filter/nablppddfhgjfknaljkchaffgahhhmdh). CF Round Filter helps you filter rounds by division (Div 1–4, Educational, Others) and highlight solved or attempted problems so you can focus on contests and problems that match your skill level and track your progress efficiently. ![ ](/predownloaded/7e/2a/7e2acd052c163424f2854fa455df3e38c641f3fb.png) ![ ](/predownloaded/ac/3a/ac3a831ce7ff36b8288775b360ea3121010956a3.png) ![ ](/predownloaded/c5/9d/c59d14a220539bcdd91dad06acea3d192d3911fa.png) ###Features : - Toggle Div 1–4 and Edu rounds in seconds. - Color-coded problem cards with visible ratings. - View progress and history for any user. - Hide solved problems to focus on the next challenge. ###Notes : - Some problems exist in Div1 and Div2 rounds at the same time, they will only appear in the Div1 card. **You can d...
CF Round Filter helps you filter rounds by division (Div 1–4, Educational, Others) and highlight

Full text and comments »

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

33.
By DPR-pavlin, 5 years ago, In Russian
RuCode 4.0 Всем добрый день! (Меня зовут Филипп Рухович, и я) хочу рассказать немного об уже ставших традиционными [интенсивах на RuCode 4.0](https://rucode.net/algoritmicheskoe-programmirovanie/), которые пройдут уже в четвертый раз (начнутся 15 ноября), и в которых я принимаю участие в качестве методиста. Интенсивы продлятся пять дней. Как и в прошлые разы, это будут ежедневные онлайн-занятия с преподавателями ведущих вузов России, таких как МФТИ, ДВФУ, НИУ ВШЭ, ИжГТУ и других в формате лекций, личных контестов и последующих разборов. Для участия в интенсивах требуется пройти отбор, который состоится с 2 по 7 ноября 2021 года. По его итогам участники будут разделены на дивизионы C, D и E. Примерная программа выглядит следующим образом. **Темы Div. E**: <ul> <li>Основы асимптотики. Бинарный поиск, вещественный бинарный поиск, бинарный поиск по ответу.</li> <li>Стеки, очереди, деки, списки.</li> <li>Рекурсивный перебор: генерация объектов (перестановки, сочетания, ПСП). Поис...
. Примерная программа выглядит следующим образом. **Темы Div. E**: * Основы

Full text and comments »

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

34.
By sargeX, history, 20 months ago, In English
CFPusher — A Chrome Extension to automatically push your Codeforces submissions to your Github repo [CFPusher](https://github.com/SarJ2004/cf-pusher) &mdash; Automatically push Codeforces Submissions to GitHub ================== _Have you ever wanted to keep track of your Codeforces streaks and problem-solving progress without lifting a finger? What if I told you there's now an extension that automatically does it for you — and even pushes your accepted solutions to GitHub instantly? Introducing **CFPusher** — a sleek, lightweight Chrome extension built with love for competitive programmers like you._ ### SCREENSHOTS: <div style="display: flex; justify-content: space-between; margin-bottom: 16px;"> <img src="/predownloaded/ce/ec/ceecfcffe66f7d7a82726c5c39535551bd8dbc4e.png" alt="Image 1" style="width: 49%;" /> <img src="/predownloaded/7c/ad/7cad7c946b4bac0a25d2d1effe2558e3d86a326d.png" alt="Image 2" style="width: 49%;" /> </div> [cut] <div style="display: flex; justify-content: space-between;"> <img src="/predownloaded/4d/6d/4d6d1c0c640e648c35d133e5a8cb6f...
programmers like you._ ### SCREENSHOTS: <div style="display: flex; justify-content: space-between, <div style="display: flex; justify-content: space-between;">

Full text and comments »

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

35.
By ChaosAngel, history, 5 years ago, In English
What was the Hardest Div 2A you've seen? Some rounds are balanced, and some rounds are ludicrously not. Some div 2A's are overly trivial, which is kind of expected, but have you ever come across a div 2A that was wildly and unexpectedly difficult for its position in the contest? Let us know in the comments below!
What was the Hardest Div 2A you've seen?, , which is kind of expected, but have you ever come across a div 2A that was wildly and unexpectedly, Some div 2A's are overly trivial, which is kind of expected, but have you ever come across adiv 2A

Full text and comments »

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

36.
By MinakoKojima, 14 years ago, In English
Codeforces Round #172 Editorial Overview ... ================== In DIV 1, there are 3 normal tasks accompanied with 2 challenge tasks. About 40 competitors solve first three tasks during the contest and I believe there will be more if we extended the duration a little bit. Task D is a standard data-structure problem hidden behind a classical maximum cost flow model. This kind of problem are usually trick-less, but hard to implement especially under the pressure. Because of this, it becomes tonight's draw-breaker. Task E is a extended version on a classical DP && Math problem. There are many solutions to the original problem, one is giving a global view under the state transition, and using a data structure to handle it carefully. However, this one is even more harder, few people have ever tried it except [user:Jacob,2013-03-11]. (Although is wrong.) As a seasoned competitor, [user:Petr,2013-03-10] took the C-B-A order which proved to be the best choice through out the night. And after quickly solved C and...
Overview ... ================== In DIV 1, there are 3 normal tasks accompanied with 2 challenge

Full text and comments »

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

37.
By flamestorm, 4 years ago, In English
Every problem I ever made As you may [have seen](https://codeforces.me/contests/writer/flamestorm), I've written a lot of problems. In this post, I want to go over each of my problems and describe my thought process for how I created each problem. I got this idea from [user:antontrygubO_o,2023-01-21], but I was also inspired by [user:McDic,2023-01-21]'s editorials that included a "behind story" for each problem. Anyway, I thought it would be fun to give you all a glimpse into my thought process: where my ideas came from, the obstacles I encountered along the way, and any random tidbits that give a bit more pizzazz to the problems. I think it's important to remember that problem-writing is a creative endeavor, so I hope you'll enjoy reading about the making of my problems as much as I enjoyed creating them. And who knows, maybe you'll even be inspired to write some problems of your own. Also, spoilers for a lot of problems. Obviously. <table> <thead> <tr> <th>ID</th> <th>Problem</th> ...
firmly in the camp that thinks Div. 2A problems should be more implementation-based rather than random, wrote. I'm firmly in the camp that thinks Div. 2A problems should be more implementation-based

Full text and comments »

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

38.
By tryharderforioi100, history, 2 years ago, In English
Can tourist sets new records on Codeforces? Hi everybody, You may still remember, [user:tourist,2024-07-29] used to have hard times from November 2023 to February 2024. He lost his usual first place, even out of the top 10 users for about two months on Codeforces. But now he is returning, with many consecutive rounds holding the first place. By getting first place in yesterday's contest &mdash; Pinely Round 4 (Div. 1 + Div. 2), his rating has changed from 3880 to 3947 (+67 delta). With the current rating (3947), [user:tourist,2024-07-29] has a chance greater than ever to break through the highest rating ever achieved on Codeforces (3979, also achieved by him on Jan 22, 2022). Furthermore, he also has the opportunity to create a 4000+ milestone on Codeforces. If he achieves first place in the next Div. 1 or Div. 1 + Div. 2 Round, all of these wonderful records will turn into reality. What do you think? In my personal opinion, as a fan of [user:tourist,2024-07-29], I believe that he can do it! ##JustForFun Image: ...
place. By getting first place in yesterday's contest — Pinely Round 4 (Div. 1 + Div. 2), his

Full text and comments »

39.
By cyand1317, history, 9 years ago, In English
Codeforces Round #431 Editorial Hi, dear contestants! With the end of Codeforces Round #431 ([Div. 1](http://codeforces.me/contest/848) and [Div. 2](http://codeforces.me/contest/849)), some might be complaining behind the screen that problems are too tricky or hard, or have been struggling with some supposedly solvable problem... Yes, this time problems seem hard, but anyways, I hope they provided you with something, say rating, fun, ideas, or experience. I don't want to see anyone losing confidence because of failure (bad luck) in a single contest — please, don't do so. Here are the hints, tutorials and codes for the problems. Feel free to discuss about problems in the comments, and point out if something is incorrect or unclear. Thank you! ### [problem:849A] by [user:cyand1317,2017-09-01] <spoiler summary="Hint"> What will the whole array satisfy? Is that a sufficient condition? </spoiler> <spoiler summary="Tutorial"> [tutorial:849A] </spoiler> <spoiler summary="Model solution"> ~~~ #in...
Hi, dear contestants! With the end of Codeforces Round #431 ([Div. 1](http://codeforces.com

Full text and comments »

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

40.
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"; } } ...
$et$. - Case 2A: $i < j$. In this case, the cost does not increase for both the optimal solution

Full text and comments »

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

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

Full text and comments »

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

42.
By ACGN, history, 2 years ago, In English
About 2031C (Penchick and BBQ Buns, problem C of CF Round 987), and extra challenges Author of the problem [problem:2031C] here, hope you enjoyed the contest yesterday (Almost exactly 24 hours ago...)! Looking at the votes on [the editorial](https://codeforces.me/blog/entry/136260), it's obvious that it's a very polarizing problem: an hour or so after the contest, the problem had roughly equal numbers of "likes" and "dislikes", and now (as of writing) there are around 320 likes to 200 dislikes. Of course, this is completely predictable: the opinions on this problem were quite polarized for a few reasons: 1. Troll and WA trap: it's **very** easy to fall into the trap of thinking that there is no solution for all odd $n$; thus, **over 12,900** (!) WA on pretest 2 solutions were received, as compared to only 4,700ish Accepted solutions. This ratio seems a bit extreme for a problem C; in the previous Div.2's problem C ([problem:2028C]), there were 3,500ish Rejected solutions to 2,500ish Accepted ones. 2. The construction: hard-coding the case $n=27$ seems weird an...
for a problem C; in the previous Div.2's problem C ([problem:2028C]), there were 3,500ish Rejected

Full text and comments »

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

43.
By praveenojha33, history, 8 years ago, In English
Alternate links for A2oj ladder B and C problems. Hello, Community Members, Currently I was practicing from A2oj ladders for Div 2B and Div 2A problems. I have solved around 80 problems from ladder B and 50 from ladder A. I have decided to finish questions from both the ladders quickly and move to next section but unfortunately the site [https://a2oj.com](https://a2oj.com) is not opening for about 8 hours. It would of great help if anyone can provide me an alternate link to all problems from both the ladders. I have tried searching on Google but I was unable to find any link. Thanks in Advance.
Hello, Community Members, Currently I was practicing from A2oj ladders for Div 2B andDiv 2A

Full text and comments »

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

44.
By stark_happy, history, 2 years ago, In English
Can someone PLEASE help me out for upskilling myself iafter these contests ? Hi ! to whoever is reading this . I know this is another post crying out for some help to reach Pupil or Grandmaster but please , I really need some guidance . I had been practising CP from last 1.5 years on various platforms ( CP , not DSA or core concepts ) and initially I could solve Div 2A , 2B in half and hour and 2C after the Contest :( but I was never admant to reach an appreciable level on the platform. But , SInce last 20-30 days , I have been toiling hard and practising and studying DSA and all the core concepts of CP on various platforms , solving problems , reading solutions and again repeating the cycle and this time , after a very large gap , I decided to again take the challenge and reach atleast reach green in 2-3 Contests ( too much overconfidence ) but , to my shock , I rarely cross Div 2A these days and Div 2B also seems undoable . I don't know what went wrong in that large gap . SO , this is just a request if some experienced people can guide me &mdash; h...
years on various platforms ( CP , not DSA or core concepts ) and initially I could solveDiv 2A , 2B, Div 2A these days and Div 2B also seems undoable . I don't know what went wrong in that large gap .

Full text and comments »

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

45.
By MrLolthe1st, history, 7 years ago, In Russian
E2 for 587 Div3 O(1) solution [problem:1216E2] Обозначим длину последовательности от 1 до $i$ как $L_{i}$, тогда $L_{i} = L_{i-1} + DigitSum(i)$, где $DigitSum(x)$ &mdash; функция, которая получает количество цифр в числе $x$. Мы знаем, что каждый раз $L_{i}$ растет на какое-то число $e = DigitSum(i)$, при чем это число меняется не так часто &mdash; только после того, как $i$ стало больше $9, 99, $ и т.д. В таком случае, если мы знаем длину последовательности, которая сейчас росла на $e = DigitSum(i)$, то как только $i$ станет больше 9, $e$ увеличится на 1, больше 99 &mdash; на 1, и так далее. В этих точках роста $e$ мы можем посчитать длину ряда, который у нас уже сейчас есть. Первой точкой в этом ряду будет 0. Далее мы можем воспользоваться формулой: $E_{i} = E_{i-1} + i\times{(10^{i} - 10^{i-1})}$. Такую таблицу до $R$ мы можем построить за $O(DigitSum(R))$ &mdash; такую табличку можно предподсчитать до начала обработки запросов, при чем $R$ будет не более $\sqrt{2k}$. Доказать это несложно &mdash; возьмем ху...
\times{P_{i-1}}+i, c=-2\times{absK}$. Решив его, берем корень $x_{1}=\frac{\sqrt{d}-b}{2a}$. Теперь, мы, }{2a}$. Теперь, мы знаем сколько последовательностей началось до нас, значит, мы знаем и наш индекс

Full text and comments »

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

46.
By HaseenaZulfowaali, history, 4 months ago, In English
Problem E: Round 1115, Div 2 Problem : [Generational Triplets](https://codeforces.me/contest/2252/problem/E) (Not commenting on tutorial blog since community discourages necroposting) Before seeing the editorial, I observed the following: 1. Let a satisfying sequence be represented by a pair $(a, d)$ [first term and common difference respectively], with $\gcd(a, d) = 1$. Call such a sequence a **basis**. 2. For a given $d$, only one such $a$ can exist. ([Proof](https://math.stackexchange.com/questions/625187/xor-of-three-integers)) 3. Using the basis we can form all "related" sequences as follows: $(a, d)$ $\rightarrow$ $(2a, 2d)$ for all $a$ and $(a, d)$ $\rightarrow$ $(2a + 1, 2d + 1)$ when $a$ is odd. Is it possible to get to a complete solution using these observations (provide counter-example or justification if you think any of these is wrong although most of them I have proven)?
Problem E: Round 1115, Div 2, )$ $\rightarrow$ $(2a, 2d)$ for all $a$ and $(a, d)$ $\rightarrow$ $(2a + 1, 2d + 1)$ when $a$ is odd, )) 3. Using the basis we can form all "related" sequences as follows: $(a, d)$ $\rightarrow$ $(2a

Full text and comments »

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

47.
By BanTheCheaters, history, 6 years ago, In English
Cheaters found in CF Round #660 , #658 and #657 I found these two cheaters in Yesterday's contest ([ Codeforces Round #660 (Div. 2) ](https://codeforces.me/contest/1388)). They are from from the **same institute** (Jaypee Institute of Information Technology, Noida). They have been doing this in all almost **every past contests** they both participated. CF authorities should atleast **disqualify them from Round #657** , as they have gained positive deltas from that round unlike other rounds where they have dropped. User 1: _**Agraj Garg**_ [agrajgarg](https://codeforces.me/profile/agrajgarg) User 2: _**Vatsal Agarwal**_ [Warhead38](https://codeforces.me/profile/Warhead38) Submissions(For CF Round #660): A: [88462008](http://codeforces.me/contest/1388/submission/88462008) by Agraj and [88463088](http://codeforces.me/contest/1388/submission/88463088) by Vatsal (Apparently Vatsal has also submitted two absurd solutions to fool the authorities ) B: [88479313](http://codeforces.me/conte...
I found these two cheaters in Yesterday's contest ([ Codeforces Round #660 (Div . 2) ](https

Full text and comments »

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

48.
By mohiit.singh600, history, 6 years ago, In English
How to growth in cp as well as contests on CF? Hi everyone, Recently I have participated in both Div 2 as well as Div 3 contest. I have solved only a single question on Div 2 contest. But I couldn't solve any question on Div 3 contest.. This was the first time that I have participated in the contest.... Can anyone please tell me how to perform well in contests.? I have solved around 40 problems of Div 2A. What is the best strategy to solve more questions on CF? Should I participate in all coming contests or more focus on solving more problems untill and unless I get the confidence? Thanks in Advance...
perform well in contests.? I have solved around 40 problems of Div 2A. What is the best strategy to

Full text and comments »

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

49.
By MinakoKojima, 12 years ago, In English
Codeforces Round #259 Editorial Overview ======== There are 3 normal tasks accompanied with 2 challenge tasks in div 1 as we usually do. You can check the [Statistics](http://codeforces.me/blog/entry/13271) by By [user:DmitriyH,2014-08-06] for detail. Problem B, C is by [user:sevenkplus,2014-08-06], problem D is by [user:xlk,2014-08-06] and problem A, E is by me. Problem E is rather complicated then hard, it means if you carefully broke down the problem into smaller ones, it became quite straightforward. During the contest, only [user:kcm1700,2014-08-06] managed to solve it successfully. Problem D, which decided the round boiled down to the following nice Dynamic Programming subproblem: you are given $2^20$ numbers. For each position i between 0 and $2^{20}-1$, and for each distance $j$ between 0 and 20, what is the sum of the numbers with such indexes $k$ that $k$ and $i$ differ in exactly $j$ bits? The fun part is not how to do it $T$ times, it is how to do it even once on $10^6$ numbers. [user:...
Overview ======== There are 3 normal tasks accompanied with 2 challenge tasks in div 1 as we

Full text and comments »

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

50.
By Geothermal, history, 6 years ago, In English
Codeforces Round #709 / Technocup 2021 Final Round - Unofficial Editorial As the editorial for round #709 has yet to be released, I thought I'd write up and post my solutions to the problems (with the exception of Div. 1 F). My code may not be especially useful, since it's a bit messier than necessary in some cases, but I'm hoping that the written explanations will be fairly helpful. Feel free to comment if you have any questions! --- #[2A &mdash; Prison Break](https://codeforces.me/contest/1484/problem/A) By simply playing around with a few small test cases, you might guess that the answer is always equal to $ab$. This intuition is correct; let's prove it formally. Consider a graph with $ab+1$ vertices including one vertex representing each cell of the prison, one vertex representing the outside world, and an edge for each wall of the prison connecting the two vertices on either side of the wall. Then, observe that a set of walls we can remove such that the outside world is accessible from every cell is equivalent to a set of edges that s...
solutions to the problems (with the exception of Div. 1 F). My code may not be especially useful, since

Full text and comments »

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

51.
By himanshu1212, history, 6 years ago, In English
I Feel like committing suicide I am an Indian college student who's gonna go into third year and I am contemplating to suicide. I started CP 6 months back and the only progress I Have made so far is solving problems <=1000 And the max I can solve while giving contests is Div 2A and that's why I am still grey. Considering the big loser I am , I try to give a lot of efforts and work hard on my problem solving skills but the results aren't satisfying at all! Read many articles/blog regarding ways of practising CP,how to get better in problem solving skills but I feel nothing is worth the effort for me! Some would say to stop doing CP and try out something else , but then I am genuinely interested in CP (yes the greed for cracking big product bases companies is there) but that's not only the case, I really want to do it! Life does not end at CP but I have really worked hard in the past 6 months, and I feel there's nothing much more I can do it. Ending life just for the sake of CP might seem silly to a lot ...
the max I can solve while giving contests is Div 2A and that's why I am still grey.

Full text and comments »

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

52.
By MinakoKojima, 13 years ago, In English
Codeforces Round #201 Editorial ![ ](http://www.shuizilong.com/house/wp-content/uploads/2013/09/1.jpg) Overview ======== In DIV 1, there are 4 interesting problems together with a normal one. We think it is reasonable because we can't have a round fullly with intelligence. Problem A, C have weak pretests while others intended to be strong. About more then 200 participants solve A in the early 45mins, then a few of them start from C while most of the other start from B. Problem B is a rather standard problem, but if you're unfamiliar with the algorithm, it can be very hard. Problem C is a more intersting problem. As the name implies, there was [a similar version](http://codeforces.me/problemset/problem/251/C) in the previous round before, but this time it has a brand new constrains.(So here we have a psychology experiment: could different constrains make people thinking in a slightly different way?ww) The standard solution of problem C is $O((b-a) + nlogn)$. The first expected correct solution was writt...
DIV 1, there are 4 interesting problems together with a normal one. We think it is reasonable

Full text and comments »

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

53.
By stellarfish, 4 years ago, In English
PyPy performs visibly worse than Python 3 on identical code, why so? For the same code, PyPy performs visibly worse than Python 3. I've heard of i/o operations in PyPy being much slower than in CPython, but why does the memory consumed vary so much too? For the same solution to cf round 869 div 2A, PyPy solution consumes 9500 KB whereas Python 3 solution consumes 0 KB. [PyPy 3-64 submission](https://codeforces.me/contest/1818/submission/204085866) [Python 3 submission](https://codeforces.me/contest/1818/submission/204085847) Can someone explain why this happened?
solution to cf round 869 div 2A, PyPy solution consumes 9500 KB whereas Python 3 solution consumes

Full text and comments »

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

54.
By newbie_alt_acc, history, 5 years ago, In English
How to reach pupil? Hello community, I am currently a newbie and this is my alt account. I have solved around 70+ problems from A2OJ ladder div 2A and 20+ problems from A2OJ ladder Div 2B and 100+ practice problems too. Recently I have seen a blog stating you need to solve at least 1 problem from [blog link](https://codeforces.me/blog/entry/53341) I have given around 20 contest over the past and everytime I am able to solve atleast 1 problem and many a times 2 problem too but still not able to achieve the pupil from my main account. I would be very thankful to you if you give some suggestion to how to practice in current competitive scenario instead of downvoting another newbiew. Newbie gets demotivated very easily. PS: Posting this blog from alt account cuz everyone downvotes newbiew. Sorry for any grammatical mistakes maybe I am not very good with English.
+ problems from A2OJ ladder div 2A and 20+ problems from A2OJ ladder Div 2B and 100+ practice, I have solved around 70+ problems from A2OJ ladder div 2A

Full text and comments »

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

55.
By mohiit.singh600, history, 6 years ago, In English
Not Able to solve any question in the contest. Hi everyone, I was not able to solve A B problems in the contest on a constant basis.Sometimes I can solve Div 2A problem easily.But sometimes I had not solved any question in a contest.I have participated in every contest on codeforces. I also do upsolve one or two problems after the contest.I have solved around 350 problems(div2A+div2B) on codeforces. Can anyone tell me how to improve myself in cp? Thanks in Advance.
can solve Div 2A problem easily.But sometimes I had not solved any question in a contest.I have

Full text and comments »

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

56.
By PrinceOfPersia, history, 10 years ago, In English
Codeforces Round #362 (Editorial) [Here](https://gitlab.com/amirmd76/cf-round-362/tree/master) is git repository to solutions of problems of this contest. ### Div.2 A You should check two cases for YES: 1. $x\ mod\ s = t\ mod\ s$ and $t \leq x$ 2. $x\ mod\ s = (t + 1)\ mod\ s$ and $t+1 < x$ ![ ](http://espresso.codeforces.com/72731d179aee0e03fb8a446ab4bb2d2c333953b9.png) Time Complexity: $\mathcal O(1)$ [Codes](https://gitlab.com/amirmd76/cf-round-362/tree/master/2A) ### Div.2 B Nothing special, right? just find the position of letters `.` and `e` with string searching methods (like `.find`) and do the rest. ![ ](http://espresso.codeforces.com/67436d52032041dc54647c27e506f956e344f5cb.png) Time Complexity: $\mathcal O(n)$ [Codes](https://gitlab.com/amirmd76/cf-round-362/tree/master/2B) ### A Do what problem wants from you. The only thing is to find the path between the two vertices (or LCA) in the tree. You can do this in $\mathcal O(lg(n))$ since the height of the tree is...
)$ [Codes](https://gitlab.com/amirmd76/cf-round-362/tree/master/2A) ### Div.2 B Nothing special

Full text and comments »

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

57.
By PolarFlea, history, 7 years ago, In English
What is Div.1+Div.2 What is Div.1+Div.2? Is it a round to choose from Div.1 and Div.2 or a round with difficulty Div.2A to Div.1F? I have rating $675$ and contribution $-103$. Can I take part in this round? Also, is hack avaliable?
What is Div.1+Div.2

Full text and comments »

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

58.
By Braindeath, history, 5 years ago, In English
Why My Rating Drops with some Violation Rules Breaking Messages? In Educational Codeforces Round 129 (Rated for Div. 2) my rating drops 112 and cause is violation rules break. But I don't do anything wrong. First Thing First, In the contest time I didn't Copy and Paste code of others. I don't know in which part my solution is similar to others. I don't see others code. I have my solution. How do I know my code is similar to others in contest time? I don't know this thing. How my code is similar to others? how do I know. That is my code, I write it, I thought about it and i solved it by my own. And My rating drops. Drops 112. Please check my code and tell me how do I know My code is similar to others. It's my code. Why you cut my ratings? ~MikeMirzayanov,2022-05-25 Give me back my ratings or block my account. It's also frustrating when you cut my rating without any type of clear evidence. I didn't do any cheat and System's claim is actually wrong. [@MikeMirzayanov](https://codeforces.me/profile/MikeMirzayanov) please check this. ![ ](/pred...
In Educational Codeforces Round 129 (Rated for Div. 2) my rating drops 112 and cause is violation

Full text and comments »

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

59.
By uaskh, history, 8 years ago, In English
Doubt about problem 2 from contest 507 div2 I think there might be a problem with problem number 2 of contest 507 ,div 2. [The link to the problem is](https://codeforces.me/contest/1040/problem/B) [Click here for the screenshot ](/predownloaded/2a/4e/2a4ed01a705d3be7f14a098ce900860fcbc11f04.jpg) Can someone please clarify.
I think there might be a problem with problem number 2 of contest 507 ,div 2. [The link to the

Full text and comments »

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

60.
By keystrokes, history, 11 years ago, In English
Too Dumb for Programming? Ok, so I've been trying competitive programming for about 6 months now. I can still never solve DIV 2A Problems on Codeforces and Calkwalk Problems on Codechef. I am not dumb by means of IQ or anything like that, but I don't know why I suck so much. Is there anything that I can do to improve. I know the key is to solve lots of problems, but I can't even solve few problems.
Ok, so I've been trying competitive programming for about 6 months now. I can still never solveDIV

Full text and comments »

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