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 MikeMirzayanov, 3 years ago, In English
Please, read this Hello, Codeforces. Friends. I apologize, but today I will be a bit chaotic and mix personal with public. It just happened that way, I'm sorry. Today, my mother passed away. It's hard for me to write this. Even just seeing it in text makes it feel like something from a nightmare. She was extraordinary. It's difficult for me to articulate it right now, but take my word for it. It felt like all the best qualities one could imagine in a mother converged in her. I don't know any other people so kind, sincere, non-judgmental, capable of love, listening, befriending, supporting, and taking joy in the world around them, and bringing joy to their loved ones. Mom, it's already hard without you, it feels empty. She had glioblastoma. It's an aggressive brain cancer that affects only a few people out of 100,000. I believe, I hope, that science will soon be able to tackle this disease. But for now, this diagnosis is a death sentence. Maybe some of you are or will be associated with medic...

Full text and comments »

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

2.
By Rhodoks, history, 4 years ago, In English
Codeforces Round #810 Editorial Sorry for the late editorial. May this editorial help you. If you have questions, feel free to ask. [problem:1711A] <spoiler summary="hint1."> The minimal weight is at least $1$ since $1$ divides any integer (so $1$ divides $p_1$). </spoiler> <spoiler summary="solution"> Since $k+1$ does not divide $k$, a permutation with weight equal to $1$ is: $[n,1,2,\cdots,n-1]$. </spoiler> <spoiler summary="code"> ~~~~~ #include <bits/stdc++.h> using namespace std; void work() { int n; cin>>n; cout<<n<<' '; for (int i=1;i<n;i++) cout<<i<<' '; cout<<endl; } int main() { int casenum=1; cin>>casenum; for (int testcase=1;testcase<=casenum;testcase++) work(); return 0; } ~~~~~ </spoiler> [problem:1711B] <spoiler summary="hint1."> See the party as a graph. </spoiler> <spoiler summary="hint2."> Divide the vertices into two categories according to their degrees' parity. </spoiler> <spoiler summary="solution"> Let's consider ...
\cup B$ is good, too. , \cup I_i$, draw a beautiful picture using such algorithm:, vertex. Note our algorithm will guarantee that at every moment every connected component's indices, Then according to hint1, all $J_i$ is good. $J_{i+1} \cap J_i \neq \emptyset, \ cup J_i =[x,y]$, }{m} \rfloor \geq 3$. In this case, you can draw a beautiful picture using such algorithm: * Sort

Full text and comments »

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

3.
By tourist, 5 years ago, translation, In English
VK Cup 2021 — Отбор (Engine) и Codeforces Round #733 (Div. 1 + Div. 2) Привет, Codeforces! [contest:1544] уже совсем скоро, не пропустите начало: [contest_time:1544]. Это соревнование предназначено для тех, кто решил хотя бы 7 задач из 8 в квалификационном раунде [VK Cup 2021](https://codeforces.me/vkcup2021). Раунд будет рейтинговым для всех. Но даже если вы не регистрировались на VK Cup 2021, добро пожаловать на объединенный Div. 1 + Div. 2 раунд [contest:1530], который начнётся в то же время. Он также будет рейтинговым и открытым для обоих дивизионов. Все задачи были придуманы и подготовлены мной. Большое спасибо всем, без кого этот раунд не смог бы состояться: [user:PavelKunyavskiy,2021-07-16], [user:KAN,2021-07-16], [user:lperovskaya,2021-07-16], [user:ksun48,2021-07-16], [user:Sert,2021-07-16], [user:Aleks5d,2021-07-16], [user:MikeMirzayanov,2021-07-16]. Участникам будет предложено 8 задач и 3 часа на их решение. Рекомендуем прочитать условия всех задач. Удачи! Среди участников закрытого отборочного раунда, 64 лучших участника получа...
VK Cup 2021 — Отбор (Engine) и Codeforces Round #733 (Div. 1 + Div. 2), be a combined rated round for both divisions. This round is a mirror of VK Cup 2021 Elimination, предназначено для тех, кто решил хотя бы 7 задач из 8 в квалификационном раунде [VKCup 2021](https, Cup 2021](https://codeforces.me/vkcup2021). Раунд будет рейтинговым для всех. Но даже если вы, Cup, а топ 32 пройдут в финал и будут бороться за солидные призы:, This round is a mirror of VK Cup 2021 Elimination. VK Cup is an annual championship for Russian, VK Cup 2021 — Elimination (Engine):, VK Cup 2021 — Отборочный раунд (Engine):, Но даже если вы не регистрировались на VK Cup 2021, добро пожаловать на объединенный Div. 1 + Div

Full text and comments »

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

4.
By tourist, 9 years ago, translation, In English
VK Cup 2017 Round 3 + Codeforces Round #412 (Div. 1 + Div. 2) Hi everyone! The last elimination round of VK Cup 2017, Round 3, will take place on May 7 at 18:35 MSK ([check your timezone here](https://www.timeanddate.com/worldclock/fixedtime.html?msg=VK+Cup+Round+3&iso=20170507T1835&p1=352&ah=3)), along with separate Codeforces Round #412 for both divisions. All three rounds will be three hours long, and all three rounds will be rated. The contest "VK Cup 2017 — Round 3" is for teams qualified from Round 2 or Wildcard Round 2. The top 20 teams will advance to the final which will be held in July 2017 in Saint Petersburg! Huge thanks to [user:KAN,2017-05-06], [user:qwerty787788,2017-05-06], [user:PavelKunyavskiy,2017-05-06], [user:AlexFetisov,2017-05-07], [user:MikeMirzayanov,2017-05-06], and VK company for making this round possible. Codeforces will be the main character of most problems. Don't forget that it's useful to read the statements of all the problems. Good luck! As we're in year 2017, the scoring will obviously be stat...
VK Cup 2017 Round 3 + Codeforces Round #412 (Div. 1 + Div. 2), Hi everyone! The last elimination round of VK Cup 2017, Round 3, will take place on May 7 at 18, The contest "VK Cup 2017 — Round 3" is for teams qualified from Round 2 or Wildcard Round 2. The, The last elimination round of VK Cup 2017, Round 3, will take place on May 7 at 18:35 MSK ([check, VK Cup Round 3:, Всем привет! Третий, он же последний отборочный, раунд VK Cup 2017 начнётся 7 мая в 18:35 по, Соревнование "VK Cup 2017 — Раунд 3" предназначено для команд, квалифицировавшихся из Раунда 2 или, Третий, он же последний отборочный, раунд VK Cup 2017 начнётся 7 мая в 18:35 по московскому времени

Full text and comments »

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

5.
By MikeMirzayanov, history, 2 years ago, In English
Rule Restricting the Use of AI [revision 2024-09-14] It seems that neural networks are working technological wonders. Not long ago, they struggled with even the simplest tasks in our competitions, but now they are reaching new heights that cannot be overlooked. There is reason to believe that progress will continue, and we can expect further advancements in neural networks within the realm of programming competitions. For this reason, we are explicitly limiting the use of AI-based systems (such as various models like GPT, Gemini, Gemma, Llama, Claude, and others) for solving programming problems. However, we recognize that AI can be a valuable tool for learning and coding assistance, so we aim to establish clear boundaries for its use. **Application of this Rule:**<br/>This rule applies strictly to in-contest participation. This includes both registered contestants and out-of-competition participants in any rated Codeforces round. If a round is unrated and this is explicitly stated in the round announcement or rules, the rul...

