By MikeMirzayanov, 11 hours ago, In English

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

If you have installed PBOX, 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.

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}}; instead of vector<vector<int>> v{vector<int>{1, 2}};. What else is useful? Please, if you are good with modern C++ then write.

You might be interested in looking at such a table. Before implementation, I always test every C++ distribution for the efficiency of reading and writing large amounts of data. For example, the latest GCC compiler from MSYS2 is terribly slow in some cases. I don't want to use it here. Also, it happens that some specifiers like lld or Lf work unexpectedly. In the table by reference, the second line is the added compiler. The columns correspond to different tests. The cell contains the time of the test execution. If I have time, I will someday publish scripts for testing c++ compiler installations.

Bye for now,
— Mike

Read more »

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

By MrPaul_TUser, history, 4 days ago, In English

Hello, Codeforces!

I'm glad to invite you to amazing (we've tried to make it such) Codeforces Round #748 (Div. 3) which will start on Oct/13/2021 17:35 (Moscow time). This round is made by me (MrPaul_TUser), a significant contribution to the round was also made by MikeMirzayanov and BledDest.

The round contains 6-8 problems. The difficulties of the problems are expected to compose an interesting competition for participants with ratings up to 1600. However, all of you who wish to take part and have a rating 1600 or higher, can register for the round unofficially.

The round will be hosted by rules of educational rounds (extended ACM-ICPC). Thus, during the round, solutions will be judged on preliminary tests, and after the round, it will be a 12-hour phase of open hacks. We tried to make really strong tests — just like you will be surprised if many solutions fail after the contest is over.

You will be given 6-8 problems and 2 hours 15 minutes to solve them.

Note that the penalty for the wrong submission in this round (and the following Div. 3 rounds) is 10 minutes.

Remember that only the trusted participants of the third division will be included in the official standings table. As it is written by link, this is a compulsory measure for combating unsporting behavior. To qualify as trusted participants of the third division, you must:

  • take part in at least two rated rounds (and solve at least one problem in each of them),
  • do not have a point of 1900 or higher in the rating.

Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you.

Thanks to _c_k_r_, Vladosiya, spotless, Yousry, powergee101, ncduy0303, I_Remember_Olya_ashmelev, A_Killer, OlegZubkov, mahade31, arjunsanjeev7, and UpS0lver for testing the round and improving tasks.

Good luck and have fun!

UPD Editorial

Read more »

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

By BledDest, 7 days ago, In English

Hello Codeforces!

On Oct/10/2021 12:05 (Moscow time) Educational Codeforces Round 115 (Rated for Div. 2) will start. Note that the start time is unusual.

Series of Educational Rounds continue being held as Harbour.Space University initiative! You can read the details about the cooperation between Harbour.Space University and Codeforces in the blog post.

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 full solution is 10 minutes. After the end of the contest you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally.

You will be given 6 or 7 problems and 2 hours to solve them.

The problems were invented and prepared by Alex fcspartakm Frolov, Mikhail awoo Piklyaev, Max Neon Mescheryakov and me. Also huge thanks to Mike MikeMirzayanov Mirzayanov for great systems Polygon and Codeforces.

Good luck to all the participants!

Our friends at Harbour.Space also have a message for you:

Hello once again, Codeforces!

We are thrilled to congratulate our faculty member Nikolay KAN Kalinin on his first place at the ICPC World Finals, celebrated in Moscow, Russia. Years of training by Nikolai and his team from Nizhny Novgorod State University lead them to the top of the scoreboard, defeating teams from 116 other universities and becoming world champions.

We would also like to congratulate our future student Egor kefaa2 Dubovik, who won the silver medal with the Belarusian State University. Egor will join our Masters in Computer Science in the coming weeks.

We are looking forward to seeing Nikolay again next January when he teaches his course on Advanced Algorithms and Data Structures alongside Mike Mirzayanov. In this course, students focus on key and in-depth algorithms and data structures that form a modern computer specialist’s toolkit.

