Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

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.

file

Last visit:  3 years ago
Registered:  10 years ago
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 ...
void File(){ cin.tie(nullptr)->sync_with_stdio(false); #ifdef zxyoi freopen("my.in","r",stdin, inline void File(){ cin.tie(nullptr)->sync_with_stdio(false); #ifdef zxyoi freopen("my.in","r

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

7.
By MikeMirzayanov, 5 years ago, In English
C++20 Is Released Hello, Codeforces. Please, welcome c++20 support on Codeforces. Yes, it is 64-bit. Thanks to Brecht Sanders: I used his distribution GCC-11.2.0-64 from https://winlibs.com/. If you have installed [PBOX](http://pbox.me/packages), you can add this compiler with the line `pbox install gcc11-64-winlibs`. Probably, a good idea is to add `C:\Programs\gcc11-64-winlibs\bin` into the PATH. More about PBOX you can read [here](https://codeforces.me/blog/entry/18274). I use the compilation command line similar to other GCC installations: `g++ -Wall -Wextra -Wconversion -static -DONLINE_JUDGE -Wl,--stack=268435456 -O2 -std=c++20 <source>`. The only differences are `-std=c++20` and `-Wall -Wextra -Wconversion` (I plan to use somehow such warnings in Polygon to suggest fixes in uploaded files). Now you can use c++20 in your solutions. I'm not sure there are many features useful in competitive programming. Probably, I'm wrong. For example, now you can write `vector v{vector{1, 2}};` inste...

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

13.
By -is-this-fft-, history, 5 years ago, In English
[Tutorial] The command line: how to read input from file without #ifdef and much more #### Introduction Instead of algorithms and math, I'll be doing something completely different here. There is something that has bothered me for a long time: people not understanding the tools they use to participate in contests and thus failing to take real advantage of them. And it all goes back to not understanding the command line. Some of you might say, "well surely, the command line is something obsolete and you're only clinging to it because you [insert ridiculous amateur-psychology here]?" No! The command line is not obsolete, and unless competitive programming becomes so mainstream that software vendors start writing professional-grade tools aimed specifically at us, it won't be. [cut] $~$ What is the command line? Any of these: ![ ](/predownloaded/bd/b6/bdb6c157b9b3ce5ae046c9064e469e0081f8c0fe.png) As you can see, it comes in many background colors and fonts, but the basic idea is always the same. It's a box you can type commands in, which it will ...
[Tutorial] The command line: how to read input from file without #ifdef and much more, be to read the input from a file, but now what you submit will be different from what you test, if all your programs are in a single file, which is what you have to do in competitive programming, on them. To do it, I have written a script file., run the program locally on your computer within a 6-minute window, on a test file that may be quite, shorthand to run it in the console for C++) to compile the file `program.cpp` into a binary and, to a file called `output.txt`. If the file does not exist, it creates it; if it does exist, it will, - First, your code will be compiled from human-readable code into a magic binary file that the, -prone and very time-consuming. A better way would be to read the input from a file, but now what you, And of course, you can replace `input.txt` and `output.txt` with any file names you choose., Now, we need to compile and run it. The first step is to actually locate the file in the command, The first task is to use these commands to find the folder you saved your file in. Since I don't, There is a better way! We have already learned how to compile the file `program.cpp` into an

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

16.
By brunomont, 6 months ago, In English
Chinese Postman Problem: How I Ran a 180 km Ultramarathon Through Every Street in My City Hello, Codeforces! A couple of years ago, a friend of mine told me that two cyclists had passed through every single street in the center region of the city I live in (Belo Horizonte, southeastern Brazil), on the [third try](https://www.strava.com/activities/1030665876/overview). <spoiler summary="First try"> After ~160 km, they had not completed 1/3 of the goal. [Strava link](https://www.strava.com/activities/976021527). <img src="/predownloaded/8a/53/8a53829f7d78e88808a3ff751b64406ec2fc0efd.png" style="width: 600.0px;max-width: 100.0%;max-height: 100.0%;"> </spoiler> <spoiler summary="Second try"> They were better prepared, but one of the guys was run over by a car (no big injuries). [Strava link](https://www.strava.com/activities/999450285). <img src="/predownloaded/85/8f/858fdcdcfda93cd1d9c7c59db7dbfad9e63d6ea2.png" style="width: 600.0px;max-width: 100.0%;max-height: 100.0%;"> </spoiler> <center> <img src="/predownloaded/8d/5c/8d5cfb677a361654105e49f36f214c35...
gpx file and plug it into my watch, so it would be relatively easy to follow.

Full text and comments »

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

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

Full text and comments »

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

18.
By DanAlex, history, 11 years ago, In English
How to sweep like a Sir ### Cutting to the chase Clearly you don't need a PhD in Computing to sweep in the yard , but one might be useful in order to know linear and radial sweep algorithms. So , what's all about ? It's just what it sounds it is , sweeping linear ( up to down , for example ) or radial ( making a 360 degrees loop ). How this can help? [cut] Well... ### Linear sweep Suppose you a set of objects in an Euclidean plane. We need to extract information about some objects. The method of linear sweeping takes a line and moves it on a fixed direction. Usually the line taken would be vertical and the direction would be left to right or up to down. ![ ](https://upload.wikimedia.org/wikipedia/commons/2/25/Fortunes-algorithm.gif) Quite abstract for the moment , huh ? Let's go to a more specific example. #### Rectangle union area This example is well known. You have a set of rectangles with edges parallel to the OX and OY axes. What is their union area. Well , first of all , let'...
![ ](http://www.infoarena.ro/deque-si-aplicatii?action=download&file =bcrc.png&resize=40%25)

Full text and comments »

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

19.
By Qingyu, 5 years ago, In English
An archive of old USACO Problems As we know, USACO is a competitive programming contest primarily for secondary school students in the US. It offers a large collection of excellent problems, from the easy to the difficult. Many of the problems are educational and worthwhile as training material. However, the official website only offers problems from as early as 2011, and older problems are hard to find. Some of the Online Judges, such as POJ, contain some of the problems, but they are not properly filed together, and it's difficult to find the corresponding solution and test data. In this post, I will try to list all the USACO materials that I have found so far. Most of the materials come from some old websites, and thanks to the efforts of web.archive.org, we can check out old websites that no longer exist. In addition, many of the problems were used as training materials in the training of Chinese IOI teams about 20 years ago. These materials have been preserved and are available through some Chinese websit...

Full text and comments »

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

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

Full text and comments »

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

21.
By E869120, 8 years ago, In English
[Tutorial] A way to Practice Competitive Programming : From Rating 1000 to 2400+ Dear Codeforces community.<br /> Finally red :)<br /> <br /> Today, I want to share about some ways to practice competitive and gain your rating. I hope that this is helpful for those who is practicing competitive programming harder but rating is sluggish. There are 54,000+ people who participated in Codeforces contests actively, but sadly only a few people reach a red-ranked coders. For people who can't reach red, I will introduce my way to gain rating in some steps.<br /> <br /> This blog is an extended and more detailed version of [my previous tutorial blog](http://codeforces.me/blog/entry/53341), but 2 years and now are different. So there are many points that are different from blog which has written 2 years ago. Note: Some people who already read my previous tutorial blog may doubt, but do not doubt &mdash; I should say that the "from rating 1000 to 2000" part of this blog is not the copy of my previous blog and it's very different.<br /> <br /> Since the size is very big...
competitive programming — from rating 1000 to 2400+](https://drive.google.com/ file/d, ://drive.google.com/file/d/1J2x8pIYQ3MXANgvzOgBciWd3d79j_Exa/view) Please comment if you have

Full text and comments »

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

22.
By MikeMirzayanov, 4 years ago, In English
Testlib: tests + CI Hello, Codeforces. I have wanted for a long time and now, finally, I sat down and did it. Many of you are familiar with my [Testlib](https://github.com/MikeMirzayanov/testlib) project. This is a library that helps you develop problems if you are using C++. In the case of problems for Codeforces rounds, its use is mandatory. It seems to me that it is almost a de facto standard for preparing materials for completely different olympiads and competitions. The history of С++-Testlib is almost lost in centuries, I published the first version in 2005. Nowadays, making edits to Testlib has become tricky. The code grown to thousands of lines, also it has too long a history. This increases the likelihood of accidentally changing some aspect of behavior, which will jeopardize the holding of a Codeforces round or another important competition. In short, making a bug in this code or changing behavior anywhere is highly discouraged. So I recently took the plunge and wrote some test...

Full text and comments »

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

23.
By awoo, history, 6 years ago, translation, In English
Educational Codeforces Round 89 [рейтинговый для Div. 2] Привет, Codeforces! В [contest_time:1366] состоится [contest:1366]. Продолжается серия образовательных раундов в рамках инициативы [Harbour.Space University](https://harbour.space/)! Подробности о сотрудничестве [Harbour.Space University](https://harbour.space/) и Codeforces можно прочитать <a href="http://codeforces.me/blog/entry/51208">в посте</a>. Этот раунд будет **рейтинговым для участников с рейтингом менее 2100**. Соревнование будет проводиться по немного расширенным правилам ICPC. Штраф за каждую неверную посылку до посылки, являющейся полным решением, равен 10 минутам. После окончания раунда будет период времени длительностью в 12 часов, в течение которого вы можете попробовать взломать абсолютно любое решение (в том числе свое). Причем исходный код будет предоставлен не только для чтения, но и для копирования. Вам будет предложено **6 или 7 задач на 2 часа**. Мы надеемся, что вам они покажутся интересными. Задачи вместе со мной придумывали и готовили Роман [...
_You can [check it out here](https://drive.google.com/file /d/18jfX7l7VETUShTzC7PhvRuzr9DzsemuZ/view)._, _Вы можете [посмотреть её тут](https://drive.google.com/file /d/18jfX7l7VETUShTzC7PhvRuzr9DzsemuZ

Full text and comments »

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

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

Full text and comments »

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

25.
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...
solution is the same as mine, here comes a twist: [link](https://drive.google.com/file/d

Full text and comments »

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

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

Full text and comments »

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

27.
By Qingyu, 3 years ago, In English
Cooperation between Universal Cup and Huawei In the interest of contributing to the community and bridging the gap between competitive programming and industry, we are happy to announce that in the future, Universal Cup will be cooperating with Huawei in many areas. Huawei will support Universal Cup in future seasons. In the meantime, we will explore the cutting-edge challenges from the industry together as an additional activity during the Universal Cup season. These events might also serve as parts of other official programming competitions. Moreover, we intend to run some interviews and other events together, providing opportunities for communication between participants and the industry. We also hope that in the future, we can invite the top competitive programming teams to compete in the Universal Cup Onsite Final. It will definitely be one of the best events ever! Please stay tuned and support Universal Cup! ### About Universal Cup The Universal Cup is a non-profit organization dedicated to offering training resour...

Full text and comments »

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

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

Full text and comments »

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

29.
By -is-this-fft-, history, 2 years ago, In English
PSA on Meta Hacker Cup (must read if its your first time!) Meta Hacker Cup is upon us again. Along with it comes the unique format where we have to run our code on large test cases ourselves. Unfortunately, past experience shows that not everyone knows how to do this reliably. Usually, after the first round, many people lose points as a result of an unreliable workflow. This time, let's try to prevent that from happening. Sorry for the somewhat self-important title, but I really do wish that everyone understood this and that no one will fail the contest because of this. ### Don't EVER copy-paste huge files A lot of people's workflow to run a solution is the following: - Click some green button in the IDE - A box comes up, copy-paste the input into that box - The output shows up somewhere This may work well for running your solution on small sample test cases. It is **terrible** for running your solution on the huge test cases in Meta Hacker Cup. In last year's Round 1, the full test case for [problem C](https://www.facebook.com...
in VS Code's terminal. Then, I copy-pasted that 6 million line input file into that terminal. VS, lines long. A 20 year old computer is very much capable of handling a file that large, but most, of handling a file that large, but most graphical tools are not built with such files in mind., packages". A folder will open. Navigate to the subfolder called "User" and create afile called "C, "variants": [ { "name": "Run", "shell_cmd": "g++ \"${file}\" -O2 -o \"${file_path, **Option 1.** Use pipes to read the input from a file and write the output to a file. For example, Now you can choose "C++ Single File with -O2" from Tools -> Build System. , ~~~~~ { "shell_cmd": "g++ \"${file}\" -O2 -o \"${file_path}/${file_base_name}\"", "file_regex

Full text and comments »

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

30.
By vbandurin, history, 3 years ago, In English
Polygon Updates (August — September 2023) Hello, Codeforces! I, [user:ChurakovaAlexandra,2023-10-13], and [user:medvezhonokok,2023-10-13] are students of ITMO, and since this August, we started our internship at Codeforces. We are delighted that now we have the opportunity not only to write academic code but to do something that competitive programming enthusiasts from all over the world use. Currently, we are working on minor improvements to Polygon &mdash; a system for preparing problems. Later, as we gain more experience and delve into the technologies, we will also start working on Codeforces. A big thank you to our mentors [user:geranazavr555,2023-10-13] and [user:MikeMirzayanov,2023-10-13], who are always there to help and support. Here's a list of the main improvements to Polygon that we've made (sometimes with significant help from our mentors) over these two months. [cut]<br/> ###### 1. Automatic translation of solutions from one programming language to another. On the 'Solutions' page, a 'Tra...
situation when there is a solution that has the same name as a file on the 'Files' page. - Added, file on the 'Files' page. - Added warnings for built packages. - Now you can see TL/ML of the

Full text and comments »

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

31.
By TheScrasse, history, 3 years ago, In English
Editorial of Pinely Round 3 (Div. 1 + Div. 2) The official implementations of all the problems are [here](https://drive.google.com/file/d/1q2PHS9nJt84FRwfMoiMslQULFE4dTMU4/view?usp=sharing). <spoiler summary="Timeline of the round proposal (may contain spoilers)"> (problems D', H', etc. were not used) - Feb 19, 2022: I proposed problem D' to [contest:1654], but it was not used. - Mar 13, 2023: I invented problem A. - May 16: I invented problem H'. - May 19: I realized problem G can be solved in $O(n)$ time and we used it in the Italian team selection test for IOI. - Jul 04: I opened a Div. 1 proposal containing A, D', G, H' and other problems which are not going to be used. - Aug 09: I invented problem I, with intended solution in $O(n^3)$. - Sep 27: I invented problem C. - Oct 14: [user:errorgorn,2023-12-23] replied to my contest proposal. - Nov 02: I invented problem D''. [user:errorgorn,2023-12-23] solved problem I in $O(n^2 \log n)$. - Nov 08: I invented problems E and F. I didn't propose problem F because I th...
The official implementations of all the problems are [here](https://drive.google.com/file/d

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

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

Full text and comments »

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

35.
By maspy, history, 19 months ago, In English
Personal FAQ I often receive direct messages, many of which I ignore, though I do respond to some. Here, I’ve decided to write down answers to some frequently asked questions. Going forward, I will likely continue to ignore most messages. If you really want a response, I think I can at least give some kind of reply if you support me with a positive amount via https://github.com/sponsors/maspypy. I will probably not respond to most of the comments that this article will receive. However, if there’s something interesting, I may add it to the article. ### Are there any tips for improvement? Such overly common questions are best asked to tools like ChatGPT. ### Are there any introductory articles I should read? Are there any books on competitive programming? Please search the internet using keywords like "codeforces, tutorial", "competitive programming book". ### What should I do to aim for IOI or ICPC? Since I have absolutely no experience with these, I recommend asking some...

Full text and comments »

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

36.
By soullless, 10 months ago, translation, In English
I think we are checking the wrong thing against LLM cheating ### 1. What exactly is the problem During rounds, a specific pattern has appeared: a participant gets ready-made code from an LLM and simply submits it, almost without understanding it. This is not always caught by plagiarism: a person can rename variables, swap some parts of the code. ### 2. The idea #### Xeppelin — an open-source tool, originally made for ICPC, which: - is launched locally before the contest - logs file changes in the working directory - stores a development timeline (when and how the code changed) - does not record the screen, keyboard, network, or tabs - after the contest builds a visualization of activity #### [This is not my tool, but you can find it here](https://github.com/KiK0S/xeppelin) ### 3. What exactly is proposed for Codeforces (implementation, not an idea) The proposal is to use Xeppelin as an external source of behavioral data, without interfering with CF infrastructure. Workflow: 1. The participant launches Xeppelin bef...
cheating with an LLM-solution: - long idle period - one large file update - almost no edits, exactly in the file timeline - is hard to fake without actually rewriting the solution, launched locally before the contest - logs file changes in the working directory - stores a development, of file changes before AC - sizes of individual changes - active work time vs idle time, - is launched locally before the contest - logs file changes in the working directory - stores a, 3. After the round Xeppelin produces: - a file changes log - an activity timeline

Full text and comments »

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

37.
By Arpa, 15 months ago, In English
Rayan 2025 World Finals **&#128075; Salam, Codeforces!** ------------------ We are excited to announce that the final round of the **Rayan Programming Contest** will be held **onsite in Tehran**, from **November 25–29, 2025**! All participants ranked **1-1000** in the [Rayan Selection Round](https://codeforces.me/contest/2034/standings) are invited to complete the [registration form](https://rayan.global/registration/) by <s>August 25, 2025</s> **August 27, 2025**. The final list of invited participants—selected based on rank and geographical diversity—will be announced shortly thereafter. Beyond the chance to win **top-tier prizes worth $40,000 USD**, finalists will enjoy a unique opportunity to experience the timeless beauty and rich heritage of **ancient Persia**, with special highlights from the vibrant city of [Tehran](https://rayan.global/gallery/tehran-attractions/). <img src="https://rayan.global/files/Golestan-Palace.jpg" style="width: 100%;"> **Hotel accommodation, local transportat...

Full text and comments »

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

38.
By jonathanirvings, 4 years ago, In English
Hosting IOI 2022 is already stressful -- I plead everyone not to make us more stressful **Disclaimer: all opinions written in this post are purely personal and not tied with any affiliation, organization, or institutional I am working with, including but not limited to the IOI 2022 organizers.** Several members within IOI 2022 organizers might even try to prevent me from posting this. Dear IOI Community in Codeforces, I am writing in Codeforces this time, not in e-mails or IOI 2022 website since I am writing this in personal capacity and should not reflect a formal opinion of the IOI 2022 organizers. As you all might know, IOI 2022 will be conducted hybrid -- it will be hosted onsite, but we understand that it is impossible for some countries to come to Indonesia due to the [current global pandemic](https://en.wikipedia.org/wiki/COVID-19_pandemic), so these countries are still allowed to officially participate online. I am going to be very honest and transparent in this post. This is the first time the IOI has a hybrid setting like this. This poses huge chal...

Full text and comments »

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

39.
By Swistakk, history, 8 years ago, In English
Ultimate guide to TopCoder plugins Hi, I wanted to present to you guide on how you should set up TopCoder Arena in order to make competing in TC much more pleasant experience. Or at least guide how to do the same thing as I did which seem very comfortable to me compared to this big pain of competing in bare default Arena. In case you want to grab easy upvotes please leave here some joke about how I am jealous about ~Radewoosh,2018-08-16 getting insane boost in his contribution by writing his blogs, but the real reason is that I screwed my setup recently and needed to go through this painful and magical setup once again and it seems this information is very nontrivial and not available publicly in a known place (which I believe is one of reasons TopCoder is losing its popularity, but I hope thanks to this post I can give slight boost to it by settling up Arena problems once and for all for many people), so I wanted to share it with others. I want to express my sincere thanks to [user:tomasz.kociumaka,2018-08-16] for guid...
1) When I open a problem statement they create a new file corresponding to this task in a, 2) This file contains template code I used, created class for me with already correctly declared, 3) Apparently, informations about this setup are stored in ~/contestapplet.conf file. You can save

Full text and comments »

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

40.
By adamant, 11 months ago, In English
Caveats of using optimize("Ofast") with target("avx2") Hi everyone! As you may know, it is often recommended to put these lines in your header: ```cpp #pragma GCC optimize("Ofast,unroll-loops") #pragma GCC target("avx2") ``` And they're usually great!<sup>[1]</sup> Well, until they aren't. For last 2-3 days I was riddled with the issue that [CP-Algorithms Library](https://lib.cp-algorithms.com) would perform very well on Library Checker, but whenever I tried to also apply it on Codeforces, it will fail to speed up the code, and sometimes would even make it much slower. As I finally figured out the cause, I'd like to write a blog about it, so that other people don't waste as much time. Mitigating these issues improved my running time on [problem:1975G] from **1530 ms** in [submission:316602668] to **203 ms** in [submission:352602775]. ##### Tl'dr See the "Takeaway" section at the bottom. [cut]<br> ##### Example problem I will reproduce the issue on a simple example: <hr> **[problem:911G]**: You are given an...

Full text and comments »

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

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

Full text and comments »

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

42.
By Kostroma, 7 years ago, In English
AIM Tech Poorly Prepared Contest (unrated, funny, div. 1 preferred) Hello! Traditionally AIM Tech organizes a big party for Petrozavodsk camp participants to have fun and get an opportunity to communicate with each other. Usually it comes along with **a funny contest in unusual format**. This year we decided to share the fun with all codeforces community! This year we came up with a format requiring (probably) less time for preparing the contest. It is somewhat similar to an ordinary contest with a 3-hour duration. We already have some problem ideas, so it should be super easy to prepare the problems just one night before the competition. We hope everything will run smoothly! The contest will start on [contest_time:1302]. It could be a bit rescheduled due to onsite delays. It will be **an unrated funny competition**. Unlike usual ICPC-style contests, you'll be given an archive with several open test cases and answers for each problem. You'll have some sample test cases in the statement too, they'll be included in the archive. However, the ...
! **You can download the archive using one of the two links:** [one](https://drive.google.com/file/d

Full text and comments »

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

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

Full text and comments »

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

44.
By yummy, 2 years ago, In English
OpenAI o1 IOI submissions Hi Codeforces! I am a member of the reasoning team at OpenAI. We are especially excited to see your interest in the OpenAI o1 model launch, many of us being Codeforces users ourselves ([user:chenmark,2024-09-17], [user:meret,2024-09-17], [user:qwerty787788,2024-09-17], among others). Given the curiosity around the IOI results, we wanted to share the submissions that scored 362.14—above the gold medal threshold—from the [research blog post](https://openai.com/index/learning-to-reason-with-llms/) with you. These were the highest scoring among 10,000 submissions, so still a ways to go until top human performance, but we aspire to be there one day. The following C++ programs (including comments!) are written entirely by the model. Special thanks to [user:PavelKunyavskiy,2024-09-17] for maintaining the IOI mirror, which we used to check our scores. We hope you enjoy taking a look! **nile (100/100)** - [Submission](https://gist.github.com/aw31/2500acc418419e022021617170cbfc9f#file-n...
! **nile (100/100)** - [Submission](https://gist.github.com/aw31/2500acc418419e022021617170cbfc9f#file, - [Submission 1](https://gist.github.com/aw31/2500acc418419e022021617170cbfc9f# file-hieroglyphs_1, - [Submission 1](https://gist.github.com/aw31/2500acc418419e022021617170cbfc9f# file-mosaic_1-cpp, - [Submission 1](https://gist.github.com/aw31/2500acc418419e022021617170cbfc9f# file-sphinx_1-cpp, - [Submission 1](https://gist.github.com/aw31/2500acc418419e022021617170cbfc9f# file-tree_1-cpp) (17, - [Submission](https://gist.github.com/aw31/2500acc418419e022021617170cbfc9f# file-message-cpp, - [Submission](https://gist.github.com/aw31/2500acc418419e022021617170cbfc9f# file-nile-cpp) (100

Full text and comments »

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

45.
By maomao90, history, 3 years ago, In English
Breaking the 100 point barrier for IOI 2010 Maze After 21 days and 56 submissions on [IOI 2010 Maze](https://oj.uz/problem/view/IOI10_maze?locale=en), I finally broke the 100 point barrier and achieved a score of 100.081 / 100. ![Score distribution](/predownloaded/3a/0a/3a0a7cf4905b5c66c3eac59c02f5215bdd9365e8.png) [cut] ![Page 3 of submissions](/predownloaded/a4/7e/a47e4cf96e4646b18bf9faaa26b0fd231a594c0f.png) ![Page 2 of submissions](/predownloaded/55/2f/552fe37390378626f2b2171a9e42bd61d6a5fc7b.png) ![Page 1 of submissions](/predownloaded/5a/82/5a82cb9bb180f3951dbeee7349507c983063de1a.png) # Methodology It's just simulated annealing + a lot a lot of time. The neighbour function to generate a new state was just randomly choosing one cell to change from '$\text{#}$' to '$\text{.}$' or from '$\text{.}$' to '$\text{#}$'. Remember to take care that there must be exactly one '$\text{.}$' at the edge of the maze at all times. The energy function that we are optimizing is the question itself, which is the maxim...
solution to a file so that you can still get partial scores if it doesn't finish running before the

Full text and comments »

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

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

Full text and comments »

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

47.
By -is-this-fft-, history, 19 months ago, In English
Run-twice (aka communication) problems with Polygon and testlib.h ### Introduction _Run-twice_ problems (also called _multipass_ or _communication_ problems) are problems in which your program is executed twice. Here are some examples: - [problem:2054A] from the TON marathon. - Problems D, G and K from [Universal Cup Season 2 Stage 5](https://assets.ucup.ac/statements/statements-2-5.pdf). - All problems from [Universal Cup Season 2 Stage 16](https://assets.ucup.ac/statements/statements-2-16.pdf). - [Flash](https://boi2019.eio.ee/wp-content/uploads/2019/04/flash.en_.pdf) from BOI 2019 (this one is actually more complicated, but the premise is the same &mdash; there are multiple instances of your program which cannot share data except through the interactor. As you can see, there are many ways this format can be used, but the common themes are encoding/decoding, compression/decompression, constructing a bijection and similar ideas. The general principle is that you have to implement two functions and the second function has to somehow use t...
the original input file., int x; // choose x according to the strategy given in the input file if (strat == 0

Full text and comments »

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

48.
By dj3500, history, 7 years ago, In English
Helvetic Coding Contest 2019 online mirror **UPDATE: the editorial is [here](https://assets.codeforces.com/files/helvetic/helvetic-coding-contest-2019-editorial.pdf)** **[Link to the online mirror](https://codeforces.me/contest/1184)** Hello CodeForces! This year again, I'd like to invite you to [the online mirror](https://codeforces.me/contest/1184) of an open championship of Switzerland called HC2 (the Helvetic Coding Contest). A mirror was also held [one](http://codeforces.me/contest/958), [two](http://codeforces.me/contest/802) and [three years ago](http://codeforces.me/contest/690). ![ ](http://dj3500.webfactional.com/petr-meme-2019.jpg) [The Helvetic Coding Contest](http://hc2.ch/) is a yearly contest held at [the EPFL](http://epfl.ch/) in Lausanne by the [PolyProg](http://polyprog.epfl.ch/) association. The contest itself took place on April the 13th, but the online mirror is scheduled on [**Sunday, 7th of July, 10:05 Moscow time**](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Helvetic+Codin...

Full text and comments »

Tags hc2
  • Vote: I like it
  • +399
  • Vote: I do not like it

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

Full text and comments »

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

Full text and comments »

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

51.
By adamant, history, 4 years ago, In English
Combinatorial species: An intuition behind generating functions Hi everyone! The usage of generating functions is quite common in competitive programming these days. But it seems to happen so, that they're mostly presented as a way to simplify formal manipulation with polynomial coefficients, rather than something meaningful. But there actually is a meaning to all of this, and today I'm going to shed a light on it. Alongside the blog post we'll uncover the combinatorial meaning of - The addition $F(x)+G(x)$, - The multiplication $F(x)G(x)$, - The exponent $\exp F(x)$, - The logarithm $\log F(x)$, - The sum of the infinite geometric progression $\frac{1}{1-F(x)}=1+F(x)+F^2(x)+\dots$, - The general composition $F(G(x))$ for the generating functions $F(x)$ and $G(x)$ and the underlying structures they represent. ### Prerequisites - Basic notion of set theory (cardinality of sets, mappings, bijections, cartesian product, disjoint union, etc); - Polynomials and formal power series (representation, convolution formula, power seri...

Full text and comments »

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

52.
By AliShahali1382, history, 6 years ago, In English
Codeforces Round #722 Editorial Hi, Codeforces! [problem:1529A] problem idea and solution: [user:AmShZ,2021-05-24] <spoiler summary="editorial"> [tutorial:1529A] </spoiler> <spoiler summary="official solution"> ~~~~~ // khodaya khodet komak kon # include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair <int, int> pii; typedef pair <pii, int> ppi; typedef pair <int, pii> pip; typedef pair <pii, pii> ppp; typedef pair <ll, ll> pll; # define A first # define B second # define endl '\n' # define sep ' ' # define all(x)...
class IOWrapper(IOBase): def __init__(self, file): self.buffer = FastIO(file, def __init__(self, file): self._fd = file.fileno() self.buffer = BytesIO

Full text and comments »

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

53.
By dj3500, 10 years ago, In English
Helvetic Coding Contest 2016 online mirror Hello CodeForces! I'd like to invite you to the online mirror of an open championship of Switzerland called the Helvetic Coding Contest. ![ ](http://hc2.ch/img/heidi_zombie.png) [The Helvetic Coding Contest](http://hc2.ch/) is a yearly contest held at [the EPFL](http://epfl.ch/) in Lausanne by the [PolyProg](http://polyprog.epfl.ch/) association. The contest itself took place in March, but the online mirror is scheduled on [**Sunday, 10th of July, 11:00 Moscow time**](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Helvetic+Coding+Contest+2016+online+mirror&iso=20160710T0800&ah=4&am=30). The duration is 4:30. Rules: - you can participate in teams or individually (1-3 people), - standard ACM-ICPC rules (no hacking), - the contest is not rated, - if you have participated in the onsite contest, please do not participate in the mirror. You will help the cow Heidi [protect humanity against a zombie apocalypse](http://hc2.ch/img/poster/poster.png). The contest...

Full text and comments »

Tags hc2
  • Vote: I like it
  • +309
  • Vote: I do not like it

54.
By MikeMirzayanov, 15 years ago, translation, In English
Codeforces::Gym <p> We've made it! Or in any case, we are at least very close to it. </p> <p> On January 19, 2012 at 12:00 we open a sub-project called &quot;Gym&quot;. In short, its goal is to enable the Codeforces coders not only to participate in competitions and discuss them, but also to train and coach easily. </p> <p> In fact, despite the wide diversity of online judges in the world, a well thought-out training service system does not exist. So, the expectations from this system are: </p> <ol> <li>Collection of online contests, composed mainly of the past official contests. </li><li> Opportunity to integrate the final standings of past contests in the online contests to be able to train &quot;against&quot; the official participants. </li><li> Opportunity to participate in the training at any time whatsoever, without fear that something breaks down and the server will fall. In short, reliability. </li><li> Opportunity to write virtual contests and to solve the problems in a practice mode. </li...
Of course, it's easier to a file to Codeforces automatically and enjoy this nice text. , The "Contest" tab can be used to adjust the training session length and select afile , You can save the file locally if you want and check everything out: indicate the name with the , correction you can edit the results of auto-detecting file types, you can add or delete files and do other, recommended to add the statements as a single file containing the texts of all problems (e.g., PDF or DOC, standings file in the form of the traditional ACM-ICPC standings in HTML (a link will do, you can also, turned up in the Codeforces system due to the analysis of the final standings file of the past contest, -connection and copy the contest.zip file to the folder contest root. There this file will be, ://assets.codeforces.com/images/gym/p01s.png" /> Prior to processing the final standings file, ://assets.codeforces.com/images/gym/p02s.png" /> After processing the final standings file

Full text and comments »

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

55.
By MikeMirzayanov, 8 years ago, translation, In English
Polygon: resources advanced properties (graders) Hello, Codeforces! Today I’ve released an important update of the Polygon &mdash; partial support for advanced properties of resources. The main task that is being solved by this update is to support the development of problems with graders. In most competitions, participants need to submit a complete solution code, including reading an input reading and an output writing. For example, in Codeforces rounds you solve such kind of problems. However, in some competitions another approach is using: a participant needs to implement the required function or interface. For example, in a problem statement can be written that in a C ++ solution you need to implement a function that has prototype `int sum (int a, int b)` and submit the implementation. In this case, a participant has to submit a source code that contains the implementation of this function. Then, in the process of judging this solution for such a problem, an online judge should compile and link into a single executable f...
into a single executable file the file sent by the participant and a special jury-preparedfile that, In the case of problem ``A + B’’, such file, which is called a grader, might look like (grader.cpp):, Therefore, a grader cannot be independently compiled into an executable file: it also needs a, file problem.xml. Also, API is updated (see the documentation for the methods `problem.files` and, file the file sent by the participant and a special jury-prepared file that contains the rest of the

Full text and comments »

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

56.
By geranazavr555, 5 years ago, translation, In English
Polygon Updates (February 2022) Hello, Codeforces. In this post, I'll share with you a few recent improvements in Polygon made by [user:MikeMirzayanov,2022-03-03], [user:unreal.eugene,2022-03-03], [user:dk318,2022-03-03] and me. Polygon is a service to prepares programming problems and contests. It is usually used to prepare problems for olympiads/programming contests but it is also often used to prepare educational content. It is located at https://polygon.codeforces.com/ and is open to everybody. Here are three recent new features: * IOI-like Graders for Python * Problem Materials * User Groups [cut] <br/> <br/> IOI-like Graders for Python ================== About 3 years ago we announced support of IOI graders for C++ in Polygon (Please read [the old post](https://codeforces.me/blog/entry/66916)). Now we have added support for graders written in Python. However, since there is no concept of linkage in Python, Python graders are different from C++ ones. In the case of Python, the gra...
In the case of Python, the grader entry point file must have the name "main.py", placed into the

Full text and comments »

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

57.
By dacin21, history, 8 years ago, In English
On the mathematics behind rolling hashes and anti-hash tests This blog assumes the reader is familiar with the basic concept of rolling hashes. There are some math-heavy parts, but one can get most of the ideas without understanding every detail. The main focus of this blog is on how to choose the rolling-hash parameters to avoid getting hacked and on how to hack codes with poorly chosen parameters. # Designing hard-to-hack rolling hashes ## Recap on rolling hashes and collisions Recall that a rolling hash has two parameters $(p, a)$ where $p$ is the modulo and $0 \leq a < p$ the base. (We'll see that $p$ should be a big prime and $a$ larger than the size $\left|\Sigma\right|$ of the alphabet.) The hash value of a string $S = s_0 \dots s_{n-1}$ is given by $$ h(S) := \left(\sum\limits_{i=0}^{n-1} a^{n-1-i} s_i\right) \mod p $$ For now, lets consider the simple problem of: given two strings $S, T$ of equal length, decide whether they're equal by comparing their hash values $h(S), h(T)$. Our algorithm declares $S$ and $T$ t...
Input is taken from a file named 'hash.in' in the format. To use the ``BKZ`` algorithm, set the

Full text and comments »

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

58.
By antontrygubO_o, 5 years ago, In English
SEERC 2021 and Grand Prix of Southeastern Europe ![ICPC Logo](https://codeforces.me/predownloaded/bd/ee/bdeeda86cddf592ba0fc788957a5b7303fffe303.png) Hi everyone! 2021 Southeastern Europe Regional Contest took place on November 21. [Here](http://acm.ro/) you can view the full standings. Congratulations to the winners of the contest! | Place | Team Name | Contestant 1 | Contestant 2 | Contestant 3 | Problems | Penalty | | - | - | - | - | - | - | - | | 1 | [Taras Shevchenko National University of Kyiv] KNU_0_GB_RAM | [user:KostasKostil,2021-11-26] | [user:VladProg,2021-11-26] | [user:kostia244,2021-11-26] | 13 | 1788 | | 2 | [Kharkiv National University of Radio Electronics] KhNURE_Energy is not over | [user:BigBag,2021-11-26] | [user:Barichek,2021-11-26] | [user:Mustang98,2021-11-27] | 12 | 1274 | | 3 | [Lviv National University] LNU Bulldogs | [user:mshcherba,2021-11-26] | [user:Vasyl_Protsiv,2021-11-26] | [user:PetroTarnavskyi,2021-11-26] | 11 | 1429 | | 4 | [Faculty of Computer Science, Belgrade] GII Klub | [us...
* [SEERC](https://drive.google.com/file /d/1RoVMWSp_QrB7G2rHo5sU7Hkixz0iz6TF/view?usp=sharing) (with

Full text and comments »

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

59.
By KAN, 10 years ago, In English
Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) Hi Codeforces! The [contest:765] is going to be held [tomorrow at 8:05 UTC](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Codeforces+Round+%23397+by+Kaspersky+Lab+and+Barcelona+Bootcamp&iso=20170214T1105&p1=166)! This round is organized in collaboration with [Hello Barcelona ACM ICPC Bootcamp 2017](http://in.harbour.space/icpc/) and supported by Kaspersky Lab. <center> <img src="http://d9hhrg4mnvzow.cloudfront.net/in.harbour.space/icpc/085e8ffa-hellobcn-logoonly-200_02r02r02r02r000000.png"> <img src="http://d9hhrg4mnvzow.cloudfront.net/in.harbour.space/icpc/4c9339cb-kaspersky-lab-logo-svg_05k01905k019000000.png"> </center> Over 100 students from 17 countries and more than 25 universities such as Cornell University, University College London, École Normale Supérieure, University of Tokyo, Saint-Petersburg State University and Moscow Institute of Physics and Technology gathered in Barcelona to train together for the ACM ICPC Finals. For eight days students...

Full text and comments »

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

60.
By TheScrasse, 3 years ago, In English
Editorial of Codeforces Round 889 (Div. 1 + Div. 2) The official implementations of all the problems are [here](https://drive.google.com/file/d/1stkidhN_ftTOzK4qcMYxkUAlwWWb3AqF/view?usp=sharing). [problem:1855A] Author: [user:Kaey,2023-07-23]<br> Preparation: [user:akifpatel,2023-07-23] <spoiler summary="Hint 1"> What's the most efficient way to make the sad students happy? </spoiler> <spoiler summary="Hint 2"> In most cases, you can make $2$ sad students happy in $1$ move. </spoiler> <spoiler summary="Solution"> Let $s$ be the number of sad students at the beginning. The answer is $\lceil \frac{s}{2} \rceil$. In one move, you can make at most $2$ sad students happy (because you can change the position of at most two students), so you need at least $\lceil \frac{s}{2} \rceil$ moves. In fact, you can make everyone happy in exactly $\lceil \frac{s}{2} \rceil$ moves: - while there are at least $2$ sad students, you can swap them and both of them will be happy; - if there is exactly $1$ sad student left, you ...
The official implementations of all the problems are [here](https://drive.google.com/file/d

Full text and comments »

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

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

Full text and comments »

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

62.
By errorgorn, 19 months ago, In English
1/phi Halving in Interactive Tree Problems Thanks to [user:toxicpie9,2025-04-22] for proofreading and emotional support. Recently, I was thinking about JOISC 2025 Space Thief. And there is a part where you need to do divide and conquer on a tree, where you need to split the edges of the tree into two components where the edges are both connected. Basically, we consider an interactive problem on a tree where there is a hidden edge. We are allowed to ask queries of the form $(v,N_v)$ where $v$ is a vertex of the tree and $N_v$ is a set of neighbouring edges of $v$. Then the query returns to us whether the hidden edge is in the subtree of one of $N_v$ when we root the tree at $v$. We maintain a set of edges that the hidden edge can be in. In each query, we try to split the set of edges into two parts and ask a query to separate them. In the worst case, we replace the set of edges by the larger component. Let $R$ be the maximum ratio of the larger component. In [this blog](https://codeforces.me/blog/entry/120446)...

Full text and comments »

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

63.
By antontrygubO_o, 6 years ago, In English
SEERC 2020 and Grand Prix of Southeastern Europe ![ICPC Logo](https://codeforces.me/predownloaded/bd/ee/bdeeda86cddf592ba0fc788957a5b7303fffe303.png) Hi everyone, I am happy to announce that the 2020 Southeastern Europe Regional Contest will take place on May 23 [at 10 am UTC+3](https://www.timeanddate.com/worldclock/fixedtime.html?msg=SEERC+2020&iso=20210523T10&p1=3905&ah=5). The link to the live results will be published here after the start of the competition. Moreover, later this day, [at 4 pm UTC+3](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Grand+Prix+of+Southeastern+Europe&iso=20210523T16&p1=3905&ah=5), there will be the Grand Prix of Southeastern Europe based on these problems. Because of the Grand Prix, we are asking the official contestants not to discuss the problems in public. After it, we will upload the contest to the gym and publish the editorial. We hope that you will enjoy the contest. Good luck to all participants! **UPD.** [SEERC standings](https://olymp.org.ua/standings/acm-2021-...
**UPD3.** [Editorial](https://drive.google.com/file /d/13WApgof_TR5W-pokndhBQiqdny9wggVw/view?usp

Full text and comments »

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

64.
By -is-this-fft-, history, 10 months ago, In English
Fun fact about sync_with_stdio Consider this code: ``` #include <iostream> using namespace std; int main () { ios::sync_with_stdio(false); ios::sync_with_stdio(true); } ``` In GCC, are the C++ streams like `std::cout` etc then synchronized with the corresponding C methods like `printf`? <spoiler summary="Answer"> No &mdash; the second `sync_with_stdio` has no effect at all. There is no trick here: the booleans aren't being interpreted as pointers or anything like that. There is simply no code to handle turning synchronization back on. <spoiler summary="Implementation of sync_with_stdio"> ``` bool ios_base::sync_with_stdio(bool __sync) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 49. Underspecification of ios_base::sync_with_stdio bool __ret = ios_base::Init::_S_synced_with_stdio; // Turn off sync with C FILE* for cin, cout, cerr, clog iff // currently synchronized. if (!__sync && __ret) { // Make sure the standard streams are constructed. i...
// Turn off sync with C FILE* for cin, cout, cerr, clog iff // currently synchronized. if

Full text and comments »

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

65.
By carcinisation, history, 9 months ago, In English
Appeal for AhmetKaan Hello. After todays round, during system testing, our friend's account [user:AhmetKaan,2026-03-09] has been disabled. AhmetKaan has been an honest participant on Codeforces for more than 7 years, never resorting to cheating even with the ups and downs of his long journey. I can personally attest to the fact that he is an honest competitor, and would never do such a thing. We believe there has been a mistake and we ask for help to recover the account. [user:MikeMirzayanov,2026-03-09] [user:vladosiya,2026-03-09] **Edit:** Even though I have not much control over it, I am sorry for the complete mess this blog has turned into. Having to track all the updates and new arguments has become mentally extremely tiring for me and, I think, many of the people here. As I wasn’t actively commenting for the past few days, I have a lot of stuff to address. When the account was first disabled, I checked his submission for problem F [submission:365901157] (which was the hardest problem he s...
submitting from the file selector and he had named the files in a bad way. Though this was after the

Full text and comments »

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

66.
By SpyrosAliv, 6 weeks ago, In English
WorldQuant Round 1 (Codeforces Round 1128, Div. 1 + 2) <h4>Καλησπέρα/안녕/สวัสดี/أهلا/你好 Codeforces!</h4> <center> <img src="https://i.ibb.co/x85ZGVjm/verity.png" alt="verity" style="float:right; height: 154px; padding-left: 35px; padding-right: 73px; padding-top: 41px; padding-bottom: 33px;"/> </center> With great felicity, immense joviality, and unparalleled positivity, we, a team of authors united by our creativity, originality, ingenuity, and curiosity, consisting of [user:omsincoconut,2026-10-08], [user:chromate00,2026-10-08], [user:ttamx,2026-10-08], [user:yse,2026-10-08], [user:marszpace,2026-10-08], an individual of mysterious identity, and me, [user:SpyrosAliv,2026-10-08], have the distinct opportunity and absolute pleasure to invite you to [contest:2261], an event of exceptional quality and remarkable diversity, which will become a reality on [contest_time:2261]. You will be presented with <b>8 problems</b> of varying complexity, difficulty, and subtlety, with exactly <b>3 hours</b> of availability to demonstrate your...

Full text and comments »

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

67.
By EvenImage, history, 22 months ago, In English
IAEPC Preliminary Contest (Codeforces Round 999, Div. 1 + Div. 2) Editorial Thank you for participating in this round! Problems I are authored by [user:orzdevinwang,2025-01-20] and the rest by me. Sorry for the weak pretest in problem B. [problem:2061A] <spoiler summary="Hint 1"> What is the parity of $s$ after an operation? </spoiler> <spoiler summary="Solution"> [tutorial:2061A] </spoiler> [problem:2061B] <spoiler summary="Hint 1"> What is the condition for four edges to form an isosceles trapezoid? </spoiler> <spoiler summary="Hint 2"> How do you find two bases after fixing the length of the legs? </spoiler> <spoiler summary="Hint 3"> How do you choose two legs? </spoiler> <spoiler summary="Solution"> [tutorial:2061B] </spoiler> [problem:2061C] <spoiler summary="Hint 1"> How can you solve the problem in $O(n^2)$? </spoiler> <spoiler summary="Hint 2"> **No two liars can stand next to each other** is important. </spoiler> <spoiler summary="Solution"> [tutorial:2061C] </spoiler> [problem:2061D] <sp...
[Draft in Chinese](https://drive.google.com/file /d/1-NMKUs6uyWNztU_221VkGyLfQJ-CnBCt/view?usp

Full text and comments »

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

68.
By ko_osaga, 3 months ago, In English
Response to "Is IOI Becoming Too Heuristic?" I wrote a comment for [this post](https://codeforces.me/blog/entry/156303) by [user:AmShZ,2026-08-30] and it became too long, so I made a separate blogpost. Contains a bit of the spoiler for 2026 day 2 problems. ### On the title I define heuristic problems as problems for which there is no reasonable way to infer the score of your solution (full or partial) solely from the problem statement PDF. Your score depends not on the objective merit of your solution, but on what the author decided to put in the input file. Magic City has a solution that could reasonably be inferred solely from the PDF. It does not admit any heuristic that scores well. Therefore, I don’t think it is a heuristic problem. I highly object to heuristic problems in top-level contests, especially for high school students. But I don’t think this was an issue for IOI 2026, so I would not open that can of worms here. ### Problems too hard I think the main recurring issue with the IOI (not specific...
objective merit of your solution, but on what the author decided to put in the inputfile.

Full text and comments »

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

69.
By Golovanov399, 5 years ago, In English
A tool for testing interactive problems Hello, codeforces! I have created a tool for testing interactive problems. If you do not know what it is, I recommend you to read [Interactive Problems Guide](https://codeforces.me/blog/entry/45307) before/instead of reading this blog. It is important to understand that this tool does **not** help, in any way, to solve interactive (and all other types of) problems, where by "solve" I mean "come up with the solution". Today's June Lunchtime introduced an interactive problem called [XOR, The Detective](https://www.codechef.com/LTIME109A/problems/XORDETECTIVE), where I used my tool and it helped me to debug my solution, so I would like to use this chance to show the tool in work. With all of this out of the way, let's begin. Debugging interactive solutions in general ================== I can't say about everyone, but for me personally debugging a solution to an interactive problem is much harder than to a non-interactive one. First of all, basic testing on samples is already no...
-trivial: while usually I copy-paste the sample into a file, which I then read from, it does not work, positional arguments: Executable file of the solution to test

Full text and comments »

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

70.
By antontrygubO_o, 4 years ago, In English
SEERC 2022 and Mirror Contest ![ICPC Logo](https://codeforces.me/predownloaded/bd/ee/bdeeda86cddf592ba0fc788957a5b7303fffe303.png) Hi everyone! 2022 Southeastern Europe Regional Contest will take place tomorrow, on December 10. The contest was prepared by [user:bicsi,2021-12-09], [user:antontrygubO_o,2022-12-09], [user:theodor.moroianu,2022-12-09], [user:lungualex00,2022-12-09], [user:eudanip,2022-12-09]. Good luck to the official participants! There will be a mirror of this contest [this Sunday, December 11, 08:00 UTC](https://www.timeanddate.com/worldclock/fixedtime.html?msg=SEERC+2022+Mirror&iso=20221211T08&p1=1440&ah=5). It will be held by the link [https://seerc2022.eolymp.io/](https://seerc2022.eolymp.io/). We hope that you will enjoy the contest! See you on the scoreboard. **UPD1:** Congratulations to the winners of SEERC! This year, the contest was held on two sites, Ukrainian and Romanian. [Standings](https://eh211b8fkj.eolymp.space/s/seerc2022-ukr) and **Top 5 of Ukrainian site:*...
**UPD2:** [Editorial](https://drive.google.com/file /d/1MS0R9gT6XGpM_R1DIslzvhQ-MCMR4tIV/view)

Full text and comments »

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

71.
By huangzirui, history, 4 years ago, In English
Editorial of Codeforces Round 796 [problem:1688A] Idea: [user:huangzirui,2022-06-03]. Solution: [user:huangzirui,2022-06-03]. Preparation: [user:huangzirui,2022-06-03]. Good problem Average problem Bad problem Did not solve <spoiler summary="Hint"> Consider $x=2^k$ and $x\ne 2^k$ separately. </spoiler> <spoiler summary="Solution"> Let $p_i$ be the $i$-th bit of $x$, $q_i$ be the $i$-th bit of $y$ (both indexed from $0$). $x\ \texttt{and}\ y > 0\Leftrightarrow \exists i,\ p_i= q_i = 1$. $x\ \texttt{xor}\ y > 0\Leftrightarrow \exists i,\ p_i\ne q_i$. To satisfy the first condition, find the minimum integer $k$ satisfying $p_k=1$, and assign $1$ to $q_k$. If $x\ne 2^k$, the second condition is satisfied now. Otherwise, find the minimum integer $j$ satisfying $p_j=0$, and assign $1$ to $q_j$. The time complexity is $O(1)$. </spoiler> <spoiler summary="Code (C++)"> ```cpp #include<bits/stdC++.h> ...
Poly println(FILE *fp) const { fprintf(fp, "%d", a[0]); for (int i = 1; i < a.size(); ++i

Full text and comments »

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

72.
By Tlatoani, 6 years ago, In English
Codeforces Global Round 10 — Editorial We hope you liked the problems! We apologize for the weak pretests for A and B -- that was a major oversight on our part. Hopefully you were still able to enjoy the contest regardless :) We have to apologize to [user:antontrygubO_o,2020-08-16] a bit here -- the rejection count mentioned in the [editorial](https://codeforces.me/blog/entry/79974) for [contest:1372] actually also included this round, as the problems from that round and problems A through G in this round were created together. We did have one more problem rejected after that round happened, bringing up the total to 73. For reference, here are the overall rejection counts for each problem: <spoiler summary="Rejection Counts"> - A: 12 - B: 16 - C: **6** - D: 19 - E: 18 - F: 2 Total: **73** </spoiler> Without further ado, here are the tutorials for each of the problems: [tutorial:1392A] <spoiler summary="Solution (Kotlin) by golions"> ~~~~~ import java.io.* import java.util.* import kotlin.math...
~~~~~ //make sure to make new file! import

Full text and comments »

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

73.
By antontrygubO_o, 3 years ago, In English
SEERC 2023 and The 2nd Universal Cup. Stage 14: Southeastern Europe ![ICPC Logo](https://codeforces.me/predownloaded/bd/ee/bdeeda86cddf592ba0fc788957a5b7303fffe303.png) Hi everyone! 2023 Southeastern Europe Regional Contest will take place on December 9. The contest was prepared by [user:Pajaraja,2023-12-09], [user:milisav,2023-12-09], [user:bicsi,2023-12-09], [user:denis2111,2023-12-09], [user:antontrygubO_o,2023-12-09], and [user:RomaWhite,2023-12-09]. Good luck to the official participants! This contest will be used as Stage 14 of The 2nd Universal Cup (a week after the official contest). Therefore, we ask official participants to not publicly discuss the problems before the Universal Cup Stage. You will be able to participate in the UCup contest in the following time windows: <spoiler summary="Time windows"> 02:00 (UTC) on Saturday — 07:00 (UTC) on Saturday 05:00 (UTC) on Saturday — 10:00 (UTC) on Saturday 08:00 (UTC) on Saturday — 13:00 (UTC) on Saturday 11:00 (UTC) on Saturday — 16:00 (UTC) on Saturday 13:00 (UTC) ...
**UPD3:** [Editorial](https://drive.google.com/file /d/1hSVR-w5jjk4XiKmmx9jkicwKFg1o2w8Q/view?usp

Full text and comments »

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

74.
By beyondpluto, 20 months ago, In English
True Codeforces Heatmap (Based on Rating) — Chrome Extension # Rating-Based Heatmap: Visualize Real Progress! **[Download from Chrome Web Store](https://chromewebstore.google.com/detail/codeforces-rating-based-h/heajdhmohlobjebkgkpdomkaihaghkgb)** Are you tired of the default Codeforces heatmap that merely tracks the number of problems solved without reflecting the actual effort behind each? Wouldn't it be great to see how much hard work you invested each day? Introducing the **Codeforces Rating-Based Heatmap Extension** — a clearer way to reflect your real progress! --- ## Why Settle for Less? The default Codeforces heatmap colors days based solely on the quantity of problems solved. It doesn't differentiate between solving easy Div3 problems or tackling complex Div1 challenges. This approach doesn't truly represent the difficulty you faced. Additionally, some users may focus on solving easy problems just to maintain a streak. While streaks can be motivating, they don't always reflect real progress in problem-solving. True p...
-Extension?tab=readme-ov-file).

Full text and comments »

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

75.
By adamant, 13 years ago, translation, In English
C++ STL: Policy based data structures Hi everyone! After a relatively long lull, I decided that <s>my contribution growing too slowly</s> the hour has come to please you with another article in the blog _:)_ 2 months ago user [user:Perlik,2014-03-19] wrote an [article] (/blog/entry/10355), in which he described a very interesting STL implemented data structure that allows you to quickly perform various operations with substrings. Some time after I tested it on various tasks and, unfortunately, tend to get a negative result &mdash; rope was too slow, especially when it came to working with individual elements. For some time, I forgot about that article. Increasingly, however, I was faced with problems in which it was necessary to implement set with the ability to know ordinal number of item and also to get item by its ordinal number (ie, order statistic in the set). And then I remembered that in the comments to that article, someone mentioned about the mysterious data structure order statistics tree, which supports th...
~~~~~ #include // Common file #include

Full text and comments »

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

76.
By purplesyringa, history, 3 years ago, In English
This one weird trick will speed up your I/O 5x Just do this!! ```cpp #include <iostream> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); // Your code here int n; std::cin >> n; long long sum = 0; for (int i = 0; i < n; i++) { int x; std::cin >> x; sum += x; } std::cout << sum << std::endl; } ``` This will speed up your code so much you won't have to care about spending time in I/O anymore!! Give likez plz :3 [cut] <!-- --> --- Yeah, no. That's not how it works. We're still using `<iostream>`, and that means we have to rely on virtual inheritance and all the deoptimizations that follow from that. Even if you use a random "here's-my-fast-io-library" snippet from Codeforces, you still depend on block-buffered output. (Also, none of those libraries mesh well with floats.) In many cases, more CPU time is spent encoding/decoding numbers than interacting with the file system. Can we do better? ...Yeah, stupid que...
writing to a file. Generally speaking, output performance increases and input performance decreases, - `mmap` for input, if it's a regular file (similarly on Windows) - `MAP_NORESERVE`-based large, /decoding numbers than interacting with the file system.

Full text and comments »

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

77.
By adamant, history, 4 years ago, In English
Duality in linear programming. Part 2 — in competitive programming Hi everyone! Previously, I wrote a [general introduction](https://codeforces.me/blog/entry/105049) to linear programming duality. In this blog, I would like to write about several problems that could be solved with this technique. Familiarity with the first blog, or general knowledge of dual problems and how to construct them is generally expected to navigate in this one. Thanks to [user:brunovsky,2022-08-09] and [user:Golovanov399,2022-08-09] for problem suggestions! And particularly special thanks to [user:WeakestTopology,2022-08-09] for problem suggestions and all insightful discussions on the topic! [cut]<br> ### Dual construction mnemonics To simplify the construction of dual problems, let's recall the correspondence between constraints/variables in primal and dual problems. <spoiler summary="LP duality mnemonics"> Standard definition of LP dual problem looks like this: $$\begin{gather} \max\limits_x & c^\top x & \color{red}{\text{(maximization)}} & \ove...
[Possible implementation](https://gist.github.com/adamant-pwn/77eae6060d5cc0e6cb91f05aa827c4aa# file

Full text and comments »

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

78.
By Qingyu, 3 months ago, In English
The 4th Universal Cup Semifinals Hi all! It has been quite a while since my last post about the Universal Cup, so here is proof that we are still alive and kicking :) We are excited to announce that **The 4th Universal Cup Semifinals** will take place on **October 11th, 2026**! As in previous seasons, the Semifinals will be held online, and top-performing teams will have the opportunity to advance to **The 4th Universal Cup Finals**, which we hope to hold in 2027. We are introducing the new contest format: the Semifinals will be **6-hour contests**. The idea of extending the contest duration was first discussed before The 3rd Universal Cup Finals, and we would like to use this opportunity to see how well a longer team contest format works for our competition. *Based on how the Semifinals go, we will decide whether to adopt a similar format for The 4th Universal Cup Finals.* The draft of the detailed rules can be found [here](https://qoj.ac/files/Qingyu/The%204th%20Universal%20Cup%20Semifinals%20Rules%20v1....

Full text and comments »

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

79.
By gKseni, 10 years ago, translation, In English
Code Festival 2016: interview and photos from participants [Code Festival 2016](http://codeforces.me/blog/entry/48616) was held in Tokyo on 25-30 of November. Boris [user:qwerty787788,2016-12-13] Minaev has shared with us his impressions, and Maxim [user:Zlobober,2016-12-13] Ahmedov and Nicolay [user:KAN,2016-12-13] Kalinin shared photos. &mdash; _To start with, let's mention that,_ [AtCoder](https://atcoder.jp/) _and_ [Indeed company](http://ru.indeed.com/about) _announced the festival. How many quals were there? In what way were they arranged?_ &mdash; There were 3 contests, in which you could take part. In the first part TOP-10 were selected, in the second one — TOP-5, the third one — TOP-5. To sum up, there are 20 foreigners to be selected. &mdash; _Which quals the Japanese had then?_ &mdash; Probably the same, but 200 participants passed the qual there. &mdash; _That means, the event is more orientated on Japanese people?_ &mdash; The previous years the event was held only for Japanese, this year they decided ...

Full text and comments »

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

80.
By TheScrasse, history, 4 years ago, In English
Competitive Programming Roadmap (target: [gray, blue]) tl;dr ------------------ - Competitive programming roadmap [here](https://drive.google.com/file/d/16Jydn250Ue7K7hOfzLxw4p5jFF4ZCqWT/view?usp=sharing). - It should be suitable both for newcomers and for people with some experience with CP: let's say, up to blue on Codeforces. - It contains ~ 100 "must-know" problems about various topics: ad-hoc, STL, binary search, DP, number theory, graphs. - There are solution sketches at the bottom, don't feel guilty reading them if stuck. Why? ------------------ Many people new to Codeforces seek advice about how to get better / which problems to try. Other people are stuck on gray / green even after solving a lot of problems. This roadmap aims to be a solution. My take: to be good at competitive programming, you have to know "what to think" and "how to think" when you try a problem. - "What to think": you have to know a decent amount of standard problems / techniques. Sometimes, a problem requires steps / observations that seem ob...
- Competitive programming roadmap [here](https://drive.google.com/file/d

Full text and comments »

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

81.
By peltorator, 3 years ago, In English
A story about the worst contest organization ever. Or how to invent rules to have rules. Today, the European Championship was held in Prague. The first of its kind. And it was... the worst organized contest I have ever participated in. This is not only sad in isolation but also especially sad as the contest itself (the problems) was actually nice, and I would like to thank the authors for that! So what was so bad about it? Let me describe how entering the contest works. One first goes to the cloakroom. Then, one proceeds via a long corridor to another building, where in a relatively small space, all teams gather for half an hour. Then, "id check" begins. I mean... I have never seen this before but in itself, there is nothing wrong with it. They want to check your identity. Makes sense. However, what do you think would be a reasonable way to do it? I would think that one and only reasonable way to do it is the following: one comes to the entrance of the contest area, a volunteer checks their id and matches with their badge, and the contestant comes in. As you could ha...
the dress rehearsals, we were given this transparent file which is supposed to hold a single piece

Full text and comments »

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

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

Full text and comments »

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

83.
By MohammadParsaElahimanesh, 4 years ago, In English
Codeforces Global Round 23 Editorial Hi Codeforces, I've tried my best to make a different editorial, I wish you enjoy it ... [problem:1746A] problem author: [user:MohammadParsaElahimanesh,2022-10-15], [user:AmirrzwM,2022-10-15] <spoiler summary="step by step solution"> step 1: It's obvious that the answer is "NO" if $a_{i} = 0$ for all $1 \le i \le n$. step 2: Lets prove that the answer is "YES" if $a_{i} = 1$ for at least one $1 \le i \le n$. step 3: If size of $a$ is equal to $k$, just use second type operation once and we are done. step 4: Otherwise (if $|a| > k$), there will be three cases: (assume that $a_{j} = 1$) - if $j > 2$, you can use first type operation on first and second element and decrease size of $a$ by 1. - else if $j < |a|-1$, you can use first type operation on last and second to last element and decrease size of $a$ by 1. - else, it can be shown easily that $|a| = 3$ and $k = 2$ so you can use second type operation twice and turn $a$ into a single $1$. In ...
![ ](https://s24.picofile.com/file/8454163142/half_cut.jpeg), ![ ](https://s25.picofile.com/file/8454163150/coord.jpeg)

Full text and comments »

84.
By riadwaw, 7 years ago, In English
Using your own library on codeforces in 0 clicks In my opinion it's not interesting part of the contest to write algorithms you have already written dozens of times. I kind of see why people who prepare to IOI/ICPC would do that, but not other participants. So I created yet another tool that allows to use your own library locally and submit to CodeForces. Idea is that you write in one file, then submit another file and you don't need to do any other action to actually generate file to submit (once everything is configured) ##Demo <iframe width="560" height="315" src="https://www.youtube.com/embed/iUMgmGK8-xc" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> The tool consists of two independent parts [inline_includes](https://github.com/AlexeyDmitriev/inline_includes): this is a simple python script that inlines all the includes you used from whitelist of directories (so that standard headers such as <vector> are not inlined). It's far from suppo...
CodeForces. Idea is that you write in one file, then submit another file and you don't need to do, for each file `file` in source directory it virtually creates file `file` is the mounted directory, Manual: It's just a python file, you can grab it from [github](https://github.com/AlexeyDmitriev

Full text and comments »

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

85.
By dXqwq, 4 months ago, In English
The 8th Turing Cup Tournament **UPD 1: Submitting a recording will be required in order to win (division top 3 or best female coder) prize. The format of the recording & rules are the same with [AGC](https://atcoder.jp/posts/agc_proctoring_en).** **UPD 2: We've noticed that contest is unavailable in the X-Camp Contest System. We are investigating.** **UPD 3: International contestants should also register at XinYouDui contest system.** **UPD 4: You should submit your video file(or url) to `[email protected]`.** # 2026 · The 8th Turing Cup Tournament The Turing Cup is an invitational competition that is organized by one of the most successful informatics competition teams in China, the XinYouDui and partner with X-Camp Academy. ## Timeline | Event | Time (UTC+8) | |----------------------|-----------------------------------------| | Registration Time | Jun 18, 2026, 06:00 PM &mdash; Jul 30, 2026, 12:29 PM | | Opening Ceremony | Jul 30, 2026, 07:...
**UPD 4: You should submit your video file(or url) to `[email protected]`.**

Full text and comments »

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

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

Full text and comments »

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

87.
By adamant, history, 5 years ago, In English
Theoretical grounds of lambda optimization Hi everyone! This time I'd like to write about what's widely known as "Aliens trick" (as it got popularized after 2016 IOI problem called [Aliens](https://ioinformatics.org/files/ioi2016problem6.pdf)). There are already some articles about it here and there, and I'd like to summarize them, while also adding insights into the connection between this trick and generic Lagrange multipliers and Lagrangian duality which often occurs in e.g. linear programming problems. Familiarity with a [previous blog](https://codeforces.me/blog/entry/98524) about ternary search or, at the very least, definitions and propositions from it is expected. Great thanks to [user:mango_lassi,2022-01-01] and [user:300iq,2022-01-01] for useful discussions and some key insights on this. Note that although explanation here might be quite verbose and hard to comprehend at first, the algorithm itself is stunningly simple. Another point that I'd like to highlight for those already familiar with "Aliens tr...

Full text and comments »

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

88.
By brunomont, 6 years ago, In English
[Tutorial] Range minimum query in O(1) with linear time construction <spoiler summary="TL; DR"> Build a sparse table over blocks of size $b = 30 \geq \log{n}$. Now we only need to answer queries of size smaller than $b$. For that, simulate a minqueue of size $b$ over the array, and store a mask of the elements that are currently active in the minqueue. Let $\text{mask[r]}$ be the minqueue mask when the simulation is at position $\text{r}$. Now we can see that, if $r-l+1 \leq b$, then `query(l, r) = r - most_significant_set_bit(mask[r] & ((1<<(r-l+1))-1))`. ~~~~~ template<typename T> struct rmq { vector<T> v; int n; static const int b = 30; vector<int> mask, t; int op(int x, int y) { return v[x] < v[y] ? x : y; } int msb(int x) { return __builtin_clz(1)-__builtin_clz(x); } int small(int r, int sz = b) { return r-msb(mask[r]&((1<<sz)-1)); } rmq(const vector<T>& v_) : v(v_), n(v.size()), mask(n), t(n) { for (int i = 0, at = 0; i < n; mask[i++] = at |= 1) { at = (at<<1)&((1<<b)-1); while (at and op(i, i-msb(at&-at)) == i) at ...
://drive.google.com/file/d/1trgA7bKSj4sCGaFmlrV0BmS6da6KdJ3_/view?usp=sharing) to the benchmark files).

Full text and comments »

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

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

Full text and comments »

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

90.
By Qingyu, 3 years ago, In English
The 2nd Universal Cup. Stage 23: Shanghai (ICPC Asia EC Finals 2023) Hello everyone! We are thrilled to invite you to **The 2nd Universal Cup, Stage 23: Shanghai**, taking place on February 17th, 2024. This stage is based on The 2023 ICPC Asia East Continent Final Contest, which is the last contest in the Asia EC Region in this season. 280 official teams participated in the onsite contest competed for the last WF slots of the season. ![ ](https://qoj.ac/files/Release3/6875e339dc233927a4d8ddc678b98410.png) I would like to thank all task writers for their efforts on preparing the contest. They are [user:dXqwq,2024-02-16], [user:jqdai0815,2024-02-16], [user:Kubic,2024-02-16], [user:littlelittlehorse,2024-02-16], [user:MagicalFlower,2024-02-16], [user:Qingyu,2024-02-16], [user:QuietBeautifulThoughts,2024-02-16], [user:unputdownable,2024-02-16], and [user:xyz2606,2024-02-16]. Also a big thank you to all the people who tested the contest and gave their valuable advice: [user:__ZMF__,2024-02-16], [user:antontrygubO_o,2024-02-16], [user:chenjb,2...

Full text and comments »

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

91.
By eatmore, history, 8 years ago, In English
New Code Jam interface: a step back in usability [This post](https://groups.google.com/d/topic/google-code/9SlOptq6gIc/discussion) in Code Jam group Hi all! This year, Google has again decided to change Code Jam user interface. The new interface has already been used for Code Jam to I/O for Women and Kick Start rounds, and from what I saw, it is even worse than the last year. Let's start. [![ ](https://i.imgur.com/sACL7ko.png)](https://i.imgur.com/sACL7ko.png) This is what I saw when I opened Code Jam main page. This year it uses even longer domain name, [codingcompetitions.withgoogle.com](https://codingcompetitions.withgoogle.com/), and some text seems to be missing. After some investigation, I found that this occurs when a browser is configured to block third-party cookies. I configure my browser this way because I don't want some companies to track me around, and for nearly all sites, this causes no issues. On some sites, blocking third-party cookies causes single sign-on to stop working, but this is understandable. Code ...
, the panel appeared (but my code disappeared, fortunately, I had it saved to a file). Then I could

Full text and comments »

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

92.
By TheScrasse, history, 2 years ago, In English
Editorial of Codeforces Round 975 (Div. 1, Div. 2) All the Polygon materials (including the official implementations of all the problems) are [here](https://drive.google.com/file/d/1zWk5N_iF3TWbzzab5IAIza78_FohSZtP/view?usp=sharing). [problem:2019A] Author: [user:TheScrasse,2024-09-27]<br> Preparation: [user:TheScrasse,2024-09-27] <spoiler summary="Hint 1"> Can you reach the score $\max(a) + \lceil n/2 \rceil$? </spoiler> <spoiler summary="Hint 2"> Can you reach the score $\max(a) + \lceil n/2 \rceil - 1$? </spoiler> <spoiler summary="Solution"> The maximum red element is $\leq \max(a)$, and the maximum number of red elements is $\lceil n/2 \rceil$. Can you reach the score $\max(a) + \lceil n/2 \rceil$? - If $n$ is even, you always can, by either choosing all the elements in even positions or all the elements in odd positions (at least one of these choices contains $\max(a)$). - If $n$ is odd, you can if and only if there is one occurrence of $\max(a)$ in an odd position. Otherwise, you can choose even position...
](https://drive.google.com/file /d/1zWk5N_iF3TWbzzab5IAIza78_FohSZtP/view?usp=sharing).

Full text and comments »

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

93.
By DNR, 5 months ago, In English
So you're a proud ratist? Here's why that's problematic (GRAYtist v1.1 out now) Just kidding, I'm one too. <img src="https://raw.githubusercontent.com/welcome-to-the-sunny-side/graytist/main/public/wordmark.png?v=2" alt="GRAYtist" style="float:right; width:400px; height:auto; margin-left:24px; margin-bottom:8px;"> Introducing [GRAYtist](https://chromewebstore.google.com/detail/graytist/bflnfmllkbhilogfbdilcckpkfganelc), a browser extension that helps you filter out low-quality content from Codeforces. You might say: "B-b-but [user:DNR,2026-06-12], such a tool would surely spam some API calls or use some heavyweight classifier models! My potato PC couldn't handle it, right?!". Wrong. We instead use the principle of ratism ($P(\text{low rating} \iff \text{low quality}) \approx 1$) to optimize away all of that nonsense. <div style="clear:both;"></div> ### Features ##### 1. Filter blogs by author rank and title. - Don't want to see blogs from grays because they're annoying, and blogs from nutellas because they make you feel inferior? GRAYtis...
-the-sunny-side/graytist/releases/latest). 2. Open it in Firefox and drag the file into a Firefox

Full text and comments »

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

94.
By antontrygubO_o, 4 years ago, In English
The 1st Universal Cup. Stage 4: Ukraine Hello everyone! The 4th Stage of the 1st Universal Cup: Ukraine, will be held on Feb 18th, 2023. The contest is based on 1/8 and 1/4 Ukrainian stages of SEERC 2023, plus some extra problems. Please, don't participate, if you have seen these problems. This contest also serves as Day 1 in [Osijek Competitive Programming Camp 2023](https://codeforces.me/blog/entry/110945) on February 18, 2023. Author of all problems: [user:antontrygubO_o,2023-02-14]. I hope you like the problems. You can participate in the contest in the following three time windows: * Feb 18th 13:00 &mdash; 18:00 (UTC +8) * Feb 18th 19:00 &mdash; 24:00 (UTC +8) * Feb 19th 02:00 &mdash; 07:00 (UTC +8) Please note that you can see two scoreboards in DOMjudge. The 'Local Scoreboard' shows the standings ONLY IN THE CURRENT TIME WINDOW. And the 'Combined Scoreboard' shows all participants, including the onsite participants, and the cup participants in the previous time windows. Contest link: https://domj...
**UPD1:** Thanks for your participation! Here is [Editorial](https://drive.google.com/file/d

Full text and comments »

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

95.
By Al.Cash, 10 years ago, In English
Fast and furious C++ I/O For a long time I've been upset with C++ standard input/output. First of all, I heard that `fread`/`fwrite` are much faster than everything else, and it's impossible to get good times on problems with huge input or output without using those. Secondly, it's really annoying to write formatting string and ampersands in `scanf`, especially with many variables to read. Thirdly, the only way to expand I/O to custom types is by overloading `<<` and `>>` operators on streams, but they are the slowest. I tried to tackle all these issues in my implementation. Remember, that it's targeted for the common use case in programming contests, so it's not as flexible as one might wish. [The code is here](http://ideone.com/X1tP8Q) **Doesn't compile with MSVS.** I apologize in advance to everyone, who will be scrolling through this 500 lines trying to read my solutions. Also it's not advised for people without broad experience with C++ to try to understand the entirety of it (dangerous for your men...
input.reset(new InputFile("input.txt")); // local testing using a file output.reset(new OutputFile, ### 1. File management

Full text and comments »

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

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

Full text and comments »

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

97.
By rabaiBomkarBittalBang, 5 years ago, In English
Codeforces Round #724 — Editorial We hope you liked the problems! If you’re curious about the two different problem formats, initially [user:Tlatoani,2021-06-06], [user:golions,2021-06-06], [user:qlf9,2021-06-06] and I were working on Omkar 3 with [user:antontrygubO_o,2021-06-06] while [user:hu_tao,2021-06-06] was working on a separate round with [user:isaf27,2021-06-06]. We eventually decided to join forces and combine the rounds, resulting in the current Omkar 3. <h1>[problem:1536A]</h1> Idea: [user:rabaiBomkarBittalBang,2021-06-06] Preparation: [user:rabaiBomkarBittalBang,2021-06-06], [user:Tlatoani,2021-06-06], [user:qlf9,2021-06-06] [Video editorial](https://www.youtube.com/watch?v=GZeihS2xTSc) <spoiler summary="Hint"> Consider what happens when $a$ contains a negative number. </spoiler> <spoiler summary="Solution"> We first claim that if any negative number exists in $a$, then no solution exists. Denote $p$ as the smallest number in $a$ and $q$ as another arbitrary number in the array (as $n...
~~~~~ //make sure to make new file! import

Full text and comments »

98.
By Wandoka, history, 2 years ago, In English
How optimal is your CP setup? Click here and find it out! Recently I thought a lot about optimizing my setup. I don't think it is an important aspect of cp, as it barely affects the performance, but it is fun to think about nonetheless. In this blog, you will be able to determine whether you have an optimal setup or not. I will list the criteria and points you get for satisfying each one of them. In the end, I do the breakdown for different point ranges. I won't include things like **having a monitor** or **having an internet connection**, but I will be including basically everything else that comes to my mind. If you see something missing from the list, let me know in the comments, I will probably update my list then. This blog is mainly made for laughs, but if you are new, you will probably learn something new, even though **it won't help you to increase your rating**. ### You can compile and run your code. - $0$ points: I don't know how to run my code before submitting - $10$ points: I compile my code b...

Full text and comments »

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

99.
By dmkozyrev, history, 8 years ago, translation, In English
[Tutorial] Rolling hash and 8 interesting problems [Editorial] **UPD**: while I was translating this post from Russian to English, [user:dacin21,2018-07-06] wrote his post, more advanced, [link](http://codeforces.me/blog/entry/60442). I hope that my post will help beginners, but in my post more rough estimates. And in Russia we call **rolling hashes** as a **polynomial hashes**. Hello, codeforces! This blogpost is written for all those who want to understand and use polynomial hashes and learn how to apply them in solving various problems. I will briefly write the theoretical material, consider the features of the implementation and consider some problems, among them: 1. Searching all occurrences of one string of length $n$ in another string length $m$ in $O(n + m)$ time 2. Searching for the largest common substring of two strings of lengths $ n $ and $ m $ $(n \ge m) $ in $O((n+m \cdot log(n)) \cdot log(m))$ and $O(n \cdot log(m))$ time 3. Finding the lexicographically minimal cyclic shift of a string of length $ n $ in $ O(n \cdo...
In a single line of the INPUT.TXT input file, a string consisting of characters with ASCII codes, In output file OUTPUT.TXT print one integer — the answer to the problem. , In the output file OUTPUT.TXT output the number of suffixes of the string S having the same cyclic, In the single line of the input file INPUT.TXT a string consisting of characters with ASCII codes, Output one line in the output file OUTPUT.TXT — the minimal lexicographic shift of the input, The first line of the input file INPUT.TXT contains the string a (1 \le |a| \le 10^5). The second, The input file INPUT.TXT contains a string S consisting of at least one and not more than 100 000, The output file OUTPUT.TXT needs to output all positions of the occurrence of the string T in the, Write the answer in the output file OUTPUT.TXT.

Full text and comments »

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

100.
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/...
Championship](https://drive.google.com/file /d/1ko2MPHtpfx2QcDNsYwuOnmHq-vMmqVkC/view) | [gym](https, ](https://docs.google.com/file/d/0B2Ngq3HnXyp3YUg5V0dNQ2FoeWM/edit?usp=sharing) | [opentrain](http

Full text and comments »

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

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

Full text and comments »

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

102.
By -is-this-fft-, history, 3 years ago, In English
[Tutorial] The residual graph and working with the set of all minimum cuts I have previously written about flows in these blogs: [1](https://codeforces.me/blog/entry/104960), [2](https://codeforces.me/blog/entry/105330), [3](https://codeforces.me/blog/entry/105658). Minimum cuts are a very fascinating topic for me. There are a lot of maximum flow problems where there's a fairly simple chain of reductions leading to "you should use flow", but there are also a lot of flow problems where flow comes apparently out of nowhere. Particularly fascinating are those where it's more convenient to think in terms of minimum cut: they work, because minimum cut allows you to model partitioning a set in two, with some additional implication-like constraints. Here are a couple of problems with that nature: - [ARC085E \- MUL](https://atcoder.jp/contests/arc085/tasks/arc085_c) (this reduction is almost standard these days) - [ARC142E \- Pairing Wizards](https://atcoder.jp/contests/arc142/tasks/arc142_e) - [problem:104925D] There are also flow problems on graphs ...

Full text and comments »

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

103.
By BucketPotato, history, 3 years ago, In English
California Informatics Competition (CALICO) Spring '24 ![ ](/predownloaded/f1/9a/f19ab0ba793a4707722850061317caa25b635ba4.png) **Edit: Registrations have been extended! They will now close 4/26 at midnight PT! Register while you still can!** Hello Codeforces! We are excited to invite you to compete in CALICO Spring '24! The contest starts [Saturday, April 27, 2024 at 4:00 p.m. PT](https://timeanddate.com/s/43cu) and will be 3 hours long. **Registrations are now open** and will be until April 26, 2024 at 11:59 p.m. PT, so [register here while you can](https://calico.cs.berkeley.edu/register/)! The contest will take place on our [custom judge platform](https://calicojudge.com/) and for the first time, contestants can compete **online or in-person at UC Berkeley**! #### In-Person Contest (New!) The CALICO team is proud to announce our **first in-person contest ever**—that's right, CALICO will be happening **LIVE** at UC Berkeley! We’ll be providing in-person contestants with exclusive merch, dinner, and opening/closing ceremoni...

Full text and comments »

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

104.
By riadwaw, 12 years ago, In English
JHelper 0.18 Hi, Codeforces. [Changelog](https://github.com/AlexeyDmitriev/JHelper/wiki/Changelog): * 0.18 * CopyAction now regenerates output file * 0.17 * Support for inline inlining for topcoder * 0.16.4 * Support for WSL * 0.16.3 * Support CLion 2020.1 * 0.16.2 * Support CLion 2019.1 * 0.16 * Auto switching to a file when changing task * Auto selecting task when changing a file JHelper is plugin for writing contests in C++. You may inline code from your own prewritten library so that you can submit only used code. Besides, it allows to test on tests you've added. it's planned that you'll be able to parse a problem/contest and have all samples tests automatically added. It's available for [CLion](https://www.jetbrains.com/clion/) Plugin is completely free. IDE price is 89$/year, but it's free for students, have 30-days free trial and often you can use EAP(smth like beta)-versions for free. You may download the plugin using JetBrains p...
* 0.18 * CopyAction now regenerates output file * 0.17 * Support for inline inlining for

Full text and comments »

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

105.
By dj3500, 9 years ago, In English
Helvetic Coding Contest 2018 online mirror **UPDATE: the editorial is [here](https://assets.codeforces.com/files/helvetic/helvetic-coding-contest-2018-editorial.pdf)** Hello CodeForces! This year again, I'd like to invite you to the online mirror of an open championship of Switzerland called HC2 (the Helvetic Coding Contest). A mirror was also held [last year](http://codeforces.me/contest/802) and [two years ago](http://codeforces.me/contest/690). ![ ](http://dj3500.webfactional.com/petr-meme.jpg) [The Helvetic Coding Contest](http://hc2.ch/) is a yearly contest held at [the EPFL](http://epfl.ch/) in Lausanne by the [PolyProg](http://polyprog.epfl.ch/) association. The contest itself took place on March the 17th, but the online mirror is scheduled on [**Saturday, 14th of April, 10:05 Moscow time**](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Helvetic+Coding+Contest+2017+online+mirror&iso=20180414T0705&ah=4&am=30). The duration is 4:30. Rules: - you can participate in teams or individually (1-3 peo...

Full text and comments »

Tags hc2
  • Vote: I like it
  • +240
  • Vote: I do not like it

106.
By nifeshe, 2 years ago, In English
How to find alts Yesterday some guy posted a blog about accidentally submitting a solution to a problem in the most recent round meaning to do it after the contest ends. He entered a competition, lost 233 rating and then requested to make the contest unrated to him. As it is already clear to probably everyone, he participated from an alt and meant to submit from it, but for some reason logged in from his main. <spoiler summary="Screenshot"> ![ ](https://i.imgur.com/4kLqB3o.png) </spoiler> I quickly found his alt and made a comment. Shortly after that he deleted the blog. ![ ](https://i.imgur.com/n5P4avz.png) Here is a guide on how to find alts! ### Look at the submissions This method works very frequently. What do people oftenly do after participating in a contest from an alt? They resubmit all the problems from their main. This is how it looks like in the example above: ![ ](https://i.imgur.com/Vnvu4aD.png) 5 problems were submitted in 1 minute. It means that the guy was either ...
``` from google.colab import files, # Provide a link to download the file in Google Colab files.download(output_file) ```

Full text and comments »

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

107.
By BERNARB.01, 3 years ago, In English
IIOT 2024 (UPD: +Online mirror) The international finals of the International Informatics Olympiad in Teams (IIOT) 2024 will be happening in the next couple of days. It will be hosted by Syria as a hybrid event. There will be 20 participating teams from 10 different countries. Contest format: <ul list> <li>7-10 problems (including subtasks)</li> <li>4 hours</li> <li>4 contestants and 2 computers per team</li> </ul> Authors of the problems used in this contest: Péter [user:peti1234,2024-05-09] Gyimesi, Áron [user:mraron,2024-05-09] Noszály, Bernard [user:BERNARD,2024-05-09] Brahimsha, Alessandro [user:bortoz,2024-05-09] Bortolin, Zsolt [user:birka0,2024-05-10] Németh, Mihnea-Vicențiu [user:MVB,2024-05-09] Bucă, Péter Csorba, and Gabriella Blénessy. People who helped preparing the problems: [user:davi_bart,2024-05-10], [user:Kaey,2024-05-10], [user:Virv,2024-05-10], [user:ApraCadabra,2024-05-10], and [user:stefdasca,2024-05-10]. The practice round will be tomorrow on [Friday, 10 May 2024, 17:30](htt...

Full text and comments »

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

108.
By maomao90, history, 5 months ago, In English
Why is std::deque, std::stack, and std::queue slow and memory inefficient? ## Sidetrack It has been two years since I wrote an educational blog. I've been inactive in the CP community recently as I've shifted my focus to internships. Recently, I observed some interesting behaviour with `std::queue` while profiling an application during my internship, which led me to writing this blog. Most of the images below are taken from the C++ standard https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf ## Queues and stacks Queues and stacks do not actually provide any new implementations... They are just wrappers around a container (which is `std::deque`) by default. ![C++ standard std::queue 1](https://codeforces.me/predownloaded/3d/63/3d63990fec1b19722e82b6e01b85679b548b831f.png) ![C++ standard std::queue 2](https://codeforces.me/predownloaded/f4/b3/f4b315a2b12be6525865df61b31aa71bc1b8bbd6.png) ![C++ standard std::stack 1](https://codeforces.me/predownloaded/c0/64/c06407b9c38d964cf8444bb75ed33853e9ffd20b.png) ![C++ standard st...

Full text and comments »

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

109.
By commandox, 10 months ago, In English
[UNMAINTAINED] [v1.0.1] OI-TED-ARCHIVE — Preserve OI resources before they disappear Goodluck for IOI2026, APIO2026 and Other OI2026. APIO2026, BOI2026, EGOI2026, COCI2026, USACO2026, NOISG2026 Uploaded to internet archive Future TODO 2026 - CEOI July 5-7, 2026 - EJOI July 24-30 2026 - IOI August 9-16, 2026 - JOI (todo) - IZHO (task possible only) OI 2026 Blog: https://codeforces.me/blog/entry/149727 --- # OI-TED-ARCHIVE **OI Tasks + Editorial + Testdata Archive (+ Graders & Results)** **Goal:** Preserve complete Olympiad in Informatics resources before they disappear. --- ## Current Status **Latest progress:** https://docs.google.com/spreadsheets/d/1XPHTMTUGaKrDvCvNyh6LWuWEddNSxwxJhEB2NlUezOI/edit?usp=sharing For Upcoming Problems, 2 Major release will be made each year. Expect First Update around July-Auguest. --- ## OI-TED-ARCHIVE LINKs > Check Sheet ["ARCHIVE"](https://docs.google.com/spreadsheets/d/1XPHTMTUGaKrDvCvNyh6LWuWEddNSxwxJhEB2NlUezOI/edit?gid=118823279#gid=118823279) for Detailed & Updated Archive Info > Ite...

Full text and comments »

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

110.
By EnDeRBeaT, 3 years ago, In English
[Tool] Graph Debugger Hi, CodeForces! For the past 2 months I have been working on a Graph Debugging tool, which allows you to draw graphs like these with just **TWO** lines of code: ![ ](/predownloaded/42/15/4215be4db6122c5583244a262d651c2dc5ae6b81.png) This is similar to print debugging (when you got a crash somewhere, so you repeatedly recompile the code with `cout << "penis\n";` to see where it failed), but instead it creates a window with the graph, which you can change however you want. It is also a marginally better tool than graph editor from CSAcademy in my opinion, so I would love you guys to try it out. This is not compatible with MacOS because Apple deprecated OpenGL (and even if it wasn't, it would've been kinda annoying to use) ## Building First, build the code from the repo: https://github.com/EnDeRGeaT/graph-debugger If you write in Visual Studio (not Visual Studio Code), follow "For MSVC" part. If you write in anything else, you probably should follow "For GCC/...

Full text and comments »

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

111.
By LoneFox, history, 5 years ago, In English
Facebook Hacker Cup 2021: Qualification Round **The Qualification Round of the 2021 Facebook Hacker Cup is less than 48 hours away!** The round will begin on [**August 27th, 2021 at 10am PDT**](https://www.timeanddate.com/countdown/generic?iso=20210827T10&p0=224&msg=Hacker+Cup+Qualification+Round&font=slab) and will last for **72 hours (3 days)**. The contest can be found [**here**](https://www.facebook.com/codingcompetitions/hacker-cup/2021/qualification-round). **Everyone who solves at least one problem correctly will advance to Round 1**, which will take place on September 11th. Please note that all submission judgments will only be revealed after the round ends. More details about rules and other information can be found in the [FAQ](https://www.facebook.com/codingcompetitions/hacker-cup/2021/qualification-round/faq). Registration will remain open on the contest page until the end of the Qualification Round. Once you've registered, you may wish to confirm that the information in your [competition profile](https://www....
files. For each problem, you'll now download the full input in a password-protected zipfile, and the

Full text and comments »

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

112.
By WasylF, history, 10 years ago, In English
CF-Predictor — Know your rating changes! <spoiler summary="UPD 2 Sep 2018"> I've deployed an update today. If you face any issues with CF-Predictor, please let me know :) </spoiler> Hi guys! As I mentioned on previous contest I'm working on tool that predicts rating changes. I'm happy to present it now! ![ ](https://github.com/WslF/CF-rating-prediction/blob/master/Files/icon1024.png?raw=true) A huge amount of your nerve cells die every time when you wait for a rating update on Codeforces. Stop this! From now you could use this service, it calculates approximate rating changes for every contestant. The most interested thing for you is extension. It partly modifies the contest standings page and shows approximate rating changes for every contestant. It is available for three browsers: [![ ](http://codeforces.me/predownloaded/da/65/da6525a67ce20846473316c363d3aeec418a90a2.png)](https://chrome.google.com/webstore/detail/rating-predictor-for-code/ocfloejijfhhkkdmheodbaanephbnfhn) [![ ](http://codeforces.me/pr...

Full text and comments »

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

113.
By awoo, history, 17 months ago, translation, In English
Educational Codeforces Round 180 [Rated for Div. 2] <img alt="Neapolis University Pafos" src="/predownloaded/9a/33/9a332fadbb47050ba9405057df022a6e37eaf5c0.png" style="float:right;height: 200px; margin: 10px; max-width:40%;"/> Hello Codeforces! The series of Educational Rounds continues thanks to the support of the [Neapolis University Pafos](https://www.nup.ac.cy/). They offer a BSc in Computer Science and AI with [JetBrains Scholarships] (https://lp.jetbrains.com/academy/csai-program/). Gain cutting-edge skills in AI and machine learning, preparing you for high-demand tech careers. Curious? Check out the [CSAI curriculum] (https://drive.google.com/file/d/19I776O8NG07ie2Q14wwBspuh3De4kbHc/view). Limited scholarships available &mdash; don't miss your chance to study in Europe for free! On [contest_time:2112] [contest:2112] will start. This round will be **rated for the participants with rating lower than 2100**. It will be held on extended ICPC rules. The penalty for each incorrect submission until the submission with a ful...
. Любопытно? Вот тут можно узнать больше об [учебной программе](https://drive.google.com/file/d, ://drive.google.com/file/d/19I776O8NG07ie2Q14wwBspuh3De4kbHc/view). Limited scholarships available &mdash

Full text and comments »

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

114.
By errorgorn, 5 years ago, In English
Interesting Information-Theoretical Problem Recently, there was a local contest which I set a problem for (task 4 in [this pdf](https://drive.google.com/file/d/1-HvrkdEdsZFFiLmtKNUqEidtXAhyPfZO/view?usp=sharing)). The abridged problem statement is that you choose an array $A$ of length $N$ where the elements are $<2^X$. The grader will pick $[L,R]$ and return $A_L \oplus A_{L+1} \oplus \ldots \oplus A_R$, where $\oplus$ is the bitwise xor operation. You need to find **any** integer $z$ such that $L \leq z \leq R$. I set this in contest with the constraints of $N=2^{19}$ and $X=192 \approx \frac{(\log N)^2}{2}$ where you also had to answer queries quickly. <spoiler summary="Solution"> The main idea of my solution is to keep splitting the query range in half. Suppose we know that $l \leq L \leq R \leq r$. Let $m=\frac{l+r}{2}$. Then there are $3$ cases: 1. answer $m$ 2. recurse to $[l,m)$ 3. recurse to $(m,r]$ Let us put a bit on position $m$. If that bit is activated, then it is case 1. Otherwise, we need ...
://drive.google.com/file/d/1-HvrkdEdsZFFiLmtKNUqEidtXAhyPfZO/view?usp=sharing)).

Full text and comments »

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

115.
By Xellos, history, 7 months ago, In English
C++ quirks: variable shadowing C++ is a very permissive language. It'll let you write basically anything on the assumption that you know what you're doing... or let you shoot yourself in the foot if you don't. For example: ```cpp class C { int a; public: C(int a) : a{a} {} }; ``` It's a fairly common pattern in simple class design that's perfectly fine until it's not. The class member and constructor argument (c.arg.) have the same name. This is known as shadowing and compilers will warn you about it, though you need to use a flag `-Wshadow` that isn't included among `-Wall` or `-Wextra`. Another example of shadowing is ```cpp for(int i = 0; i < t; i++) for(int i = 0; i < n; i++) ``` which is fine if the first `i` isn't used for anything except making a loop (such as over test cases) but otherwise it's a solid source of bugs, especially if you "fix" it into `for(int j = 0; j < n; i++)`. ### How does shadowing work? First off, when can one variable shadow another? The standa...
function `FileInputStreamReader::getc` (line 1777) takes a `FILE*` as an argument, which shadows its

Full text and comments »

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

116.
By adamant, history, 3 years ago, In English
Osijek Competitive Programming Camp 2023 fall — wrap Hi everyone! <center><a href="https://ocpc.mathos.unios.hr"><img src="https://ocpc.mathos.unios.hr/images/ocpc.svg" height="100px"></a></center> <center> <b>Supported by</b><br> <a href="https://www.janestreet.com/join-jane-street/open-roles/?type=students-and-new-grads&location=london"> <img src="/predownloaded/ee/f2/eef26616a3661c658d1545f18ed21fabb14d5871.svg" height="50px" style="margin: 5px 5px 5px 5px;"></a> <a href="https://icpc.foundation/"><img src="https://ocpc.mathos.unios.hr/images/ICPC.svg" height="70px" style="margin: 5px 5px 5px 5px;"></a> <a href="https://pinely.com/"> <img src="/predownloaded/0a/0f/0a0f3f67435d1f6e467bc7203d4a2090ba8f92cc.svg" height="50px" style="margin: 5px 5px 5px 5px;"></a><br> <a href="https://artofproblemsolving.com/"><img src="https://ocpc.mathos.unios.hr/images/aops.svg" height="40px" style="margin: 5px 5px 5px 5px;"></a> <a href="https://www.wolfram.com/"> <img src="https://ocpc.mathos.unios.hr/images/wolfram.png" height="40...
You can find the remaining photos

Full text and comments »

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

117.
By Egor, 15 years ago, translation, In English
CHelper manual <div><div style="margin-top: 0.0px;margin-right: 0.0px;margin-bottom: 0.0px;margin-left: 0.0px;padding-top: 0.0px;padding-right: 0.0px;padding-bottom: 0.0px;padding-left: 0.0px;font-family: verdana , arial , sans-serif;font-size: 12.0px;line-height: 20.0px;background-color: rgb(255,255,255);"><b>1. Installation</b></div><div><span style="font-family: verdana , arial , sans-serif;font-size: 12.0px;line-height: 20.0px;background-color: rgb(255,255,255);">You need to download </span><a href="http://code.google.com/p/idea-chelper/downloads/detail?name=chelper2.4.jar" style="font-family: verdana , arial , sans-serif;font-size: 12.0px;line-height: 20.0px;background-color: rgb(255,255,255);color: rgb(0,0,204);">plug-in</a><span style="font-family: verdana , arial , sans-serif;font-size: 12.0px;line-height: 20.0px;background-color: rgb(255,255,255);"> and </span><a href="http://code.google.com/p/idea-chelper/downloads/detail?name=chelper.properties" style="font-family: verdana , arial , sans-s...
type/Output type - input/output type. Standard --- stdin/stdout, Task_id --- file input

Full text and comments »

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

118.
By Gassa, history, 3 years ago, In English
RunTwice Contest in Universal Cup! Hi! The next stage of Universal Cup, Run Twice Contest, will happen on December 30-31, 2023. As the name suggests, all problems in the contest are in run-twice format. I am the author of the contest. Originally, the contest was held in Petrozavodsk Summer Camp 2022. The plan was to hold it later as an Opencup stage, in order to further introduce the format to a wider audience. Alas, Opencup got suspended around that time. Fortunately, sharing it beyond the camp can finally happen now. Thanks go to [user:Qingyu,2023-12-29] and the other Universal Cup admins! [cut] &nbsp; ### About Universal Cup The Universal Cup is a contest series for competitive programming teams. Among other qualities, it is a spiritual successor to Opencup. The stages are various camp stages, ICPC regionals, local contests and the like. This scheme gives participants fresh, diverse and quality contests to train and compete, at the same time allowing local contest authors to share their wor...

Full text and comments »

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

119.
By AmShZ, 11 days ago, In English
Repovive SWE Round 1: Vive Market ($750 in Prizes!) Hello everyone! Have you ever wondered what a competitive programming contest for **real-world software engineering** would look like? Instead of writing code from scratch, imagine being given an existing project full of bugs, with the clock ticking and a live leaderboard showing everyone's progress. That's what we're building at Repovive! We're excited to announce **Repovive SWE Round 1: Vive Market**, a live debugging contest where your goal is to find and fix bugs in Python projects. You'll also have an **AI agent** working alongside you. The interesting part is that the agent knows what the software is supposed to do, but hasn't seen the actual implementation. More on that below! * Start Time: [Saturday, 14 November 2026, 14:35 (UTC)](https://www.timeanddate.com/worldclock/fixedtime.html?iso=20261114T1435&p1=1440&msg=Repovive+SWE+Round+1) * Duration: $3$ hours * Problems: $4$ Python projects * Registration: https://repovive.com/contests/swe1 * Rules: https://r...

Full text and comments »

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

120.
By hehezhou, history, 4 years ago, In English
California Informatics Competition (CALICO) Spring '23 Hello Codeforces! We are excited to invite you to compete in the California Informatics Competition (CALICO) Spring '23! The contest will take place on [Saturday, April 8, 2023 from 4:00 p.m. to 6:30 p.m. Pacific Time](https://timeanddate.com/s/430d). **Registrations are now open** and will be until Thursday, April 6, 2023 at 11:59 p.m. Pacific Time, so [register here while you can](https://calico.cs.berkeley.edu/register)! The contest will take place virtually on our [custom judge platform](https://calicojudge.com/). The California Informatics Competition (CALICO) is a semiannual team programming contest organized by students at the University of California, Berkeley. We create original problems to encourage students to grow their problem-solving skills and learn algorithms in fun and exciting ways. Check out our [website](https://calico.cs.berkeley.edu/) to learn more about the contest and join our [discord server](https://discord.gg/RTdxtzXQZ5) to get announcements, make teams...

Full text and comments »

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

121.
By MikeMirzayanov, 10 years ago, translation, In English
Interactive Problems: Guide for Participants Sometimes you can meet _interactive problems_ on programming contests (including Codeforces). In problems of this type, the input data given to your program may be not predetermined but is built specifically for your solution. Jury writes a special program &mdash; _interactor_, such that its output is tranferred to the input of your solution, and the output of your program is sent to interactor’s input. In the other words, your solution and the interactor exchange the data and my decide what to print based on the "history of communication". When you write the solution for the interactive problem it is important to keep in mind that if you output some data it is possible that this data is first placed to some internal buffer and may be not directly transferred to the interactor. In order to avoid such situation you have to use special `flush` operation _each time_ you output some data. [cut] There are these `flush` operations in standard libraries of almost all languages. Fo...
given in the input file after you flush output. In case your program guessed the number $x$, print

Full text and comments »

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

122.
By accidentallygivenfuck, history, 11 years ago, In English
Ineffable — simple command-line grader for personal use <center> <img src="http://codeforces.me/predownloaded/f4/3d/f43d1d912eca2f8c25b30418f592eb7717eaf88f.png"> </center> Hello Codeforces, I want to share with you a simple tool that I've been using for a while now that I named "Ineffable". # What is ineffable? Simple command-line grader for local grading of solutions for problems of competitive programming contests. It is written in Python and it uses `timeout` Perl library to limit resources (time and memory limits) of program being tested. It works on Ubuntu, and I guess it should work on any Linux/Unix system as long as Python and Perl are installed. # Screenshots ![ ](http://codeforces.me/predownloaded/a9/36/a936a7ff09cf8bd714f2321847676328a99f674d.png) ![ ](http://codeforces.me/predownloaded/23/ca/23ca3a3112a7b22ea5a809f6a4a1e5f0502475dd.png) (Original quote is "Success consists of going from failure to failure without loss of enthusiasm") # Installation Run the following commands on your terminal: ...

Full text and comments »

123.
By xalanq, 8 years ago, In English
Codeforces command-line interface tool Codeforces Tool is a command-line interface tool for Codeforces. It's written in golang (without any browser driver). And it's fast, small(only about 7 MB), cross-platform(Windows, macOS, Linux) and powerful. You can find the source and binary files in my git repo <https://github.com/xalanq/cf-tool> You can download the tool from release page <https://github.com/xalanq/cf-tool/releases> Features: * Support Contests, Gym, Groups and acmsguru. * Support all programming languages in Codeforces. * Submit codes. * Watch submissions' status dynamically. * Fetch problems' samples. * Compile and test locally. * Clone all codes of someone. * Generate codes from the specified template (including timestamp, author, etc.) * List problems' stats of one contest. * Use default web browser to open problems' pages, standings' page, etc. * Setup a network proxy. Setup a mirror host. * Colorful CLI. ![ ](/predownloaded/94/c1/94c19d289f5d360af24bbe683f1b7b48ef04f330.png) ![...

Full text and comments »

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

124.
By gepardo, history, 8 years ago, In English
ParmPars: a library to pass parameters to generators Hello, Codeforces! If you tried to prepare some competitive programming problems, you might parse parameters like this: ```cpp #include "testlib.h" #include <cstdlib> using namespace std; int main(int argc, char **argv) { registerGen(argc, argv, 1); int n = atoi(argv[1]); int m = atoi(argv[2]); int k = atoi(argv[3]); ... ``` Of course, such way has many disadvantages: * You need to pass the exact amount of parameters, you cannot define default values for them. * If you have many parameters, it's easy to forget the order. * If you pass too few of the them, it will be undefined behavior. So I developed a library called ParmPars to pass parameters to generators in a more convenient way. You can find it on [GitHub](https://github.com/alex65536/parmpars). I hope it will help you to generate tests better. [cut] <br> Using ParmPars, you could rewrite the code above in the following way: ```cpp #include "testlib.h" #include "parmpars.hpp" ...

Full text and comments »

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

125.
By PrinceOfPersia, 12 years ago, In English
Valentine Algorithm cUp 2015 Are you in love with algorithms? If you are don't miss this round and be algorithm's valentine ;) ![ ](http://assets.codeforces.com/images/girl-and-laptop.jpg) On the night before valentine's day ([exact time](http://www.timeanddate.com/worldclock/fixedtime.html?day=13&month=2&year=2015&hour=18&min=30&sec=0&p1=166)), Valentine Algorithm cUp 2015 is going to take place. There will be 6 problems and 3 hours to solve them. All of them are written by me([user:PrinceOfPersia,2015-02-05]). This competition is like surprise languages but too different. 3 days before the contest, I will publish tutorial of 5 new algorithm languages(not programming languages) with their compiler codes. Each language is going to be really simple to learn and have at most 6 or 7 commands (they're not like programming languages). Your program should print the code written in the language the problem says and checker will run it (pay attention that inputs are encoded, don't try to read form input, j...
For running your code that is saved in a file like `x.txt`, use exactly `./lang.out x.txt` in, For running your code that is saved in a file like `x.txt`, use exactly `lang x.txt` in cmd and if

Full text and comments »

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

126.
By jonathanirvings, history, 8 years ago, In English
2018 ICPC Asia Jakarta Regional Contest problemset on (now Codeforces) Gym **UPD: 2018 ICPC Asia Jakarta Regional Contest problemset is now available on CODEFORCES Gym** **UPD2:** The original checker for [problem C](https://codeforces.me/gym/102001/problem/C) turns out to have non-deterministic behaviour due to insufficient array size. Fortunately, the false checking caused by the bug occurs rarely enough that the live contest (including the mirror in Codeforces) was not impacted (at least we did not receive complaints on the live contest). The checker was fixed on 23 June 2020 and all submissions have been rejudged. See [this comment](https://codeforces.me/blog/entry/63220?#comment-598987) for more detail. We would like to invite you to the [mirror post-contest of 2018 ICPC Asia Jakarta Regional Contest](https://codeforces.me/gym/102001). The contest will start on [Sunday, 25 November 2018, 10.00AM Western Indonesian Time (UTC+7)](https://www.timeanddate.com/worldclock/fixedtime.html?msg=2018+ICPC+Asia+Jakarta+Regional+mirror+post-contest&iso=20181...

Full text and comments »

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

127.
By halyavin, 10 years ago, In English
The case of slow printf and scanf I know what is the problem ================== _Where we are going we need all the courage we can get_ When I first read the comment that our shiny new gcc 6.2 C++14 compiler has slow printf and scanf I immediately knew what I would do the next weekend. The new MinGW switched to custom implementation and I didn't need anything else to tell what the problem is. _Of course_, their format string parsing is too slow, they copy data around countless times, no file buffering is used and they have enough levels of indirection to make finding the real code feeling like a treasure hunt. What else could be the problem after all? Keeping this thoughts in mind I patiently waited for a weekend. When I finally opened MinGW source and searched for printf function, I was pleasantly surprised. The real implementation was only a couple hops away and soon enough I was looking at the heart of printf code. MinGW did try to conceal it a bit though by naming it mingw_pformat.c. But a ~100Kb source fi...
function which in turn calls fputc function to write into the file. Aha, there it is! Everybody knows that

Full text and comments »

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

128.
By BucketPotato, 2 years ago, In English
California Informatics Competition (CALICO) Fall '24 ![ ](/predownloaded/f1/9a/f19ab0ba793a4707722850061317caa25b635ba4.png) Hello Codeforces! We're excited to invite you to CALICO Fall '24! The contest will begin [Saturday, November 16, 2024 at 4:00 p.m. PT](https://timeanddate.com/s/44ff) and is 3 hours long. **Registrations are now open** and will be until November 13, 2024 at 11:59 p.m. PT, so please [register here](https://calico.cs.berkeley.edu/register/) as soon as you can! The contest will take place on our [custom judge platform](https://calicojudge.com/) and contestants can compete **online or in-person at UC Berkeley**! #### About The California Informatics Competition (CALICO) is a semiannual team programming contest organized by students at the University of California, Berkeley. We create original problems to help students grow their problem-solving skills and learn algorithms in fun and exciting ways. Check out our [website](https://calico.cs.berkeley.edu/) to learn more about the contest and join our [discord ...

Full text and comments »

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

129.
By EvenImage, history, 10 years ago, In English
My sad story When I was submitting the problem D in round #371, I clicked the "Choose File" button and selected my code. Before the submission, I read my code another time, found a bug in my code and fixed it. And then I clicked the "submit" button. But it turned out that my solution got wrong answer on pretest 4. I stress-tested my solution, and found it passed the big random data. I was really shocked. umm... Maybe my solution failed on some small testcases. So I tried many ways to generate testcases. But my solution was right on all the testcases I generated. After struggling for about 40mins, I gave up and submitted it again. It passed all the pretests. I compared two codes, and just found I submitted the old version (before fixing the bug) at first time. After asking my roommate, he said when you clicked the "Choose File" button, it would upload the file instead of recording the path. In the rest time of the contest, I tried to solve problem B and E but failed. <S>I think ...
After asking my roommate, he said when you clicked the "Choose File" button, it would upload the

Full text and comments »

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

130.
By AlexLuchianov, 5 years ago, In English
How NOT to use macros *"I used to be a competitive programmer like you, but then I took a macro to the knee."* First I want to say that I recognize the fact that not all macros are bad, there are even some ingenious macros that are really useful such as the `all(x)` macro from the post [C++ tips and tricks](https://codeforces.me/blog/entry/74684) by [user:Golovanov399,2022-03-16] . Another useful macro is `NDEBUG`. This macro is used to disable all assertion checks inside the code. It can be used like this: ~~~~~ #define NDEBUG #include <cassert> ~~~~~ Note that `NDEBUG` has to be defined before including `cassert` to have an effect. Other useful macros are the debug macros, a little more information about them can be found in the following blog, [Compilation and debugging tutorial](https://codeforces.me/blog/entry/79024) by [user:ramchandra,2022-03-16]. However, for every one such great macro there exist another countless macros that are, let's just say, not that great. Here are some reaso...
involved. That is why it is recommended to undefine the macros at the end of thefile in which they are

Full text and comments »

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

131.
By SuperJ6, 4 years ago, In English
How to Effectively Practice CP + Problem Solving Guide This is a slight tweak of [a practice guide](https://www.reddit.com/r/usaco/comments/pk3tjp/the_ultimate_usaco_practice_method/) I wrote a while ago on USACO reddit since I thought it could be helpful to people here. Some USACO specific sections or extra clutter I left out here that aren't needed for a general audience. This should cover all general cp advice I have so I never have to retype. #Introduction This is a post on how I believe is the best method to practice modern day competitive programming based on my experiences. I assume you already have some knowledge and know simple things like binary search and dfs/bfs, but **read the footnote if you are complete beginner** (never code, solved <50 problems, div2 A/B too difficult, grey or stuck low pupil). First, a quick tl;dr of the practice strategy before a bunch of specifics and explanation: >**In short, mostly you only need to use codeforces (no matter what contest you're training for), find a rating range where you c...
://drive.google.com/file/d/1sQtirXxkEfWYuGSKDZ-d7VGYkR_idebY/view). Overall it will be better for you to just do be

Full text and comments »

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

132.
By Anshul_Johri, 3 years ago, In English
C++ Debug Template! # C++ Debug Template &#x1F6E0; **Simplify variable tracking across functions and loops!** **Note:** For latest updates and a colored stderr version of this template, visit my [Github](https://github.com/Anshul-Johri-1/Debug-Template). <spoiler summary="Longer Template (std >= C++11)"> ```c++ #ifndef DEBUG_TEMPLATE_CPP #define DEBUG_TEMPLATE_CPP #include <bits/stdc++.h> // #define cerr cout namespace __DEBUG_UTIL__ { using namespace std; /* Primitive Datatypes Print */ void print(const char *x) { cerr << x; } void print(bool x) { cerr << (x ? "T" : "F"); } void print(char x) { cerr << '\'' << x << '\''; } void print(signed short int x) { cerr << x; } void print(unsigned short int x) { cerr << x; } void print(signed int x) { cerr << x; } void print(unsigned int x) { cerr << x; } void print(signed long int x) { cerr << x; } void print(unsigned long int x) { cerr << x; } void print(signed long long int x) { cerr...
workspace, create a file _template.cpp_ 3. Copy content of my _template_cpp11_std.cpp_ into your

Full text and comments »

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

133.
By MikeMirzayanov, 8 years ago, translation, In English
Testlib and Polygon Updates [July, 2018] Hello, Codeforces. This is a short blog to introduce you recent updates in [Testlib](https://github.com/MikeMirzayanov/testlib) and [Polygon](http://polygon.codeforces.com). # Testlib ### Generate a Permutation Now, you can easily generate a permutation with codes like this: Code | Result -|- `vector<int> p = rnd.perm(n);`| Generates 0-indexed permutation of size $n$ `vector<int> p = rnd.perm(n, 1);`| Generates 1-indexed permutation of size $n$ ### Function `println` Now, you can easily print space-separated lines in a generator. A `println` uses `cout`, thus prefer faster method if you print huge data. Some examples: Code | Result -|- `println(5);` | Print 5 and line break `println(1, 2, 3);` | Print `1 2 3` (three space separated integers) and line break `println("one", "more", 5.5);` | Print `one more 5.5` (three space separated items) and line break `vector<int> a; ...; println(a);` | Print vector $a$ (separate elements with spaces) and line break...
* Allow to upload files (for example, images) as a contest property/file to use them in the

Full text and comments »

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

134.
By dmkozyrev, history, 3 years ago, In English
[Tutorial] Quick start in solving problems on GPU + CPU Hello, codeforces! Do you have modern GPU and CPU and want to calculate something with them, but you don't know how to do it? Dont be upset, because you can read this blog and run your first GPU program on your AMD/Intel/NVIDIA GPU. I will describe an installation process and then we will dive into the C++ code. As an example, we will calculate a lot of mazes for [Bug Game](https://codeforces.me/blog/entry/115144) in parallel. For doing this in simple way, we will use library [Boost.Compute](https://www.boost.org/doc/libs/1_80_0/libs/compute/doc/html/index.html), which is a C++ STL-style wrapper over OpenCL library. [cut] ... Installation for MacOS (Apple M1 Pro) ================== As [user:Gosunov,2023-06-10] said, `OpenCL` and `g++` are pre-installed on `MacOS`. Everything that you have to do is install `Boost` with command `brew install boost`. After this you will be able to compile your program with command `g++ -std=c++17 -O3 -I/opt/homebrew/Cellar/boost/1.81.0_1/...
Reading of the maze from the input file:, You need to fix this error by yourself or download a fixed file `svm_ptr.hpp` and replace it, ~~~~~ nFields: 10000 input file: '1.488.650.txt', ~~~~~ nFields: 128 input file: '1.488.650.txt'

Full text and comments »

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

135.
By nikgaevoy, history, 6 years ago, In English
Yet Another Rating System for CodeForces Finally, I finished the implementation of an improved version of TrueSkill rating system that [user:EbTech,2020-07-04] named "TrueSkill from St.Petersburg". TL;DR ===== Results are [here](https://raw.githubusercontent.com/nikgaevoy/SPbTrueSkill/master/data/CFratings_actual.txt). Full repository is [here](https://github.com/nikgaevoy/SPbTrueSkill). Important notes on the results ------------------------------ Note that those results were obtained by running on the [user:EbTech,2020-07-04]'s testset (rounds only before Codeforces Round #645 and team contests excluded) and thus do not represent the current standings on Codeforces. Also, the file contains only users with at least 10 contests and at least one contest in 2020 (otherwise, the file would be very large). However, you may obtain full rating by running the algorithm on your computer, it should take about a minute. Also note that the results may seem not very impressive since I chose the first parameters out of the ...
standings on Codeforces. Also, the file contains only users with at least 10 contests and at least

Full text and comments »

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

136.
By -is-this-fft-, history, 5 years ago, In English
CodeChef virtual contests on Vjudge A week ago, I made [this](https://codeforces.me/blog/entry/90896) blog post. Earlier, I already wrote a small update to the blog, but I wanted to make a separate post to <s>get more contribution</s> properly announce what I did as well as to share my code. Thanks to vjudge's suggestion, there is now a way to participate in CodeChef Cook-Off contests virtually on vjudge. #### How to participate - Go to [the list](https://vjudge.net/contest#category=replay&running=0&title=CodeChef&owner=). - Open a contest by clicking on its name. - Click the "clone" button to create your own private copy of the contest. - Set the "begin time" to the time you'd like to start the contest, somewhere in the future. Keep reading if you want to know how it works. [cut] $~$ #### How it works The contests are so-called _replays_ -- they are generated from the final ranklists (complete with "time of AC" and penalty for every problem and contestant) of the contests. The contest data is downl...
vjudge format, an auxiliary info.txt file is created along with the Excel ranklist itself; thisfile

Full text and comments »

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

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

Full text and comments »

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

138.
By k1r1t0, history, 4 years ago, In English
TheForces Round #4 Editorial [Mashup] Thanks you for participating in [**TheForces Round #4**](https://codeforces.me/contestInvitation/c3b322069561ec499aff012cc7c92ac106151bb6)! Here is the editorial: <spoiler summary="Problem A"> Answer is $floor(sqrt(r)) &mdash; floor(sqrt(l &mdash; 1))$. Alternatively you can use binary search to calculate square root. <spoiler summary="Solution"> ~~~~~ #include <bits/stdc++.h> using namespace std; #define int long long int get(int r) { int tt = 0; for (int uu = r; uu >= 1; uu /= 2) while ((tt + uu) * (tt + uu) <= r) tt += uu; return tt; } int32_t main() { iostream::sync_with_stdio(0); cin.tie(0); int q; cin >> q; while (q--) { int l, r; cin >> l >> r; cout << get(r) - get(l - 1) << '\n'; } } ~~~~~ </spoiler> </spoiler> <spoiler summary="Problem B"> You always can make all bits less or equal to the most significant bit set to $1$. Also you cant make most significant bit greater. Just go through numbers and find the minimal...

Full text and comments »

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

139.
By balllightning37, history, 19 months ago, In English
Every CSES problem can be solved in 44 characters with Python **Do you want to be at the top of a CSES leaderboard? Are you tired of your friends complaining that your code is impossible to read? Do you just want to solve the problem in one line? Here's how.** Step 1: Actually solve the problem. However, you must write a correct solution in Python. It doesn't matter how long your solution is, but make sure everything is an ASCII character. Step 2: Save your solution as "in.py" in the same folder as the following Python script: ~~~~~ f=open('in.py','r') output='exec("".join(chr(len(i)) for i in "' for l in f.readlines(): for ch in l: output+=(" "*ord(ch)) output+=chr(9) output=output[:-1]+'".split(" ")))' f.close() with open('out.py','w') as g: g.write(output) ~~~~~ Step 3: Run the program to produce "out.py". This will run reasonably fast as long as "in.py" isn't as fat as your mom. Step 4: Submit "out.py". Guaranteed to work if your original solution is correct and the output file is not too lar...
file is not too large.

Full text and comments »

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

140.
By MikeMirzayanov, history, 10 years ago, translation, In English
Surprise Language Round #8 The language of the round is **Kotlin**. Kotlin is a statically-typed programming language that runs on the Java Virtual Machine and also can be compiled to JavaScript source code. Its primary development is from a team of JetBrains programmers based in Saint Petersburg, Russia (the name comes from the Kotlin Island, near St. Petersburg). Here is an example of the simplest program on Kotlin to print sum of two numbers: ~~~~~ fun main(args: Array<String>) { val (x, y) = readLine()!!.split(' ').map(String::toInt) println(x + y) } ~~~~~ Here are some links to help you with Kotlin: * [https://en.wikipedia.org/wiki/Kotlin_(programming_language)](https://goo.gl/gYZ5xD) * https://kotlinlang.org/docs/reference/ * http://try.kotlinlang.org/ &mdash; be careful: reading from the console in the web-IDE is not allowed * and Google! You can download standalone compiler (version 1.0.1) by the link http://s.codeforces.com/files/kotlin-compiler-1.0.1.zip Also you need JR...

Full text and comments »

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

141.
By lucyanna2018, history, 3 years ago, In English
A Step-by-step Guide to Configure Topcoder Competitive Environment <h3><b>Step 1: Get a Topcoder account if you don't already have one.</b></h3> Address: http://www.topcoder.com/talent/ <img alt=" " src="/predownloaded/3d/4b/3d4b2c0adc4d14af81a96fd61ca41e5836a5e1fb.png" style="max-width: 100.0%;max-height: 100.0%;" /></p> Click on the "JOIN TOPCODER" button, and fill in the form to register. <img alt=" " src="/predownloaded/00/7f/007f49a53c95b30b66ba6bdd76453256665b35cb.png " style="max-width: 100.0%;max-height: 100.0%;" /></p> <h3><b>Step 2: Download and install Java Runtime Environment.</b></h3> Address: https://www.java.com/en/download/manual.jsp <h3><b>Step 3: Download the topcoder applet.</b></h3> Address: https://www.topcoder.com/contest/arena/ContestAppletProd.jnlp I strongly recommend you to put the above jnlp into the same folder of executable file "javaws" (Java Web Start Luncher). <img alt=" " src="/predownloaded/65/c4/65c4d4e5471e3ca6f9ca812f946f885cf2a35815.png" style="max-width: 100.0%;max-height: 100.0%;" ...
In the first line, enter the directory where you want to put the problem statementfile and the

Full text and comments »

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

142.
By MikeMirzayanov, 12 years ago, translation, In English
10 Reasons to Prepare Problems in Polygon <img src="http://assets.codeforces.com/images/poly21.jpg" style="float:right;margin:0 0.5em 1em 1em;"/> Hello Codeforces. Just a reminder about something most of you know. Polygon is a service to prepares programming problems and contests. It is usually used to prepare problems for olympiads/programming contests but it is also often used to prepare educational content. It is located at https://polygon.codeforces.com/ and is open to everybody. I have recently found out that it's been more than five years since the creation of Polygon. It's high time to summarize the experience we've accumulated. I first publicly spoke about Polygon in a narrow circle of Russian teams' coaches on ACM-ICPC World Finals in 2009. I cannot say that everybody was enthusiastic about the innovation. Some people were openly skeptical about such system's viability and relevance. After 5 years on the ACM-ICPC finals in Ekaterinburg Oleg Hhristenko ([user:snarknews,2014-11-03]) said that in his o...

Full text and comments »

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

143.
By bicsi, history, 6 years ago, In English
Automatic pre-compiler for submitting tasks on Codeforces Hello! After seeing the recent hype towards debugging utils and code snippets usage and what not, and due to the fact that I had 30 minutes of free time to spend this afternoon, I decided to write a small Python script that pre-compiles multiple files into one big file for Codeforces submission. The tool is here: https://pastebin.com/c4dS4Pik (Python 3 required) Basically the tool does these steps: - remove the ``#include <bla>`` lines from the code - run the GCC preprocessor on the code - add the ``#include <bla>`` lines back - run some cleanup routine (optional) In order to use this script, copy it somewhere (preferably in your PATH directory), and run it using: ``/path/to/scr.py file.cpp [ARGS]`` The ``ARGS`` are similar to the ones you would give to your ``g++`` command. For example, let's say we have three files: <spoiler summary="FILE: debug.hpp"> ``` #pragma once #ifdef DEBUG int recur_depth = 0; #define dbg(x) {++recur_depth; auto x_=x; --r...
``` #pragma once

Full text and comments »

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

144.
By scott_wu, 11 years ago, In English
8VC Venture Cup Announcement <img src="http://assets.codeforces.com/images/8vc/8vc-venturecup-logo.png" style="float:right;margin:0 1em 1em 1em"/> Hey Codeforces! I’ve worked with Addepar and the broader 8 | family of companies in Silicon Valley throughout 2014 and 2015, and it’s been an excellent experience. I would encourage everyone in the community to learn more about the great work that these companies are doing and I’m happy to announce that 8 | Partners will be hosting the 8 | VC VentureCup on Codeforces! It’ll be a fun contest and I’ve worked on the problems along with a few competitive programmers in our network. The contest will begin on February 13 and consist of two rounds. ##### ABOUT 8 | PARTNERS <a href="http://eight.vc/">8 | Partners</a>, which consists of Joe Lonsdale (co-founder of Palantir) and his core team from Formation | 8, is a Silicon Valley venture capital firm that invests in industry-transforming technology companies. The team's investment portfolio includes companies suc...
<https://www.illumio.com/>

Full text and comments »

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

145.
By antontrygubO_o, 5 years ago, translation, In English
XXII OpenCup GP of IMO ![ ](https://upload.wikimedia.org/wikipedia/commons/thumb/1/17/IMO_logo.svg/1200px-IMO_logo.svg.png) This summer, me and [user:kefaa2,2021-09-16] held a contest in Petrozavodsk Programming Camp. $1$ problem was provided by [user:gepardo,2021-09-16], and we are very thankful for that, and other problems were created by us, [user:kefaa2,2021-09-16] and [user:antontrygubO_o,2021-09-16]. This contest will be held as an OpenCup contest on [September 19, 11:00 UTC+3](https://www.timeanddate.com/worldclock/fixedtime.html?msg=GP+of+IMO&iso=20210919T11&p1=367&ah=5). I and [user:kefaa2,2021-09-16] are friends for long time, since our years of participation at IMO, and it's [user:kefaa2,2021-09-16] who introduced me to competitive programming. Therefore, we decided to call this contest GP of IMO. [Link](http://official.contest.yandex.ru/opencupXXII/contest/28922/enter) (OpenCup login needed to participate) I will publish the editorial here soon after the contest ends. Good luck a...
**UPD2:** [Editorial](https://drive.google.com/file /d/1-J06etjljwZ7i-7rIRn8ex6mr5bu6A_p/view?usp

Full text and comments »

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

146.
By E869120, 7 years ago, In English
My winning theory in IOI 2018 & 2019 — Why I won 2 golds in IOI Dear Codeforces community.<br /> According to [IOI 2019 Results](http://stats.ioinformatics.org/results/2019), I got the 25th place and got successful gold medals twice in a row.<br /> Although it was pretty close to the gold-medal border (only 6.14pts / 600 difference) and it was lower performance than IOI 2018, which I participated when I was orange in Codeforces, I had many chances to get more points in this IOI, even for top 10. Since there are not so many people who have got two gold medals in IOI (and there were many requests like "I want [user:E869120,2019-08-14] to talk about how to get gold in IOI" like [this comment](https://codeforces.me/blog/entry/66909?#comment-510127) and [this comment](https://codeforces.me/blog/entry/66909?#comment-513129)). I want to write something about IOI, which may be useful for people who will participate in IOI next year and also some years later.<br /> ![ ](https://i.ibb.co/TLmqRRX/E869120-IOI-01.png)<br /> <br /> ### A. First of all At...
rectangle, the sample input in official zip file was wrong. (It was fixed after ~1 hour after the

Full text and comments »

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

147.
By DishonoredRighteous, history, 4 years ago, In English
Codeforces Round #866 (Div.1, Div.2, based on Lipetsk Team Olympiad) Editorial [problem:1820A] Author: [user:FairyWinx,2023-04-16] Preparation: [user:FairyWinx,2023-04-16] <spoiler summary="Editorial"> [tutorial:1820A] </spoiler> <spoiler summary="Solution"> ~~~~~ #include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { string s; cin >> s; if (s == "^") { cout << 1 << '\n'; continue; } int ans = 0; if (s[0] == '_') ++ans; if (s.back() == '_') ++ans; for (int i = 0; i < (int) s.size() - 1; ++i) { if (s[i] == '_' && s[i + 1] == '_') ++ans; } cout << ans << '\n'; } } ~~~~~ </spoiler> [problem:1820B] Author: [user:golikovnik,2023-04-16] Preparation: [user:teraqqq,2023-04-16] <spoiler summary="Editorial"> [tutorial:1820B] </spoiler> <spoiler summary="Solution"> ~~~~~ #include <bits/stdc++.h> using nam...
NAME "File"

Full text and comments »

148.
By awoo, history, 2 years ago, translation, In English
Educational Codeforces Round 170 [Rated for Div. 2] <img alt="Neapolis University Pafos" src="/predownloaded/9a/33/9a332fadbb47050ba9405057df022a6e37eaf5c0.png" style="float:right;height: 200px; margin: 10px; max-width:40%;"/> Hello Codeforces! The series of Educational Rounds continues thanks to the support of the [Neapolis University Pafos](https://www.nup.ac.cy/). They offer a BSc in Computer Science and AI with [JetBrains Scholarships] (https://lp.jetbrains.com/academy/csai-program/). Gain cutting-edge skills in AI and machine learning, preparing you for high-demand tech careers. Curious? Check out the [CSAI curriculum] (https://drive.google.com/file/d/19I776O8NG07ie2Q14wwBspuh3De4kbHc/view) now. Limited scholarships available &mdash; don't miss your chance to study in Europe for free! Are you looking to sharpen your skills and increase your chances of getting a scholarship? Join the free clubs for high school students from JetBrains: - [Math club](https://lp.jetbrains.com/youth-math-club/) - [AI club](https://lp.jetbra...
. Любопытно? Ознакомьтесь с [учебной программой](https://drive.google.com/file/d, ://drive.google.com/file/d/19I776O8NG07ie2Q14wwBspuh3De4kbHc/view) now. Limited scholarships available

Full text and comments »

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

149.
By kevinsogo, history, 6 years ago, In English
Invitation to join the NOI.PH 2020 Final Round Mirrors at the Codeforces Gym! Links to the mirrors! [day 1](https://codeforces.me/gym/102687), [day 2](https://codeforces.me/gym/102688) (Please register at [the gym](https://codeforces.me/gyms)) Hello Codeforces! I'd like to invite you to the mirrors of the 2020 final rounds of the National Olympiad in Informatics – Philippines. The mirrors will be held in the Codeforces gym. The NOI.PH is the Philippines' qualifier for the IOI. **Contest format:** - There are 2 contest days. - There are 5 problems over 5 hours, per day. - The problems will have subtasks. The maximum score for each problem will be 100 points. - Some problems may have special scoring rules which will be indicated in the statement. - The submission that achieves the maximum score is counted towards the final ranking. - The problems range from easy to hard. We also tried to cover a diverse set of topics. - Editorials will be released after the mirror contests end. - **Day 1 mirror:** August 15, 2020 4pm UTC+8 (8am UTC) to 9pm UT...
- [Day 1](https://drive.google.com/file /d/12eVEBQW4B_ZOt40zXH_nBmWEI3F2kxkg/view?usp=sharing

Full text and comments »

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

150.
By Qingyu, 8 months ago, In English
Partial Scores in ICPC Contests The ICPC CLI Symposium during World Finals 2025 and the presentation during the NAC 2026 suggested the idea of bringing partial scoring problems to ICPC contests. Based on my understanding, the NAC judge team is announced to have a medium-level task with subtasks/partial scores included in NAQ 2026 / NAC 2027. <div class="row"> <img src="https://qoj.ac/files/Qingyu/scoring.jpg" style="height: 262.0px;max-width: 100.0%;max-height: 100.0%;"> <img src="https://qoj.ac/files/Qingyu/scoring2.jpg" style="height: 262.0px;max-width: 100.0%;max-height: 100.0%;"> </div> As a judge/chief judge for several Asia EC regionals over the past few years, I've been eager to introduce more innovative ideas in regional contests. However, I feel the idea may lead to some non-trivial changes regarding problem-setting and competition strategy. Over the past few days, we, along with many other judges, coaches, and contestants, had several discussions about this proposal. Since I have yet to see...

Full text and comments »

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

151.
By Egor, history, 11 years ago, In English
CHelper 4.4 I would really appreciate any new ideas of what new features to add I would also appreciate donations: [Yandex.Money](https://money.yandex.ru/embed/shop.xml?account=410011732687384&quickpay=shop&payment-type-choice=on&writer=seller&targets=CHelper&targets-hint=&default-sum=100&button-text=03&successURL=), [PayPal](https://www.paypal.me/CHelper) Seems like no one tried beta verion &mdash; I would really appreciate feedback **4.4.3b3** - All supported sites are updated - New Google Code Jam is now supported - You can now inline any file (feature best used for DCJ, which is not here this year, but I hope will return) ------ **4.4.1b2** Support for interactive tasks added. By default you would interact using user input, but you can write your own interractor ------ **4.3.1** Task format is changes to JSON. I would recomment backing up your project before updating ------ **4.2.2** - Critical bug fix - CHelper Beta is no longer supported. You can sel...
file (feature best used for DCJ, which is not here this year, but I hope will return)

Full text and comments »

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

152.
By plourde27, history, 3 years ago, In English
California Informatics Competition (CALICO) Fall '23 Hello Codeforces! We are excited to invite you to compete in the California Informatics Competition (CALICO) Fall '23! The contest will start on [Saturday, November 18, 2023 at 4:00 p.m. PT](https://timeanddate.com/s/435k) and will be 3 hours long. **Registrations are now open** and will be until November 15, 2023 at 11:59 p.m. PT, so [register here while you can](https://calico.cs.berkeley.edu/register/)! The contest will take place virtually on our [custom judge platform](https://calicojudge.com/). The California Informatics Competition (CALICO) is a semiannual team programming contest organized by students at the University of California, Berkeley. We create original problems to encourage students to grow their problem-solving skills and learn algorithms in fun and exciting ways. Check out our [website](https://calico.cs.berkeley.edu/) to learn more about the contest and join our [discord server](https://discord.gg/RTdxtzXQZ5) to get announcements, make teams, hang out, and mo...

Full text and comments »

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

153.
By bicsi, history, 6 years ago, In English
Autotest: Creating test cases by optimization ### https://github.com/bicsi/autotest Hello! For the last two days I have been working on an idea of mine that I had for quite some time but haven't had the time to implement until now. It is a framework for automatic test generation using optimization methods. ### The main point I want to help people that are into problem-setting but might have problems writing generators (or might have little time to do so). I was thinking that, instead of coming up with complicated generators, one might be able to reuse some generic parametric generators for given structures (partitions, graphs, polygons, etc.) and generate tests by focusing on designing a "fitness" function for a given input case. Not only that, but many times while preparing problems I found that I was writing some generators by giving them some free parameters and trying to optimize something for the test, while keeping some randomness (for example, making the output answer as big as possible s.t. the constraints...
This is provided that you already went through the human-readable README file, and want to learn

Full text and comments »

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

154.
By canine, history, 2 years ago, In English
yet another CP extension for VSCode hello all -- if you happen to be in the market for a new competitive programming extension and use VSCode, may i humbly suggest my new [extension](https://purduecpu.com/extension)? i think it is relatively feature complete, but it's still in alpha (especially for languages other than C++) and may have some kinks that need working out. it theoretically supports C++, Java, Python, and Rust (and it's very easy to add more). i created this because i was dissatisfied that most existing solutions can't import a bunch of test cases from a directory then run them in parallel. i also believe it has a cooler UI than other extensions. as usual, i didn't think it would take this long when i started... if you encounter any difficulties, please let me know on [github](https://github.com/canislupaster/cpu-vscode). **thanks for taking a look!** ![hero image](/predownloaded/f1/90/f190d6993497b2e6a93a505706e36189f5fd0200.jpg) ### Realtime Input/Output unlike other test runners for VSCode, w...
### File I/O and Directory Import perfect for USACO!

Full text and comments »

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

155.
By Arpa, history, 5 years ago, In English
We're not good in our jobs? — CLIS Presentation at ICPC World Finals '20 Hi! CLIS (Competitive Learning Institute Symposium) is one of the programs at ICPC World Finals every year. As you know ICPC World Finals '20 is going to be held in ~2 weeks in Moscow. I had two proposals for the symposium that both accepted. Abstract of one of them goes as follow: <blockquote> <b>We're not good in our jobs?</b> <p> Peter Norvig: "One thing that I can share that was surprising to me is: being a winner of one of these programming contests was actually a negative factor for performing well on the job.", <br> What does it mean? We're performing badly on our jobs? If so, why? <br> In this presentation, I'm going to take a survey of competitive programmers on their job. <br> <ul> <li> As a teacher, how to make CP as close as possible to the job? </li> <li> What happens in CP and what happens on the job, why they are different? </li> <li> What're the main abilities that CP makes them grow and what are the abilities needed on the job? </li> <li> Is the ...
**Update**. The presentation is over. You can [download the slides](https://mega.nz/file/rhZWAbYA

Full text and comments »

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

156.
By ZhangShan, history, 8 months ago, In English
usaco.org wouldn't let me register — so I built my own judge with all 484 USACO problems **TL;DR:** I couldn't register on usaco.org (Gmail verification bug), so I built [OJCloud](https://app.ojcloud.net) — all **484 USACO problems** (2011–2024, Bronze → Platinum) on a modern judge with partial scoring, 16 languages, real-time per-test-case verdicts, progress tracking, and both ICPC/IOI contest modes. Everything uses standard I/O. Register with just a handle + password — no email, no OAuth, no waiting. [cut] Hello, Codeforces! I've been using USACO problems to train for years, but practicing them on usaco.org always felt unnecessarily painful — so I built a judge that just works. Please join our [Discord](https://discord.gg/pg52FspEns) so you can feedback anything about our website (I know it has some troubles and I need your help !) The friction is real: Gmail users [often don't receive verification emails](https://usaco.guide/general/usaco-faq) and the only fix is emailing the contest director personally. Pre-2020 problems silently require file I/O — your ...
://app.ojcloud.net) with a proper judge. Everything uses standard I/O — no file I/O surprises.

Full text and comments »

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

157.
By Nickolas, 6 years ago, In English
April Fools Day Contest 2021: editorial ##[problem:1505A] This problem described the task in quite a lot of detail. The main challenge was that it was interactive, so some effort was required to figure out the right sequence of reading from standard input, writing the answer and checking for end of file. Here is the code in Python: ```python while True: try: q = input() except EOFError: break print("no", flush=True) ``` ##[problem:1505B] As the problem statement strongly hinted, in this problem you had to calculate the **digital** root of the given number. The digital root of a given number is the (single digit) value obtained by an iterative process of summing digits, on each iteration using the result from the previous iteration to compute a digit sum. The process continues until a single-digit number is reached. ##[problem:1505C] YES or NO answer implies that you need to figure out whether the given word is a Fibonacci word. Similarly to the Fibonacci-style integer s...
1. Load the file into a ZX Spectrum emulator (there are many versions, even online ones).

Full text and comments »

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

158.
By rng_58, 15 years ago, In English
My sad story Today I participated in Facebook Hacker Cup Round 3. 100 people participated and top 25 will advance to the onsite round in California. --- The contest has started. I glanced at titles of problems and samples, and decided to solve "Divisor Function Optimization" first. It was a number theory problem, so I was confident that I can solve this problem. However, after thinking for a while, I noticed that I need to calculate all primes <= 2^250000! (of course, it turned out to be wrong later.) It seemed to be impossible, so I read the other two problems. "Trapezoids". My first implession was (I don't know whether it's correct or not): convert trapezoids to rectangles in 2D plane and do some sweep line algorithm. It looked hard to implement, so I decided to skip it. "Unfriending". Try all local-maximal subsequences that can be removed? It's quite easy! I implemented and debugged... oh, I didn't read the problem correctly! Meanwhile a few people solved "Trapezoids", but let's r...
I downloaded the input file carefully, saved it on my computer, and executed my program: "./a

Full text and comments »

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

159.
By awoo, history, 11 years ago, translation, In English
Creating Gravity Defied tracks using Codeforces rating graph Introduction ============ <img src="http://cs624422.vk.me/v624422694/36ac0/8jKq7pMzPOc.jpg" style="float: right;"></img> Hi everybody! Recently I have decided to refresh memories about good old times and play Gravity Defied on my phone. It wasn't really hard to find port of that legendary game from J2ME to modern platforms. It rapidly gained glory among students of past decade. Key points of Gravity Defied success were nice gameplay (biker completing different stages with high cliffs and deep pits), convinient physics (ability to rotate mid-air) and simplicity of modmaking. As for me, it was a bit more than usual game. When I had completed over thousand tracks, I began earning money on helping others to progress. Only later even more difficult games were developed: HOMM 3, Far Cry and Dark Souls... Predevel story ============ <img src="http://cs624422.vk.me/v624422694/370dd/wU1hi77t6U8.jpg" style="float: right;"></img> And now Gravity Defied is on my phone again! Not o...
). Being executed from console, it can either read handles from file or from command line. Installation

Full text and comments »

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

160.
By ekzhang, history, 5 years ago, In English
A very short solution (13 lines) to ICPC WF Problem N, in Julia Hi everyone, my team participated in ICPC World Finals yesterday and had a lot of fun. However, we noticed that **[Problem N](https://judge.icpc.global/problems/vector) did not have many solves (only 1 in-contest and none on Kattis)**, even though our team thought the problem was very fun and doable. Probably, the reason was because numerical algorithms are harder to write in competitive programming languages like C++ and Java. To help explain the solution better, I made a very concise, annotated Julia notebook that **solves the problem in only 16 lines of code**. Hopefully you find it conceptually interesting and helpful. Here is the [link to the notebook as a PDF](https://gist.github.com/ekzhang/98804315e84f43505630288a7d25530d/raw/5aad4c439d9794b729b732cba936344717649762/vector.pdf). Alternatively, if you have Julia and Pluto.jl installed, you can run the notebook directly from the source `.jl` file at [this GitHub Gist](https://gist.github.com/ekzhang/98804315e84f43505630288a...
and Pluto.jl installed, you can run the notebook directly from the source `.jl` file at [this

Full text and comments »

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

161.
By eatmore, history, 6 years ago, In English
My experience with Microsoft Q# Coding Contest Here I want to tell my personal opinion of the [Microsoft Q# coding contest](/blog/entry/77614). First, I'd like to thank Microsoft Quantum team for making a great contest in an unusual format. All the problems were interesting (except D problems ‒ more about them below), and I'm looking forward to similar contests in the future. However, there is a number of issues that I'd like to see discussed and hopefully fixed. The tools --------- The first problem with Q# compiler that everyone trying to use it will see is that it is SLOW. On my machine, compiling a trivial Hello World program takes about 45 seconds. This is a well known problem, reported both on [GitHub](https://github.com/microsoft/qsharp-compiler/issues/436) and even [here on Codeforces](/blog/entry/77614?#comment-642186), and frankly it's a PITA to wait so much after every fix to know if your code still compiles (or still doesn't). But this is only a tip of the iceberg. Before the contest, I decided to read the sou...
Before looking at the code, I thought that they would parse the entire file using either a parser

Full text and comments »

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

162.
By ArtDitel, history, 9 years ago, translation, In English
AIM Tech Mini Marathon 1 Hey Codeforces! ![ ](/predownloaded/37/f3/37f33e02b6220a02b1c61b24d92a72828d9b5f55.png) We’d like to invite you to take part in our **AIM Tech Mini Marathon 1** to be held [this Thursday on the 1st of February at 7 pm MSK](https://www.timeanddate.com/worldclock/fixedtime.html?day=1&month=2&year=2018&hour=19&min=0&sec=0&p1=166). This is **unrated competition**. All the participants will be challenged with only one problem, which doesn’t have a fast and full solution and 3 hours to solve it. Solutions will be evaluated independently on each test. The exact formula of points per test will be given in the problem statement. The score for the contest is a sum of scores for each test. You can participate in contest as a team, 3 members maximum. **All the tests will be released at the very beginning of the competition**. They will be used both for preliminary and final testing. You will be also provided with a checker and a visualizer, written in Python3. You can find environme...
https://drive.google.com/file/d/1dkIBfW_Gy6c3FJtXjMXZPMsGKRyn3pzp

Full text and comments »

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