Full text and comments »

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

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

Full text and comments »

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

7.
By SecondThread, history, 6 years ago, In English
Algorithms Thread 8: Tree Basics (+ Gym Contest) Algorithms Thread Episode 8: Tree Basics ================== Episode 8 of Algorithms Thread [comes out in <90 minutes!](https://youtu.be/MOy4UDjN8DM) This one is a bit more beginner-friendly and covers the following ideas: - Graph/Tree Diameters - Binary Lifting - Tree Flattening with Euler tours Also, to make sure you have actually learned that stuff, I made a [custom Gym set on CodeForces](https://codeforces.me/gym/102694) that will last two weeks that hopefully is really good practice for making sure you have learned this stuff. Here is a link to the gym set; it will be available 45 minutes after the video comes out so that people have time to watch the video before starting the set, if they are interested in penalty points. All of the problems in the gym are original to this set (in their flavortext at least, some are simple enough that I'm sure they have appeared in other contests before). The new gym integration was heavily inspired by [user:Errichto,2020-08-16]'s ...

Full text and comments »

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

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

Full text and comments »

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

9.
By Radewoosh, history, 8 years ago, In English
Blogewoosh #1 Hello, codeforces! The community wants so the community gets it! :D Here it is, my very first blog about tasks and algorithms. At the beginning I've decided to post my entries on codeforces, maybe I'll switch to something different if it becomes uncomfortable. To pour the first blood I decided to choose a task from one of the old ONTAK camps. Task's name is "different words" ([you can submit here](https://szkopul.edu.pl/problemset/problem/wTy-sxQCIKry0Ml-6RvM0L78/site/?key=statement)). The statement goes as follows: You are given $n$ words ($2 \leq n \leq 50\,000$), every of length exactly $5$ characters. Each character can be a lowercase letter, an uppercase letter, a digit, a comma... basically, it can be any character with ASCII code between $48$ and $122$ (let's say that $k$ is the number of possible characters). A task is to find all pairs of indexes of words which are $\textbf{really different}$. Two words are $\textbf{really different}$ if they differ at all $5$ corres...
character into zero or one and then run our algorithm for $k$ equal to $2$ — match groups of opposite, randomly change every character into zero or one and then run our algorithm for $k$ equal to $2$ &mdash, . Let's calculate the probability of fail if we'd repeat algorithm $600$ times. The probability that we

Full text and comments »

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

10.
By Qingyu, history, 18 months ago, In English
The 2025 Universal Cup Finals The best and brightest programmers from around the world have gathered this week in Dongguan, China, for the highly anticipated 2025 Universal Cup Finals! <center> <img src="/predownloaded/b8/c4/b8c48453572a7a497d0be10c665c67bfe5074593.jpg"> </center> ### Event Details - Date: Saturday, February 22nd - Start time: 10:30 AM CST (2:30 AM UTC) - See [participating teams](https://codeforces.me/blog/entry/136593) - Full schedule can be found [here](https://ucup.ac/news/announcement-2025-ucup-finals/) ### Streaming Witness the best contestants in the world as they push the boundaries of skill and strategy. You can be part of this event by following us online either on [English Channel](https://www.youtube.com/@que_tourist) or [Chinese Channel](https://live.bilibili.com/11464806). ### Mirror Contest Join the mirror contest and compete in real-time with the finalists from anywhere in the world. Any Universal Cup registered team can participate. The mirror contest is ...
The 2025 Universal Cup Finals, The 2025 Universal Cup Conference for Competitive Programming on Sunday, February 23rd. Listen to, Universal Cup registered team can participate. The mirror contest is available [here](https, , for the highly anticipated 2025 Universal Cup Finals!

Full text and comments »

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

11.
By TLE, history, 8 years ago, In English
Linear Recurrence and Berlekamp-Massey Algorithm **#IjustWantContribution** It seems there isn't any blog about Berlekamp-Massey Algorithm around here, so I decided to go on a try. :P Acknowledgement: Hats off to matthew99 for introducing this algorithm. #### What is 'linear recurrence'? Assuming there is a (probably infinity) sequence $a_0,a_1...a_{n-1}$, we call this sequence satisfies a linear recurrence relation $p_1,p_2...p_m$, iff $\forall i \geq m,~a_i=\sum_{j=1}^m a_{i-j}p_j$. (Obviously, if $m\geq n$ any $p$ can do :P) #### How to calculate k-th term of a linear recurrence? For a polynomial $f(x)=\sum_{i=0}^{t} c_ix^i$, we define $G(f)=\sum_{i=0}^{t} c_ia_i$. Obviously $G$ satisfies $G(f)\pm G(g) =G(f \pm g)$. Because $a_i=\sum_{j=1}^m a_{i-j}p_j$, if we let $f(x)=x^m-\sum_{j=1}^m x^{m-j}p_j$, then $G(f)=0$. Also $G(fx),G(fx^2)...=0$. So $G(fg)=0$ (g is any polynomial). What we want is $G(x^k)$. Because $G(f\lfloor x^k/f\rfloor)=0$, then $G(x^k)=G(x^k \bmod f)$. [cut] We can calculate $x^k \b...
Linear Recurrence and Berlekamp-Massey Algorithm, to acquire the exact transition matrix (or maybe just you're lazy enough), and thisalgorithm makes, **#IjustWantContribution** It seems there isn't any blog about Berlekamp-Massey Algorithm around, Acknowledgement: Hats off to matthew99 for introducing this algorithm., It seems there isn't any blog about Berlekamp-Massey Algorithm around here, so I decided to go on a, It's Berlekamp-Massey Algorithm to the rescue! For a given sequence $x_0,x_1...x_{n-1}$, it can

Full text and comments »

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

12.
By SecondThread, 11 months ago, In English
Meta Hacker Cup 2025 Schedule Meta Hacker Cup 2025 ================== Meta Hacker Cup is back! We’re excited to announce our schedule for our 2025 season, kicking off on October 10th! - Practice Round: [Fri. October 10th, 10am Pacific (120 hours, 5 days)](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+Practice+Round&iso=20251010T10&p1=234)* - Round 1: [Sat. October 18th, 10am Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+Round+1&iso=20251018T10&p1=234&ah=3) (3 hours) - Round 2: [Sat. November 1st, 10am Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+Round+2&iso=20251101T10&p1=234&ah=3) (3 hours) - Round 3: [Sat. November 15th, 10am Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+Round+3&iso=20251115T10&p1=234&ah=3) (3 hours) - Finals: [Sat. December 13th, 6am Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+Finals&iso=20251213T06&p1=234&ah=4...
Meta Hacker Cup 2025 Schedule, ### Continuing the Meta Hacker Cup AI Track, /hacker-cup)!, /worldclock/fixedtime.html?msg=Meta+Hacker+Cup +Practice+Round&iso=20251010T10&p1=234)* - Round 1, Meta Hacker Cup 2025 ================== Meta Hacker Cup is back! We’re excited to announce our, The contest will be held on [the Meta Hacker Cup site](https://www.facebook.com/codingcompetitions

Full text and comments »

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

13.
By rng_58, history, 6 years ago, In English
AtCoder Library Recently, the number of algorithms and data structures we use in competitive programming are rapidly growing. It's a nice thing: by using more algorithms, the variety of possible problems gets wider, and we can enjoy more problems. On the other hand, before reaching adhoc, thinking-oriented part of this competition, we have to spend more and more time to learn algorithms. Sometimes a problem asks matching on general graphs; you have to find a paper describing it, read it, and implement its really complicated algorithm. Or sometimes you have to spend time tuning your library by a constant factor. Or sometimes you use multiple pre-written codes together, the variable names collide, and get annoyed. Until now, I basically rejected all problems that require pre-written codes of complicated algorithms because I don't like these things. For example, we never used segment trees with lazy propagation in our contests. However this way we can't use otherwise interesting problems and it ...
really complicated algorithm. Or sometimes you have to spend time tuning your library by a constant, ; you have to find a paper describing it, read it, and implement its really complicatedalgorithm. Or

Full text and comments »

  • Vote: I like it
  • +1385
  • 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 ...
championship rounds: * Championship VK Cup 2016 (together with VK) * Championship CROC 2016 (together with, * Championship VK Cup 2016 (together with VK) * Championship CROC 2016 (together with КРОК, * чемпионат VK Cup 2016 (совместно с ВКонтакте) * чемпионат КРОК 2016 (совместно с КРОК) * мини, Cup 2016 (совместно с ВКонтакте) * чемпионат КРОК 2016 (совместно с КРОК) * мини-чемпионат 8VC

Full text and comments »

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

15.
By SecondThread, history, 3 years ago, In English
It's Happening! Meta Hacker Cup 2023 Schedule Meta Hacker Cup 2023 Schedule ================== Meta Hacker Cup is back! We’re excited to announce our schedule for our 2023 season, kicking off on **September 22nd**! - Practice Round: [Fri. Sept 22nd, 10am Pacific — Mon. Sep. 25th, 10am Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+2023+Practice+Round&iso=20230922T10&p1=234) (72 hours)* - Round 1: [Sat. Oct. 7th, 10am — 1pm Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+2023+Round+1&iso=20231007T10&p1=234&ah=3) (3 hours) - Round 2: [Sat. Oct. 21th, 10am — 1pm Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+2023+Round+2&iso=20231021T10&p1=234&ah=3) (3 hours) - Round 3: [Sat. Nov. 4th, 10am — 1pm Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+2023+Round+3&iso=20231104T10&p1=234&ah=3) (3 hours) - Finals: [Sat. Dec. 9th, 6am &mdash; 10am Pacific](https://www.timeanddate.com/worldclock...
It's Happening! Meta Hacker Cup 2023 Schedule, /codingcompetitions/hacker-cup/2023/practice-round) at any time between now and September 25th., ://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup +2023+Practice+Round&iso=20230922T10&p1=234, Meta Hacker Cup 2023 Schedule ==================, Meta Hacker Cup is back! We’re excited to announce our schedule for our 2023 season, kicking off on

Full text and comments »

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

16.
By Monyura, history, 11 years ago, translation, In English
Анонс Looksery Cup 2015 Codeforces, привет! <img src = "https://pp.vk.me/c622617/v622617180/32cdb/fCl4Wp0ouUM.jpg" style="float:right;width:18%;height:18%"/> Я рад анонсировать Looksery Cup 2015, над подготовкой которого работала целая команда наших сотрудников, каждый из которых внес огромный вклад: [user:Sfairat,2015-06-05], [user:olpetOdessaONU,2015-06-05], [user:Sklyack,2015-06-05], [user:MrDindows,2015-06-05], [user:Rubanenko,2014-08-30], [user:Krasnokutskiy,2015-06-05], [user:2222,2015-06-05], [user:MaximM,2015-03-05], [user:Avalanche,2015-06-05], [user:Igor_Kudryashov,2015-06-05], [user:Kepnu4,2015-06-05] и я. Отдельное спасибо координатору [user:Zlobober,2015-06-05] за помощь с задачами и советы, а также [user:Delinur,2015-06-05] за перевод условий. Мы подготовили для вас 8 задач различной сложности, которые будут расположены в **случайном** порядке. Раунд будет длиться 2 часа 30 минут и пройдет по правилам Codeforces с плавной динамической стоимостью. Очень надеемся, что задачи понравятся и...
Announce of Looksery Cup 2015, Анонс Looksery Cup 2015, %;height:18%"/> I am glad to announce Looksery Cup 2015, that is prepared by our developers, each, %;height:18%"/> Я рад анонсировать Looksery Cup 2015, над подготовкой которого работала целая, ="float:right;width:18%;height:18%"/> I am glad to announce Looksery Cup 2015, that is prepared by our, ="float:right;width:18%;height:18%"/> Я рад анонсировать Looksery Cup 2015, над подготовкой

Full text and comments »

Announcement of Looksery Cup 2015
  • Vote: I like it
  • +1426
  • Vote: I do not like it

17.
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...
2018](https://codeforces.me/blog/entry/59252) - [O(n) algorithm for finding largest triangle in a, Blog Post Resources about Algorithm and Data Structures](https://codeforces.me/blog/entry/13529, DP (basics)](https://codeforces.me/blog/entry/54154) - [Hirschberg's Algorithm ](https, Trees](https://codeforces.me/blog/entry/52854) - [[Tutorial] Boruvka's Algorithm](https, and easy segment trees](https://codeforces.me/blog/entry/18051) - [Algorithm Gym :: Everything, in O(nlogn)](https://codeforces.me/blog/entry/11337) - [Suffix tree. Ukkonen's algorithm](https, # Mo's Algorithm & Range queries Stuff - [Mo's Algorithm ](https://codeforces.me/blog/entry/7383, ) - [ICPC Graph Mining Challenge solution](https://codeforces.me/blog/entry/79734) - [Algorithm Gym, ++ and Berlekamp–Massey algorithm](https://codeforces.me/blog/entry/65570) - [C++ STL: Policy, ://codeforces.com/blog/entry/85984) - [Simple Linear and Effectively Duval Algorithm for Lyndon Factorization

Full text and comments »

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

18.
By tourist, 4 years ago, translation, In English
VK Cup '22/23 — Отбор (Engine) и Codeforces Round #844 (Div. 1 + Div. 2) Привет! [contest:1781] начнётся уже скоро: [contest_time:1781]. Это соревнование предназначено для тех, кто решил хотя бы 6 задач из 8 в квалификационном раунде [VK Cup 2022](https://codeforces.me/vkcup2022). Раунд будет рейтинговым. Остальных приглашаем на открытый для всех [contest:1782], который начнётся в то же время и тоже будет рейтинговым. Все задачи придуманы и подготовлены мной. Также этот раунд стал лучше благодаря [user:KAN,2023-01-13], [user:errorgorn,2023-01-13], [user:lperovskaya,2023-01-13], [user:dario2994,2023-01-15], [user:Monogon,2023-01-15], [user:Arpa,2023-01-15]. Участникам будет предложено 8 задач и 3 часа на их решение. 64 лучших участника закрытого отборочного раунда получат фирменные футболки VK Cup, а 16 лучших пройдут в финал и смогут побороться за призы 4-5 февраля очно в офисе VK или онлайн: - 1-е место &mdash; 300 000 рублей; - 2-е место &mdash; 250 000 рублей; - 3-е место &mdash; 150 000 рублей; - 4-е место &mdash; 100 000 рублей. ...
VK Cup '22/23 — Отбор (Engine) и Codeforces Round #844 (Div. 1 + Div. 2), combined rated round for both divisions and open to everyone. This round is a mirror of VKCup 2022, для тех, кто решил хотя бы 6 задач из 8 в квалификационном раунде [VK Cup 2022](https, решил хотя бы 6 задач из 8 в квалификационном раунде [VK Cup 2022](https://codeforces.me/vkcup2022, 64 лучших участника закрытого отборочного раунда получат фирменные футболки VK Cup, а 16 лучших, This round is a mirror of VK Cup 2022 Elimination — annual programming championship for Russian

Full text and comments »

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

19.
By Um_nik, history, 3 years ago, In English
Pro Tips - get them while they are free More tips to use while studying under my tutoring [here](https://um-nik.notion.site/Pro-Tips-8b923b0dc7c94770824bdf4184afc43c). ## Stop caring about the rating Unless there are prizes involved, your position in the standings makes no difference. I can feel awful after winning a contest if I know that I could solve one more problem. Or I can feel OK losing a bunch of rating points knowing that I solved everything I could.  Because rating is just a number. It is highly volatile and it depends on other people, not only on your skill. But solving problems is totally up to you. And you should evaluate yourself not based on some random metric, but on your honest feeling whether you performed up to your expectations. Your sense of self should be under your control, don't get hung up on some imaginary value, you cannot reduce your progress to a single number. ## Don't use more than one account Rating is just a number. Do not be afraid to lose your colour. You’ll get it back in no t...
determine it with 100% certainty from the constraints, and that doesn’t dictate whichalgorithm to use., do is to believe that the problem must be solved with any particular algorithm and only try to come, . What you shouldn’t do is to believe that the problem must be solved with any particularalgorithm, And do not choose an algorithm first and solve the problem later. Algorithms are tools you use to

Full text and comments »

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

20.
By tourist, 5 years ago, translation, In English
VK Cup 2021 — Финал (Engine) и Codeforces Round #740 И снова привет! [contest:1563] начнётся совсем скоро: в [contest_time:1563]. В финале примут участие [32 лучших участника отборочного раунда](https://codeforces.me/contest/1544/standings), которые разыграют между собой солидные призы: - 1-е место — 300 000 рублей; - 2-е — 250 000; - 3-е — 150 000; - 4-е — 100 000; - 5-е — 80 000; - 6-е — 30 000; - и 7-е — 20 000. Следить за ходом соревнования и болеть за любимых участников можно будет [по этой ссылке](https://codeforces.me/spectator/ranklist/2488e608fc1223994a45bca34b4a2c51). Также смотрите прямую трансляцию [в сообществе Команды ВКонтакте](https://vk.com/tech) (нет, спойлеров к задачам финала не будет). Всех остальных, кроме финалистов VK Cup 2021, мы приглашаем на [contest:1558] и [contest:1561], которые начнутся на пару дней позже: во [contest_time:1558]. Раунды будут рейтинговыми для всех. Все задачи были придуманы и подготовлены мной. Большое спасибо всем, без кого этот раунд не смог бы состояться: [user:KAN...
VK Cup 2021 — Final (Engine) and Codeforces Round #740, VK Cup 2021 — Финал (Engine) и Codeforces Round #740, первого в истории VK Cup 2012!](https://codeforces.me/contest/211/standings)) за вдохновение для, **UPD**: Scoring distribution in the VK Cup finals: 500 — 1250 — 1500 — 2000, **UPD**: Распределение баллов в финале VK Cup: 500 — 1250 — 1500 — 2000 &mdash, **UPD3**: Division 1 round will be held on the VK Cup 2021 Finals problem set without any changes., **UPD3**: В первом дивизионе участникам будет предложен набор задач финала VK Cup 2021 без, , кроме финалистов VK Cup 2021, мы приглашаем на [contest:1558] и [contest:1561], которые начнутся на, /2488e608fc1223994a45bca34b4a2c51) of the VK Cup 2021 Final Round!, /2488e608fc1223994a45bca34b4a2c51) финала VK Cup 2021!, As a reminder, the standings of the VK Cup Finals are available [via this link](https, Everyone except for VK Cup 2021 finalists is invited to [contest:1558] and [contest:1561] that, ] ([2nd place of the first ever VK Cup 2012!](https://codeforces.me/contest/211/standings)) for, Всех остальных, кроме финалистов VK Cup 2021, мы приглашаем на [contest:1558] и [contest:1561, Напоминаю, что таблица результатов финала VK Cup доступна [по этой ссылке](https://codeforces.com

Full text and comments »

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

21.
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...
regular round is conducted with their help, thank you! * VK — VK Cup 2017, * Harbor.Space, регулярный раунд проводится с их помощью, спасибо! * ВКонтакте — VK Cup 2017, * Harbour.Space

Full text and comments »

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

22.
By stevenkplus, history, 6 years ago, In English
I challenge you to a duel, Errichto (UPD: Saturday 11am PT) ![Scoreboard](/predownloaded/08/57/0857157477081fc11f0c1d1814de19e66cb0006c.png) Dear [user:Errichto,2020-09-17], In case you are unaware, you beat me by 3 seconds of penalty on [Facebook Hacker Cup Round 3](https://www.facebook.com/codingcompetitions/hacker-cup/2020/round-3/scoreboard). Upon deep reflection, I decided that I will not accept this lying down. In order to avenge this notorious defeat, I am challenging you to a 1v1 duel. **Rules:** 1. Duel will be held as a lockout competition and will be televised live 2. Lockout problems will be chosen by a neutral problem setter 3. Loser must change their main to honor the winner. See below for details ~~~~~ // your template if you lose #define stevenkplus main int stevenkplus() { // your code here } ~~~~~ --- **Update:** We're doing it this Saturday! https://www.timeanddate.com/worldclock/fixedtime.html?msg=Errichto+vs+Stevenkplus&iso=20200926T11&p1=224&ah=1 Will be broadcast live at https://www.twitch...
Hacker Cup Round 3](https://www.facebook.com/codingcompetitions/hacker-cup /2020/round-3/scoreboard). Upon, In case you are unaware, you beat me by 3 seconds of penalty on [Facebook Hacker Cup Round 3](https

Full text and comments »

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

23.
By Qingyu, 14 months ago, In English
About the Universal Cup, the Semifinals, and myself... Hey'all! This gonna be a long post, so let me put an important TLDR here first: we are going to host **The 3rd Universal Cup Semifinals**, which will take place on August 24, 2025 **online**, at [11:00 (UTC)](https://www.timeanddate.com/worldclock/fixedtime.html?msg=The+3rd+Universal+Cup+Semifinals&iso=20250824T19&p1=33&ah=5). This contest will be a part of our Finals Team Selection, which the detailed rules and announcements will be published later next week. --- Now for some extra context, if you're interested. Last week, we hosted the [last online stage](https://codeforces.me/blog/entry/143954) of The 3rd Universal Cup. After that, I posted a [feedback form](https://docs.google.com/forms/d/1g5Txhiirh_lRsvGfkYWRozu0WDDGK31IAXjB7VgeVoM/edit) on our discord server. I received lots of thoughtful responses (P.S — it's still open, so feel free to fill it out if you haven't yet!). I've read through all the feedback, and I'd like to share a few thoughts. ### On the Number...
About the Universal Cup, the Semifinals, and myself..., 3rd Universal Cup Semifinals**, which will take place on August 24, 2025 **online**, at [11:00 (UTC, Universal Cup. After that, I posted a [feedback form](https://docs.google.com/forms/d, and around 20 in regular Open Cup seasons. Unlike 2-3 hour CF rounds, these are 5-hour contests for, host **The 3rd Universal Cup Semifinals**, which will take place on August 24, 2025 **online**, at, ### About me and The Universal Cup, +3rd+Universal+Cup+Semifinals&iso=20250824T19&p1=33&ah=5), which will be a contest that the winners, ://universal-cup-website.qoj.ac/) is just a temporary page built on QOJ, and it's hard to maintain it, Okay... This post definitely goes too long. In the all last, on behalf of the UniversalCup

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

26.
By Qingyu, 4 months ago, In English
The 2026 Universal Cup Finals The best and brightest programmers from around the world have gathered this week in Shanghai, China, for the highly anticipated 2026 Universal Cup Finals! <center> <img src="/predownloaded/e6/93/e693e47e517f397b13fc0a1dab505067ca789e98.jpg"> </center> ### Event Details - Date: Sunday, May 10th - Start time: 11:00 AM CST (3:00 AM UTC) - See [participating teams](https://codeforces.me/blog/entry/153064) - Full schedule can be found [here](https://finals.ucup.ac/schedule/) ### Streaming Witness the best contestants in the world as they push the boundaries of skill and strategy. You can be part of this event by following us online either on the [English livestream](https://www.youtube.com/watch?v=Y9HMX3zhFMM) or the [Chinese livestream](https://live.bilibili.com/1753191619). <center style="margin: 2em;"> <iframe width="560" height="315" src="https://www.youtube.com/embed/Y9HMX3zhFMM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipb...
The 2026 Universal Cup Finals, The 2026 Universal Cup Conference for Competitive Programming on Monday, May 11th. Listen to, Universal Cup registered team can participate. The mirror contest is available [here](https, , for the highly anticipated 2026 Universal Cup Finals!, The Conference will be streamed on [the Universal Cup channel](https://live.bilibili.com/1753191619).

Full text and comments »

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

27.
By tourist, 2 years ago, translation, In English
Code Weekend #1 <div align="right" margin="20px"> <img align="right" src="/predownloaded/72/f1/72f1f31badb1452243838a0fc2553c04accff164.jpeg" alt="logo" width="300px" height="300px" margin="20px"/></div> Hello everyone! We, the [RGBTeam](https://clist.by/team/Romka,tourist,%E2%88%A83886090/) ([user:qwerty787788,2024-05-21], [user:Romka,2024-05-21] and [user:tourist,2024-05-21]), are huge fans of heuristic programming competitions and are quite saddened by the fact that they are becoming less and less frequent each year. One day, we decided to organize our own competition :) Despite the fact that such ideas often remain just ideas, this time we have a serious mindset, and now we want to invite you all to participate in the first — and hopefully not last — **[Code Weekend #1!](https://codeweekend.dev)** The competition will be held in a format quite similar to ICFPC/Google Hashcode — there will be one problem and several dozen tests for it. You will need to submit just an output according to t...

Full text and comments »

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

28.
By jiangly, 4 years ago, In English
1st Universal Cup Announcement Hello everyone, we are happy to announce that the 1st Universal Cup is started officially. Universal Cup is a non-profit organization dedicated to providing training for competitive programming teams. Our website is [https://ucup.ac/](https://ucup.ac/) (in English and Chinese). In recent years, Chinese problem-setter teams have created a great number of high-quality contests. We have reached an agreement with most of these setters, that they agree to provide contest materials to Universal Cup for hosting mirror contests before publishing the set in public. We believe that such an arrangement can provide good opportunities to teams who want to do better in the future competing. Every year, with the permission of the problem setter team and without involving copyright disputes, the Universal Cup will hold mirror contests for some undisclosed competition sets. It is expected to hold at least 10 contests a year. We will simulate the actual situation in the competition, using the ...
1st Universal Cup Announcement, materials to Universal Cup for hosting mirror contests before publishing the set in public. We believe that, , the Universal Cup will hold mirror contests for some undisclosed competition sets. It is expected, Hello everyone, we are happy to announce that the 1st Universal Cup is started officially, In the 1st Universal Cup, with the support of multiple problem-setting teams, it is expected to, Universal Cup Committee:, Universal Cup is a non-profit organization dedicated to providing training for competitive, We require registration to participate in the Universal Cup, please follow the instruction on the

Full text and comments »

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

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

Full text and comments »

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

30.
By lotusblume, 13 months ago, In English
Worst-Case Graphs for Maximum Flow Algorithms Maximum flow algorithms are known to perform significantly better in practice than their worst-case time complexities would suggest. So in this blog, I will present graphs on which the following maximum flow algorithms actually achieve their worst-case running time: | Algorithm | Time Complexity | | ----------------------- | ------------------------------ | | Ford-Fulkerson with DFS | $\mathcal{O}\big(m^2 \cdot U)$ | | Edmonds-Karp | $\mathcal{O}\big(n \cdot m^2\big)$ | | Dinic | $\mathcal{O}\big(n^2 \cdot m\big)$ | | DFS with Scaling | $\mathcal{O}\big(m^2 \cdot \log(U)\big)$ | | Dinic with Scaling | $\mathcal{O}\big(n \cdot m \cdot \log(U)\big)$ | | Most Improving Augmenting Paths | $\mathcal{O}\big(m \cdot \log(U) \cdot (m + n \cdot \log(n))\big)$ | | FIFO Preflow Push | $\mathcal{O}\big(n^3\big)$ | | Highest-Label Preflow Push | $\mathcal{O}\big(n^2 \cdot \sqrt{m}\big)$ | Here and in the rest of this blog: - $n =$ number of vertices, ...
into $t$. To push this flow back to $s$ the algorithm must relabel a lot of vertices $\Omega(n, maximum flow algorithms actually achieve their worst-case running time: | Algorithm, shuffling the adjacency lists before the start of the algorithm helps? Not really. You can still enforce, $ and then through $q_1$ toward $t$. Of course, the HLPP algorithm will not immediately realize that, Implementing the Ford-Fulkerson algorithm using depth-first search to find augmenting paths is, In total, the DFS with Scaling algorithm requires $\Omega(w^2 \cdot p)$ augmenting paths, to find, The Most Improving Augmenting Paths algorithm always chooses augmenting paths with the largest, The most improving augmenting paths algorithm will find the following six augmenting paths:, This algorithm initializes a threshold $\Delta$ as a large power of two, for example $\Delta = 2, This is the same algorithm, as DFS with Scaling, only that the paths are found with Dinic (i.e, [4] Norman Zadeh. “Theoretical Efficiency of the Edmonds-Karp Algorithm for Computing Maximal Flows, [5] Maurice Queyranne. "Theoretical Efficiency of the Algorithm "Capacity" for the Maximum Flow, ^3)$. (It is important, that the algorithm prioritizes $a_1 \dots a_{k-1}$ over $a_k$ and $b_1 \dots, algorithm will one by one push each of these $w$ flow excesses back through $a_1$ and then into $p_1, | Algorithm | Time Complexity

Full text and comments »

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

31.
By Um_nik, history, 5 years ago, In English
How to practice Competitive Programming [Um_nik version] CP is about solving problems fast. And as absurd as it may sound, I believe that <span style="color:blue">SOLVE</span> and <span style="color:red">FAST</span> are very different and almost independent parts, and you need to practice them separately. Let’s look at some <span style="color:red">contest</span>, like a CodeForces round. For the sake of simplicity let’s assume that every problem has some *difficulty*, which is a numerical value denoting how hard it is, bigger values correspond to harder problems (it is not true, but it is an ok-ish approximation, at least if we consider subjective difficulty for a fixed person). Contests are made for a wide range of participants, and problemsetters strive to make contests interesting for a wide range of participants, which means having a *smooth difficulty gradient*. Well... as smooth as it is possible with 5-6 problems. <spoiler summary="Graph 1"> ![ ](https://s3.us-west-2.amazonaws.com/secure.notion-static.com/677e0ae2-a8df-4874-aff...
/161c72da-a4c7-4b2a-9e36-701926a1d18a/photo_2022-01-07_20.14.28.jpeg?X-Amz- Algorithm=AWS4-HMAC-SHA256&X, /677e0ae2-a8df-4874-aff5-6ee6263ed2c9/photo_2022-01-07_20.14.38.jpeg?X-Amz- Algorithm=AWS4-HMAC-SHA256&X, /bebdd246-50f6-44b1-ac25-757a2558cf94/photo_2022-01-07_20.14.34.jpeg?X-Amz- Algorithm=AWS4-HMAC-SHA256&X

Full text and comments »

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

32.
By EvenImage, history, 3 years ago, In English
2nd Universal Cup Announcement Hello everyone, we are happy to announce that the 2nd Universal Cup has started officially. The Universal Cup is a non-profit organization dedicated to offering training resources for competitive programming teams. Our website is [https://ucup.ac/](https://ucup.ac/) (in English and Chinese). In the previous season, over 750 teams from more than 300 affiliations all over the world, registered and participated in a total of 22 stages, encompassing contests from Asia, Europe, and America. With the permission of contest setters and without involving copyright disputes, the Universal Cup will hold mirror contests for some undisclosed competition sets. It is expected to hold at least 20 contests in this season. We will simulate the actual situation in the competition, executing the board freeze in the last hour. At the same time, we will provide an overall rating board, which will help the team to make a reasonable assessment of itself. Over the past few weeks, the committee has...
2nd Universal Cup Announcement, to [user:MikeMirzayanov,2023-08-24] for letting us advertise Universal Cup in Codeforces and, - In the upcoming 2nd Universal Cup, starting from September 2nd, 2023, **we have already scheduled, ://universal-cup-website.qoj.ac/register?season=2)., Hello everyone, we are happy to announce that the 2nd Universal Cup has started officially., The Universal Cup is a non-profit organization dedicated to offering training resources for, Universal Cup Committee:, With the permission of contest setters and without involving copyright disputes, the UniversalCup

Full text and comments »

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

33.
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, Mirror of Petrozavodsk Summer 2009. Day 9: NPO Computer Cup | [opentrain](http, ## I Open Cup named after E.V. Pankratiev, ## II Open Cup named after E.V. Pankratiev, ## III Open Cup named after E.V. Pankratiev, ## IV Open Cup named after E.V. Pankratiev, ## IX Open Cup named after E.V. Pankratiev, ## V Open Cup named after E.V. Pankratiev, ## VI Open Cup named after E.V. Pankratiev, ## VII Open Cup named after E.V. Pankratiev, ## VIII Open Cup named after E.V. Pankratiev, ## X Open Cup named after E.V. Pankratiev, ## XI Open Cup named after E.V. Pankratiev, ## XII Open Cup named after E.V. Pankratiev, ## XIII Open Cup named after E.V. Pankratiev, ## XIV Open Cup named after E.V. Pankratiev, ## XIX Open Cup named after E.V. Pankratiev, ## XV Open Cup named after E.V. Pankratiev, ## XVI Open Cup named after E.V. Pankratiev, ## XVII Open Cup named after E.V. Pankratiev, ## XVIII Open Cup named after E.V. Pankratiev, ## XX Open Cup named after E.V. Pankratiev, ## XXI Open Cup named after E.V. Pankratiev, ://opencup.ru/index.cgi?data=macros/stage&stg=6&region=main&ncup=oc7) [Vekua Cup 2010](http, 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

34.
By EvenImage, history, 6 years ago, In English
A problem collection of ODE and differential technique ##A problem collection of ODE and differential technique *This problem might be well-known in some countries, but how do other countries learn about such problems if nobody poses them.* For those who are interested in well-known problems in China. Thank [user:Elegia,2020-04-23] and [user:djq_cpp,2020-04-23] for developing this technique. Thank [user:tEMMIE.w.,2020-04-23] for reviewing this article. ####[Chain Reaction](http://uoj.ac/problem/50) in UOJ Round 3 By [user:vfleaking,2020-04-23] **Statement** ​ You are given a set $A$, you need to compute $g_{i} = \frac{1}{2} \sum_{j,k}{i-1 \choose j}{i-1-j \choose k} g_jg_k$ where $i-1-j-k \in A$. **Solution** ​ Let the EGF of $g$ be $x(t)$ and EGF of $A$ be $a(t)$. Thus $x'(t)=\frac{1}{2} a(t) x^2(t)+1$. We can solve this equation by D&C and FFT in $O(n\log^2 n)$. But there is a <s>slower</s> solution in $O(n\log n)$. ​ For a polynomial equation $f(x(t))=0$, we can use the Newton's method to solve it. If we find ...
academia. But I don't know whether it's practical. The most popular algorithm is $O(n^2 + n^{1.5

Full text and comments »

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

35.
By ATSTNG, history, 7 years ago, In English
[Tutorial] Matroid intersection in simple words **[This article is also available in [Russian](https://codeforces.me/blog/entry/69287?locale=ru)]** Hello, CodeForces. I think that matroids are beautiful and powerful concept, however, not really well known in competitive programming. I’ve discovered matroids at 2019 Petrozavodsk Winter Training Camp. There was a problem that clearly cannot be solved using usual techniques I knew, editorial for this problem was just these three words “just matroid intersection”. Back then it took me more than 2 days of upsolving to find all the information and details I need and implement solution that gets Accepted on this. And it took way longer to actually understand why does it work and exactly how does it work. (I still hesitate in some details.) Of course, it is not hard to google up all the definitions and some related articles, but in my opinion they all are focused more on mathematical part of theory, strict proofs in some not really obvious but short ways, and observing only ke...

Full text and comments »

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

36.
By KAN, 7 months ago, translation, In English
Codeforces Blitz Cup 2026 <center style="margin: 2em;"> <img src="/predownloaded/a7/e8/a7e8478b9af90246ebd2a4e42b9bbbafd392b64f.png"/> </center> Hi Codeforces! I have a great announcement for you. This month, we're holding the second Codeforces Blitz Cup! Remember all the WA1s and CEs we've seen from LGMs stressing out to submit before the opponent? They are coming back! The Codeforces Blitz Cup is a single-elimination personal tournament where matches follow the special Blitz Rules. In short, each match is a 40-minute PvP contest, where problems open one by one, and only the first AC counts. The players can't use any help or prewritten code except a small template, and we get to watch them think and code live. - [Detailed rules](/r/blitz-rules) - [Bracket](/publish/blitz2026/bracket.html) Check out last year's final rounds streams: [day 1](https://www.youtube.com/watch?v=caoeMuNNQtg&embeds_referring_euri=https%3A%2F%2Fcodeforces.com%2F), and the [final day 2](https://www.youtube.com/watch?v=...
Codeforces Blitz Cup 2026, holding the second Codeforces Blitz Cup! Remember all the WA1s and CEs we've seen from LGMs stressing, I have a great announcement for you. This month, we're holding the second Codeforces BlitzCup, The Codeforces Blitz Cup is a single-elimination personal tournament where matches follow the

Full text and comments »

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

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

Full text and comments »

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

38.
By MikeMirzayanov, 7 years ago, translation, In English
Codeforces: Итоги 2019 <a style="float:right; display: inline-block; margin:0 1em 1em 2em; max-width: 60%;" href="https://codeforces.me/10years"/> <img style="max-width:100%" src="https://assets.codeforces.com/images/codeforces-10-years-300.png"/> </a> Привет, Codeforces! Недавно платформе исполнилось <b>10 лет</b>. Мы принимаем ваши поздравления по ссылке <b><a href="https://codeforces.me/10years">https://codeforces.me/10years</a></b>. Пожалуйста, ознакомьтесь с прогрессом в 2019-м году и <a href="https://codeforces.me/10years">поддержите краудфандинг-кампанию</a> по случаю юбилея. Ваше пожертвование станет вкладом в будущее Codeforces, поможет его развитию и работе. Нам нужны ресурсы, чтобы продолжать проводить раунды, не останавливаться в разработке, внедрять нововведения и поддерживать существующую инфраструктуру. В 2019-м году над задачами совместно с многочисленными авторами работали координаторы: [user:KAN,2020-02-06], [user:300iq,2020-02-06], [user:cdkrot,2020-02-06], [user:arsijo,20...
регулярный раунд проводится с их помощью, спасибо! * **Mail.Ru** — Технокубок и Russian AICup, ="https://russianaicup.ru/">Russian AI Cup * **VK**, VK Cup — now a personal multi-track

Full text and comments »

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

39.
By tourist, history, 9 years ago, translation, In English
VK Cup 2017 Round 3 + Codeforces Round #412 -- Tutorial Here is the tutorial of VK Cup 2017 Round 3 and Codeforces Round #412. Enjoy! <spoiler summary="Is it rated?"> [tutorial:807A] <spoiler summary="Code"> ~~~~~ n = int(input()) results = [] for i in range(n): results.append(list(map(int, input().split()))) for r in results: if r[0] != r[1]: print("rated") exit() for i in range(n): for j in range(i): if results[i][0] > results[j][0]: print("unrated") exit() print("maybe") ~~~~~ </spoiler> </spoiler> <spoiler summary="T-Shirt Hunt"> [tutorial:807B] <spoiler summary="More efficient code"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { int p, x, y; cin >> p >> x >> y; for (int s = y; ; s++) { if (s % 50 != x % 50) { continue; } bool me = false; int i = s / 50 % 475; for (int j = 0; j < 25; j++) { i = (i * 96 + 42) % 475; if (i + 26 == p) { me = true; ...
VK Cup 2017 Round 3 + Codeforces Round #412 -- Tutorial, VK Cup 2017 Round 3 + Codeforces Round #412 -- разбор задач, Here is the tutorial of VK Cup 2017 Round 3 and Codeforces Round #412. Enjoy!, Разбор задач VK Cup 2017 Round 3 и Codeforces Round #412 доступен на русском и английском языках

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

42.
By KAN, 18 months ago, In English
Codeforces Blitz Cup 2025 Hi Codeforces! As announced earlier, we’re holding an individual competition, the Codeforces Blitz Cup 2025, to celebrate 15 years of Codeforces. The tournament features PvP matches in a novel Blitz format, where every second (literally!) counts. In a 40-minute match, the opponents rush to solve each consecutive problem quicker than the rival. One needs to come up with a correct solution, think over the optimal implementation, and code cleanly: only the first one to get a problem correctly claims the points. <spoiler summary="Complete Blitz rules"> - Each match lasts 40 minutes, with 7 problems of increasing difficulty (worth 2, 3, 4, 6, 8, 10, and 12 points). - Problems are revealed one at a time, in the order of increasing difficulty. - Only the first contestant to solve a problem earns points. - Once a problem is solved, it becomes unavailable, and the next one is revealed after 60 seconds. Contestants need to code the solution from scratch. It is forbidden to use ...
Codeforces Blitz Cup 2025, As announced earlier, we’re holding an individual competition, the Codeforces BlitzCup 2025, to, On the weekend, March 8th and 9th, we’ll stream top 15 matches of the Blitz Cup . The streams will

Full text and comments »

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

43.
By SecondThread, 2 years ago, In English
Meta Hacker Cup 2024 Schedule — Introducing the Meta Hacker Cup AI Track Meta Hacker Cup 2024 ================== Meta Hacker Cup is back! We’re excited to announce our schedule for our 2024 season, kicking off on September 20th! - Practice Round: [Fri. September 20th, 10am Pacific (72 hours)](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+Practice+Round&iso=20240920T10&p1=234)* - Round 1: [Sat. October 5th, 10am Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+Round+1&iso=20241005T10&p1=234&ah=3) (3 hours) - Round 2: [Sat. October 19th, 10am Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+Round+2&iso=20241019T10&p1=234&ah=3) (3 hours) - Round 3: [Sat. November 2nd, 10am Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+Round+3&iso=20241102T10&p1=234&ah=3) (3 hours) - Finals: [Sat. December 7th, 6am Pacific](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Meta+Hacker+Cup+Finals&iso=20241207T10&p1=234&ah=4) (4 hou...
Meta Hacker Cup 2024 Schedule — Introducing the Meta Hacker Cup AI Track, ### Introducing the Meta Hacker Cup AI Track, /worldclock/fixedtime.html?msg=Meta+Hacker+Cup +Practice+Round&iso=20240920T10&p1=234)* - Round 1: [Sat, Meta Hacker Cup 2024 ================== Meta Hacker Cup is back! We’re excited to announce our, The contest will be held on [the Meta Hacker Cup site](https://www.facebook.com/codingcompetitions

Full text and comments »

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

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

Full text and comments »

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

45.
By SecondThread, history, 6 years ago, In English
Algorithms Thread 9: Treaps (+ Gym Contest!) Algorithms Thread Episode 9: Treaps ================== Good morning everyone! [Episode 9 of AlgorithmsThread](https://youtu.be/6x0UlIBLRsc) comes out shortly after the Div2 round ends. This episode is on Treaps! It covers: - Fundamentals of Treaps - Splitting and Merging - Range reversing ... and more! I also decided to keep up the super-high quality style and made a [custom gym set](https://codeforces.me/gym/102787) with 5(+2) original problems to make sure you really understand everything that was covered in the lecture. The gym set will be released shortly after the lecture ends, and I hope that the problems will be challenging and fun, even for people who aren't seeing treaps for the first time. If you have any questions or suggestions, feel free to leave them below. I hope you enjoy the problem statements, and, in the spirit of the upcoming holiday, I'll leave you all with this: ![ ](http://wumbogames.github.io/cfPictures/GrimTreaper.png) <hr /> Update:...

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

48.
By Qingyu, history, 15 months ago, In English
The 3rd Universal Cup. Stage 38: Guangzhou (CCPC Finals 2024) Hi everyone! We are thrilled to invite you to The 3rd Universal Cup, Stage 38: Guangzhou, taking place on May 24th, 2025. The contest is based on the Finals of the CCPC (China Collegiate Programming Contest), which was held on May 11th, 2025. This is my third time to be a judge on the CCPC Finals, and probably my last experience of my judging experience in high school. This contest is prepared by [user:Gellyfish,2025-05-22], [user:johnvictor,2025-05-22], [user:jqdai0815,2025-05-22], [user:Kevin114514,2025-05-22], [user:Kubic,2025-05-22], [user:lynkcat,2025-05-22], [user:Milmon,2025-05-22], [user:ODT,2025-05-22], [user:orzdevinwang,2025-05-22], [user:Qingyu,2025-05-22], [user:rddccd]. Although the style of problems differs a lot, the difficulty of this problem set is close to the ICPC World Finals or Regional Semifinals (NERC Finals or Asia EC Finals). We believe the problems will be engaging for participants of all levels while still providing a challenge for the strongest te...
The 3rd Universal Cup. Stage 38: Guangzhou (CCPC Finals 2024), About Universal Cup, + [The 2nd Universal Cup. Stage 28: Chengdu](https://qoj.ac/contest/1596) (Based on CCPC Finals, Hi everyone! We are thrilled to invite you to The 3rd Universal Cup, Stage 38: Guangzhou, taking, Universal Cup is a non-profit organization dedicated to providing trainings for competitive

Full text and comments »

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

49.
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...
My own algorithm — offline incremental strongly connected components in O(m*log(m)), pairs of matching positions in them". To be honest, it a bit pissed me off that even thisalgorithm, ; from the easiest ones, like Dijkstra, to the harder ones, like Berlekamp–Masseyalgorithm. These, So, do you know any existing papers about this algorithm? If no, I claim that it'll be called

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

53.
By chenjb, 2 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...
Universal Cup

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

56.
By pllk, history, 10 years ago, In English
Competitive Programmer's Handbook — a new book on competitive programming Competitive Programmer's Handbook is a new book on competitive programming, written by me. The book is still in progress but almost ready, and I decided to release it now for a wider audience. You can download the book here: https://cses.fi/book.html The book consists of 30 chapters and is divided into three parts. The first part discusses basic topics such as programming style, data structures and algorithm design. The second part deals with graph algorithms, and the third part introduces some more advanced techniques. The book assumes that the reader knows the basics of programming, but no background on competitive programming is required. I think that the book is useful for future IOI participants, as the book covers most topics in the IOI syllabus. The final version of the book will be ready later this year. The PDF version of the book will be available for free also in the future, and in addition, there will be a printed version that will cost something. Before t...
topics such as programming style, data structures and algorithm design. The second part deals with

Full text and comments »

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

57.
By LoneFox, 6 years ago, In English
Facebook Hacker Cup 2020 Schedule It’s that time of year again &mdash; the Hacker Cup team is excited to announce the schedule for our 2020 season, kicking off on **July 24th**! - **Qualification Round:** [Fri. July 24th, 10am PDT &mdash; Mon. July 27th, 10am PDT](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Facebook+Hacker+Cup+2020+-+Qualification+Round&iso=20200724T10&p1=224) (72 hours) - **Round 1:** [Sat. Aug. 15th, 10am PDT &mdash; Sun. Aug. 16th, 10am PDT](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Facebook+Hacker+Cup+2020+-+Round+1&iso=20200815T10&p1=224) (24 hours) - **Round 2:** [Sat. Aug. 29th, 10am &mdash; 1pm PDT](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Facebook+Hacker+Cup+2020+-+Round+2&iso=20200829T10&p1=224) (3 hours) - **Round 3:** [Sat. Sept. 12th, 10am &mdash; 1pm PDT](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Facebook+Hacker+Cup+2020+-+Round+3&iso=20200912T10&p1=224) (3 hours) To compete, you can **register [here](https://www.face...
Facebook Hacker Cup 2020 Schedule, ://www.timeanddate.com/worldclock/fixedtime.html?msg=Facebook+Hacker+Cup +2020+-+Qualification+Round&iso, It’s that time of year again — the Hacker Cup team is excited to announce the schedule for, To compete, you can **register [here](https://www.facebook.com/codingcompetitions/hacker-cup/2020, ](https://www.facebook.com/codingcompetitions/hacker-cup /2020/qualification-round/faq)!**

Full text and comments »

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

58.
By brunomont, 3 months ago, In English
Chinese Postman Problem: How I Ran a 180 km Ultramarathon Through Every Street in My City Hello, Codeforces! A couple of years ago, a friend of mine told me that two cyclists had passed through every single street in the center region of the city I live in (Belo Horizonte, southeastern Brazil), on the [third try](https://www.strava.com/activities/1030665876/overview). <spoiler summary="First try"> After ~160 km, they had not completed 1/3 of the goal. [Strava link](https://www.strava.com/activities/976021527). <img src="/predownloaded/8a/53/8a53829f7d78e88808a3ff751b64406ec2fc0efd.png" style="width: 600.0px;max-width: 100.0%;max-height: 100.0%;"> </spoiler> <spoiler summary="Second try"> They were better prepared, but one of the guys was run over by a car (no big injuries). [Strava link](https://www.strava.com/activities/999450285). <img src="/predownloaded/85/8f/858fdcdcfda93cd1d9c7c59db7dbfad9e63d6ea2.png" style="width: 600.0px;max-width: 100.0%;max-height: 100.0%;"> </spoiler> <center> <img src="/predownloaded/8d/5c/8d5cfb677a361654105e49f36f214c35...
Final algorithm ------------------, that is, the repeated edges we used in $W$. Now, define the multigraph $H = (V(G), E(G) \cup F

Full text and comments »

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

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

Full text and comments »

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

60.
By Ra16bit, history, 5 years ago, In English
Competitive Programming Hall of Fame — cphof.org Hi Codeforces! Today I'd like to introduce the new [Competitive Programming Hall of Fame](https://cphof.org) project that is available at [cphof.org](https://cphof.org) ![ Logo ](/predownloaded/12/35/1235b4fcce22b33f83cf26221d889087e06d8592.png) #### Background A long time ago I've noticed that there is no single source of information with the results of previously held large programming competitions. Moreover, plenty of older championships don't maintain their websites anymore, and it becomes hard or even impossible to find any details about them, which is pretty sad. So I've decided to create [Competitive Programming Hall of Fame](https://cphof.org). #### About the project Competitive Programming Hall Of Fame is a project created to preserve the history of international championships in competitive programming. This website collects the results of the final stages for both worldwide and regional contests. By international championship we mean a contest consisting ...
, TopCoder Collegiate Contest, VK Cup 2012. - **Worldwide Online Championships** — competitions that

Full text and comments »

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

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

Full text and comments »

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