We are always excited to see Codeforces participants as our students here at Harbour.Space, so once again we’ve given a special discount (up to 70%) for the single course participation in Barcelona, Spain (travel cost and accommodation are not included).

Reserve your spot →

Codeforces and Harbour.Space

Good luck on your round, and see you next time!

Harbour.Space University

UPD: The editorial can be found here.

Read more »

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

By TadijaSebez, history, 8 days ago, In English

Hello, Codeforces!

Microsoft Development Center Serbia is thrilled to announce the finals of the 14th edition of Bubble Cup competition! Bubble Cup is an international, ICPC-style team contest aimed at university and high school students.

Contest will take place on Saturday, 9th of October at 10AM CEST, in online format. Winners will be announced at the closing ceremony. You can find more info on the BubbleCup website.

Just like the previous editions, this final will be followed by an online mirror competition on Codeforces. Mirror will take place on the same day about an hour after the start of the finals — Oct/09/2021 12:05 (Moscow time). Contest will last for 4 hours and ICPC rules will be applied. It will be a competition for teams of 1-3 members. There will be at least eight problems.

Just like last year, the finals are divided in two "divisions", called Premier League and Rising Stars. The two contests will have most of their problems in common, but the Rising Stars competition will feature some easier tasks targeted at high school contestants.

Both of the contests will be mirrored here on Codeforces, with Premier League mapping to the Div1 contest and Rising Stars mapping to the Div2 contest. The mirror will use native Codeforces ICPC team contest rules. Each team is allowed to use multiple computers.

Both contests will be unrated, due to the format and the length of the mirror being dissimilar to the standard Codeforces rated rounds.

The problems and their solutions were created by employees and interns of Microsoft Development Center Serbia: niksmiljkovic, acac97, renea, BubbleCup, nikolapesic2802, berke00, davidmilicevic97, ijevtic, dj0l3, igzi, Kole, Vasiljko, pavlej and me TadijaSebez.

We give our thanks to Nikolay Kalinin (KAN) and Mike Mirzayanov (MikeMirzayanov) for making these mirror contests possible and for the wonderful Codeforces and Polygon platforms. Special thanks goes to Alexandr Lyashko (knightL) for helping out with problem testing.

You can find problems from previous finals on our Codeforces online mirror competitions:

Bubble Cup 8 — Finals [Online Mirror]

Bubble Cup 9 — Finals [Online Mirror]

Bubble Cup X — Finals [Online Mirror]

Bubble Cup 11 — Finals [Online Mirror, Div. 1]

Bubble Cup 11 — Finals [Online Mirror, Div. 2]

Bubble Cup 12 — Finals [Online Mirror, Div. 1]

Bubble Cup 12 — Finals [Online Mirror, Div. 2]

Bubble Cup 13 — Finals [Online Mirror, Div. 1]

Bubble Cup 13 — Finals [Online Mirror, Div. 2]

We wish good luck to all participants!

UPD: Editorial

Read more »

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

By ICPCNews, 5 weeks ago, In English


Hello, Codeforces!

Welcome to the ICPC Communication Routing Challenge powered by Huawei!

This challenge edition is very special, as it will be happening in conjunction with the ICPC World Finals! For those who are not participating in the finals — ICPC and Codeforces are offering a unique chance to compete during a 5-day Challenge Marathon and win amazing prizes from Huawei!

ICPC Challenge Marathon (open to public, unrated): October 9-14, 2021, 00:00 UTC:


This time we’re delighted to provide you with a future-oriented topic – routing algorithms for next-generation communication. During this Challenge we will provide you with a super-large inter-satellite optical network to properly plan message paths, to reduce communication latency and improve resource utilization. However, finding the optimal path in a network with limited resources is an NP-hard problem. Considering the physical constraints of optics and circuits, our algorithm faces greater technical challenges:

  • How can we model and abstract device constraints and design algorithms in the most appropriate way?
  • Is there an algorithm that takes almost the same time to calculate routes as the network scale increases?
  • Is there any way to obtain the theoretical optimal solution in a short period for ultra-large networks?

We hope that these satellite communications challenge questions can help you understand the problems that Huawei's software algorithm researchers face every day. All the best!!!


For 3-hours onsite ICPC World Finals Challenge Huawei will provide prizes to the winners in 2 groups of participants:

  • Group 1: TOP 30 ICPC World Finalists, who participate individually: text

    1st-10th place HUAWEI MATE 40 Pro
    11th-20th place HUAWEI MatePad Pro
    21st-30th place HUAWEI WATCH 3 Pro

  • Group 2: TOP 9 ICPC World Finals Coaches and Co-Coaches, who participate individually:

    1st-3rd place HUAWEI MATE 40 Pro
    4th-6th place HUAWEI MatePad Pro
    7th-9th place HUAWEI WATCH 3 Pro

For 5 days online Challenge Marathon, Huawei will provide prizes to TOP 30 individual participants:

1st place* HUAWEI MateBook X Pro + 5000 USD
2nd — 4th place HUAWEI MateBook X Pro
5th — 10th place HUAWEI MATE 40 Pro
11th — 16th place HUAWEI MatePad Pro
17th — 22nd place HUAWEI WATCH 3 Pro Classic
23rd — 30th place HUAWEI FreeBuds Studio

* The 1st place winner will get additional bonus in amount of 5000 USD. If the bonus cannot be transferred to the winner due to any reason, it may be replaced by a prize of the same value.

If the allocated Huawei Challenge prize cannot be delivered to your region for any reason it may be replaced by another prize of the same value (if no legal restrictions), at the discretion of the sponsor.

By participating in this Challenge, you agree to the Challenge Rules and Conditions of Participation

Good luck to all participants!

UPD: The contest duration has been extended to 5 days. The actual finish time is October 14, 2021, 00:00 UTC

Read more »

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

By Theo830, 2 weeks ago, In English

Γεια σου (Hello), Codeforces!

Dremix10 and I are glad to invite you to the first Cypriot round Codeforces Round #747 (Div. 2) which will take place on Oct/08/2021 18:05 (Moscow time). Note the unusual start time of the round. As usual, this round will be rated for participants with rating lower than 2100.

Problems were created and prepared by Dremix10 and me. We tried to make them interesting, with short and clear statements. We hope that you will enjoy them!

I would like to thank:

You will be given $$$6$$$ problems (and one subtask) and $$$2$$$ hours and $$$15$$$ minutes to solve them. Scoring distribution will be announced later.

Good luck and have fun!


Score Distribution: $$$500-1000-1500-1750-(1000-1500)-2750$$$





  1. A-SOUL_Diana

  2. zxcgod

  3. tuihuademing6

  4. OguriCap


Div1 + 2:

  1. SSRS_

  2. tourist

  3. kefaa2

  4. hitonanode

  5. A-SOUL_Diana

Read more »

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

By BledDest, 2 weeks ago, In English

Hello, Codeforces!

First and foremost, we would like to say a massive thank you to everyone who entered and submitted their answers to the seven Kotlin Heroes competitions which were held previously: Episode 1, Episode 2, Episode 3, Episode 4, Episode 5: ICPC Round, Episode 6, and Episode 7.

Ready to challenge yourself to do better? The Kotlin Heroes: Episode 8 competition will be hosted on the Codeforces platform on Oct/07/2021 17:35 (Moscow time). The contest will last 2 hours 30 minutes and will feature a set of problems from simple ones, designed to be solvable by anyone, to hard ones, to make it interesting for seasoned competitive programmers.


Top three winners will get prizes of $512, $256, and $128 respectively, top 50 will win a Kotlin Heroes t-shirt and an exclusive Kotlin sticker, competitors solving at least one problem will enter into a draw for one of 50 Kotlin Heroes t-shirts.

Registration is already open and available via the link. It will be available until the end of the round.

The round will again be held in accordance with a set of slightly modified ICPC rules:

  • The round is unrated.
  • The contest will have 10 problems of various levels of complexity.
  • You are only allowed to use Kotlin to solve these problems.
  • Participants are ranked according to the number of correctly solved problems. Ties are resolved based on the lowest total penalty time for all problems, which is computed as follows. For each solved problem, a penalty is set to the submission time of that problem (the time since the start of the contest). An extra penalty of 10 minutes is added for each failed submission on solved problems (i. e., if you never solve the problem, you will not be penalized for trying that problem). If two participants solved the same number of problems and scored the same penalty, then those of them who had previously made the last successful submission will be given an advantage in the distribution of prizes and gifts.


If you are still new to Kotlin we have prepared a tutorial on competitive programming in Kotlin and Kotlin Heroes: Practice 8, where you can try to solve a few simple problems in Kotlin. The practice round is available by the link.

And last but not the least: two-time ICPC World Champion and winner of four previous Kotlin Heroes episodes Gennady tourist Korotkevich will be featured in a livecoding session, conducted by JetBrains, where he is going to show how to solve the problems from the Practice round, so you can learn how to use Kotlin in contests from the most famous competitive programmer in the world. The JetBrains Presentation and livecoding session from Gennady will be streamed on ICPC Live and Kotlin YouTube channel. The stream starts at 10 a. m. on the 2nd of October, Moscow time (UTC+3), you can join the stream by the link.

We wish you luck and hope you enjoy Kotlin.

Read more »

Announcement of Kotlin Heroes: Practice 8
Announcement of Kotlin Heroes: Episode 8
  • Vote: I like it
  • +146
  • Vote: I do not like it

By ICPCNews, 12 days ago, In English


Hello, Codeforces!

ICPC World Finals Moscow will begin on October 5, 2021 at 8:30 (UTC+3). We are thrilled to invite you to join the live broadcast of the main event of the year in the world of sports programming!

For the very first time in October 2021, Moscow will host the world’s most prestigious competition for young IT talents, the ICPC World Finals Championship. The last International Collegiate Programming Contest has hosted over 60000 students from 3,514 universities in 115 countries that span the globe. October 5 more than 100 teams will compete in logic, mental speed, and strategic thinking at Russia’s main Manege Central Conference Hall.

Some useful links:

All available broadcast:


We wish good luck to all competing teams to have a great time spending, and to do the best to get amazing results!

Read more »

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

By Hemose, history, 2 weeks ago, In English

صباحو (Good Morning), Codeforces!

I'm glad to invite you to Codeforces Round #746 (Div. 2), which will be held on Oct/03/2021 17:35 (Moscow time).

This round is rated for the participants with rating lower than 2100.

You will be given 6 problems and 2 hours to solve them. All problems were prepared by me and Bakry_.

One of the problems will be interactive. So, it is recommended to read the guide on interactive problems before the round.

I would like to thank:

The statements are short and we have tried to make the pretests strong. I encourage you to read all the problems.

For people who don't like stories, you will find all the stories written in italic you can skip them safely.

This is our first official round on Codeforces. We are sincerely looking forward to your participation. We hope everyone will enjoy it.

Good luck and see you in the standings!


Score Distribution: $$$500$$$ — $$$1000$$$ — $$$1500$$$ — $$$2000$$$ — $$$2500$$$ — $$$(1750-1750)$$$

UPD1: Editorial is out!

UPD2: Winners

Div. 1 + Div. 2

  1. LayCurse

  2. SSRS_

  3. qazsxdew

  4. peti1234

  5. dlalswp25

Div. 2

  1. qazsxdew

  2. XianHZ

  3. tsukigakirei

  4. FangZeLi_AK_IOI


Read more »

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