Please subscribe to the official Codeforces channel in Telegram via the link: ×

By savkinsd2089, history, 28 hours ago, translation, In English,


I'm glad to invite you to Codeforces Round #526, which will be held on Dec/10/2018 19:35 (Moscow time). The round will be rated for both divisions.

Problems were prepared by me, Dimon, maxim.shuklin, egor.lifar.

Thanks to ismagilov.code, Kuyan, 300iq, alexey_kuldoshin, Jatana for testing, arsijo and gritukan for helping us and MikeMirzayanov for the great Codeforces and Polygon platforms.

You will be given 6 problems in each division and 2 hours to solve them.


The scoring distribution in Div. 1: 500-1000-1500-2000-2000-2500

The scoring distribution in Div. 2: 500-1000-1500-1750-2250-2750

UPD: Congratulations to winners!

Div. 1:

  1. Radewoosh

  2. CongLingDanPaiShang3k5

  3. Endagorion

  4. ksun48

  5. Um_nik

Div. 2:

  1. Muffinhead

  2. usureluflorianr

  3. arjunsanjeev7

  4. IAmNotGood

  5. tyler

UPD: Editorial

Read more »

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

By NeercNews, 4 days ago, translation, In English,

Hello friends!


This weekend, on 8-9th of December — St. Petersburg, Barnaul, Kremenchug, Tbilisi, Almaty and Sochi will host the XIX Russia Team Open High School Programming Contest. Competition will be attended by more than 250 teams. Contest is held for the first time in Sochi this year -Educational Center “Sirius” will host nine teams.

The main contest will start on 9th of December at 10:00. You can follow current results by the link. Link to the tasks will be able right after the start of the tour.

A mirror will be available on Dec/09/2018 11:05 (Moscow time) – this is for those, who are not a participant, but also want to solve interesting problems! Do not join our broadcasts if you plan to take a part in the mirror. We warn you that, because of spoilers. And, of course, do not open the problem conditions before the start of the round.

If you do not want to participate in a mirror, be sure to join our broadcasts — in video format from the ICPCLive team and in text format in our Telegram-channel!

And if you want to come to the Russia Team High School Contest in St. Petersburg as a guest – just fill in the guest form and get your badge at the registration!

Our friend ismagilov.code has a post – follow this link to see a large set of commands with their total rating. Thank you for interesting information!

And please welcome some teams that stand a good chance to become Cup winners:

Team City Participant 1 Participant 2 Participant 3 Rating
Мертвые души Kazan + SPb scanhex gainullin.ildar Крамник Сергей 5641
Вова спит дома Moscow voidmax aleksandr2754 Jatana 6854
Чудо Зверята! Almaty YaDon4ick Batrr ruslanjan 6727
danya.smelskiy Kremenchuk Sonechko zubec Nasic_number_one 6701
Проблемы с Поллардом? SPb, Vsevolozhsk Qlukva andrey_efremov Forestryks 6660
Komarovi+Mziuri 1 Tbilisi nikabb temotoloraia baqargam 6597
Пурпурный виноград Moscow savkinsd2089 Kuyan Dimon 6558
Пыльная Испания Chelyabinsk Mlxa sava-cska liriKl 6529

Read more »

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

By skywalkert, 7 days ago, In English,


Ugh! That guy comes with another online-mirror and ruins my timeline again.

Here is the last one this year I could share with you, 2018-2019 ACM-ICPC, Asia Jiaozuo Regional Contest. It will start on Saturday, December 8, 2018 at 17:00 (UTC+8) and last for 5 hours. You are able to register 6 hours before the contest starts. However, before the registration starts, you may not view this contest on Gym. By the way, other Asia east continent regional contests shared by my friends and I could be found at Nanjing, Shenyang, Qingdao, Beijing and Xuzhou.

This onsite contest was held by Henan Polytechnic University on November 25th. It is the first time one regional contest was held on HPU, but it is quite memorable. Among the above 6 regional contest, I could definitely say Jiaozuo is the second easiest one. Though it may contain a few hard problems, several problems are solvable for beginners.

The problems are prepared by AHdoc, Claris, quailty and me. Thanks to zscc for discussing ideas, yefllower and niike0goood for testing, and MikeMirzayanov for developing wonderful platforms and kindly answering technical issues.

There is one thing we need to point out again. For everybody who has already read the problems, please do not to participate in this online-mirror contest or discuss solutions before the contest has ended. We have shared solution sketches (in simplified Chinese) in this site, so if needed, we would share some hints (in English) after online-mirror.

At the end of my post, I sincerely recommend authors of Asia-Hongkong (was held on Nov. 18) and Asia-East Continent Final (will be held on Dec. 16) would share problems with the public at any website. Your efforts should be rewarded!

UPD1: As a kindly reminder, our sponsor Jisuanke will hold another online-mirror contest soon after the contest on Gym, which will start on Sunday, December 9, 2018 at 12:00 (UTC+8) without the onsite board.

UPD2: Contest will start 1 hour in advance, as there is a CodeChef SnackDown contest soon after.

UPD3: Registration starts. You may view this page to register.

UPD4: Hints for this contest are published.

Read more »

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

By mohammedehab2002, 9 days ago, In English,


I'm back with a new contest, a new color, and a new batch of xor problems.

Codeforces round #525, rated for the second division, is taking place on Dec/04/2018 17:35 (Moscow time). As usual, first division participants can take part out of competition.

I'm the problemsetter of the round. I'd like to thank 300iq for the great effort coordinating the round, isaf27, cdkrot, BudAlNik, and gritukan for testing the round, scanhex for translating the statements to Russian, mahmoudbadawy for giving his opinions about the problems, and MikeMirzayanov for the great codeforces and polygon platforms.

Like my previous round, you'll be given 6 problems and 2 hours to solve them.

After the contest, I'll be on the community Discord server to discuss the problems.

UPD: the scoring distribution will be 500-1000-1500-2000-2500-3000.

UPD: something wrong happened and the editorial was deleted. I'll post it as soon as possible :(

UPD: the editorial has been re-written.

Good luck & Have fun!

UPD: congratulations to the winners!


  1. Madball
  2. Shayan
  3. ei133333
  4. paulica
  5. _Kuroni_


  1. paulica
  2. DXC
  3. 0101-1001
  4. problem_destroyer420
  5. knil_GMO

Read more »

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

By NeercNews, 13 days ago, translation, In English,

Olá a todos!


Current Standings

The first winter weekend of the year would be tough for students who arrive to St. Petersburg, Barnaul, Almaty and Tbilisi. On the 1-2 of December ITMO University, Altai State Technical University, European University and Kazakh-British Technical University will host the final contest of Northern Eurasia. Participants are going to face a serious competition – they will fight for the right to represent their university on the finals of the ICPC 2019 in April in Portugal.

At the ITMO University stage we also expect 131 teams, including the Champions and Vice-Champions (but, worth mentioning, NEERC Champions) from last year ICPC'18.

Stay tuned for the latest news and monitors from the competition! These guys will go to the Porto to represent our Northern Eurasian region! Participants of our region have been taken the Final ICPC Cup for the last seven years. Will they continue their series of victories? Will see!

UPD: To the finals ICPC 2019 were qualified 15 teams:

  1. Moscow SU 3 (Makeev, Reznikov, Ipatov)
  2. Moscow IPT 6 (Sergunin, Belykh, Stepanov)
  3. International IT U 1 (Satylkhanov, Baimukanov, Kuanyshbay)
  4. SPb ITMO University 2 (Poduremennykh, Naumov, Korobkov)
  5. SPb br of NRU HSE 1 (Ermilov, Fedorov, Labutin)
  6. U of Latvia 2 (Klevickis, Pretkalnins, Pakalns)
  7. SPb SU 5 (Grebennikov, Fadeeva, Zavarin)
  8. Belarusian SU 1 (Lukyanov, Rak, Kim)
  9. NRU HS of Economics 1 (Sakhabiev, Nikolenko, Gribov)
  10. Kazakh-British TU 1 (Amanov, Aman, Zhussupov)
  11. Saratov SU 1 (Androsov, Glazov, Dalabaev)
  12. Belarusian SUIR 1 (Mosko, Razhkou, Shilyaev)
  13. Tbilisi IBSU 1 (Ksovreli, Narushvili, Svanidze)
  14. Northern FU (Dyachkov, Guriev, Asyutchenko)
  15. Ural FU 6 (Permyakov, Zuev, Mullabaev)

Follow the official competition hashtag #NEERC and join a live video, organized by ICPCLive and, in person, Aksenov239.

We are pleased to notice that this year at the NEERC will be special! We host some unique guests from the Committee of the ICPC organization – the Executive Director of the ICPC, Dr. Bill Poucher and Deputy Executive Director of the ICPC, Dr. Jeff Donahue. We will passionate to hear some inspiring words for our teams from Bill! And, of course, don’t miss the interviews with our special guests live!

If you want to visit the championship as a guest – please fill out the form.

If you do not participate in the semifinals, you can try to solve problems from 23rd NEERC challenge in the mirror. It will start in a few minutes after the main round on December 2nd. The tasks will be provided in English only. The mirror is an unrated contest.

We have compiled a table of participating teams with the total Codeforces rating >= 7000. Who is your favorite thou?

Team Participant 1 Participant 2 Participant 3 Rating
Moscow SU: Red Panda Ipatov (LHiC) Reznikov (gritukan) Makeev (V--o_o--V) 7788
Moscow IPT: Shock Content Stepanov(irkstepanov) Sergunin(andreysergunin) Belykh(WHITE2302) 7689
Moscow IPT: Good Game Golovanov(Golovanov399) Uvarov(I_hate_ACM) Machula(mHuman) 7671
SPb SU 1 Gorbachev(i_love_isaf27) Ivanov(ivanovmp) Safonov(isaf27) 7638
SPb ITMO University 1 Sayutin(_kun_) Kirillov(senek_K) Drozdova(demon1999) 7604
Moscow IPT: Racoons Grigoryev(DmitryGrigorev) Tretyakov(ShadowLight) Shpakovskij(Denisson) 7440
SPb SU 2 Milshin(WreckingBall) Filippov(step_by_step) Fedorov(DaniilF) 7367
SPb ITMO University 2 Korobkov(romanasa) Poduremennykh(PoDuReM) Naumov(josdas) 7360
Moscow SU: NoNames Kalendarov(Andreikkaa) Koshelev(SendThemToHell) Chunaev(ch_egor) 7243
NRU HSE: IOI is not ICM, said MS Nikolenko(qoo2p5) Gribov(grphil) Sakhabiev(super_azbuka) 7052
Saratov SU #2 Androsov(BledDest) Dalabaev(adedalic) Glazov(Ajosteen) 7000

Вoa sorte! Siga-nos:

Read more »

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

By Errichto, 12 days ago, In English,

Hi. I'm back from USA!

I will do a new lecture tomorrow (Thursday) at 2pm CEST on my Youtube channel: Watch me live (and ask questions), or just watch the video later. This will be part 1, and I will do part 2 in a few days (maybe Tuesday).

UPDATE — part 2 is coming on Thursday, same time. Link:

There are no prerequisites this time. I recommend reading the materials below in advance, and trying to solve problems 1 and 5. If you are strong, just read problems and see if you can't solve something (maybe problem 8?).

Technique "Exchange Arguments"

If we're given n items and we should choose some of them and choose their order, we should sort them with some strange/tricky comparator, and then do O(N2) dynamic programming. The dp should be dp[pref][used] — best possible result (balance) if we chose used items so far (in the prefix pref).

"Strange/tricky comparator" checks which of the two elements should be earlier, usually just solving the problem for N = 2.

Read more »

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

By PikMike, history, 2 weeks ago, translation, In English,

On Nov/28/2018 17:35 (Moscow time) Educational Codeforces Round 55 (Rated for Div. 2) will start.

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 extented ACM 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 7 problems and 2 hours to solve them.

The problems were invented and prepared by Mike MikeMirzayanov Mirzayanov, Roman Ajosteen Glazov, Adilbek adedalic Dalabaev, Vladimir Vovuh Petrov, Ivan BledDest Androsov and me.

Good luck to all participants!

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

Hello Codeforces!

We are excited to announce that the Hello Muscat Programming Bootcamp registration is open! The camp will take place from March 9th to March 15th, 2019, and our early bird discount of 15% is going until December 15th!

This next edition in our Hello Programming Bootcamp will run in parallel with the traditional Moscow ICPC Workshop — both Bootcamps’ contests will be identical, and contestants will be able to see their position in the General Leaderboard. Every day, both camps will be competing simultaneously, 4,000 kilometers from each other!


We would also like to remind you that the deadline for applying to the Master’s in Robotics programme scholarship will close November 30th, so we encourage you to check out the website to see the all the requirements and apply!


UPD: You can discuss the problems after the contest at a local Discord server.


Congratulations to the winners:

Rank Competitor Problems Solved Penalty
1 I_love_Tanya_Romanova 7 157
2 theodor.moroianu 7 330
3 halyavin 7 361
4 Radewoosh 6 158
5 palayutm2001 6 190

Congratulations to the best hackers:

Rank Competitor Hack Count
1 halyavin 131:-8
2 zdw1999 55:-4
3 Marcosk 42:-1
4 ismagilov.code 64:-48
5 garipov.roma 48:-24

1354 successful hacks and 1065 unsuccessful hacks were made in total!

And finally people who were the first to solve each problem:

Problem Competitor Penalty
A I_love_Tanya_Romanova 0:02
B Dalgerok 0:04
C I_love_Tanya_Romanova 0:08
D hitman623 0:15
E lqs2015 0:11
F ko_osaga 0:47
G RomaWhite 0:08

UPD3: Editorial is out

Read more »

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

By skywalkert, 2 weeks ago, In English,


This weekend we would like to share an online-mirror of 2018-2019 ACM-ICPC, Asia Xuzhou Regional Contest with you. Please notice its start time is Saturday, December 1, 2018 at 18:00 (UTC+8) and we will be there for answering your questions. You are able to register 6 hours before the contest starts. However, before the registration starts, you may not view this contest on Gym. After the online-mirror contest, you can virtually participate at any time you want.

The 2018 ACM-ICPC Asia Xuzhou Regional Contest has been finished at China University of Mining and Technology, on October 28. Although 288 teams participated in the onsite contest, only 195 of them (including invited teams) finally solved at least one of 13 problems in 5 hours. Is the contest too hard? Or is the difficulty only applied to Chinese participants? We cannot get a conclusion clearly... Anyway, we hope these problems will benefit people who want to gain great results in ICPC.

The problems are prepared by AHdoc, Claris, quailty and me. Thanks to niike0goood and zscc for discussing ideas, yefllower and niike0goood for testing, Syloviaely for playing a crucial role in the contest, and MikeMirzayanov for developing Codeforces and Polygon.

Also, as a kindly reminder, Jisuanke will hold another online-mirror contest that will start on Sunday, December 2, 2018 at 12:00 (UTC+8).

We kindly ask everybody who has already read the problems not to participate this online-mirror contest or discuss any solution in public before the contest has ended. Your cooperation will be greatly appreciated.

UPD1: Registration starts. You may view this page to register.

Read more »

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

By KAN, 2 weeks ago, translation, In English,


Tomorrow, at Nov/25/2018 19:35 (Moscow time) we will host the final round of Mail.Ru Cup 2018. The problems were authored and prepared by Codeforces team: me, Dmitry _kun_ Sayutin, Ildar 300iq Gainullin and Mike MikeMirzayanov Mirzayanov, and also Maxim ne0n25 Mezhcheryakov. Huge thanks to Grigory gritukan Reznikov abd Kamil Errichto Debowski for problems' testing!

This round is the final in the new championship called Mail.Ru Cup, you can learn more about it following the link. The round will be rated for everybody!

After the round we will know who will get the following prizes:

  • First place — Apple MacBook Air
  • Second and third place — Apple iPad
  • Fourth, fifth, sixth places — Samsung Gear S3
  • Traditionally, the top 100 championship participants will get cool T-shirts!

In each round, top 100 participants get prize points according to the table. The championship's result of a participant is the sum of the two largest results he gets on the three rounds. The results of the two first rounds are published here. In case of ties in the top six places, they will be broken by the sum of in-round scores in the corresponding (best for the participant) two rounds.

There will be eight problems and two and a half hours to solve them.

Good luck!

P. S. MikeMirzayanov invites everybody to the official Codeforces channel in Telegram:

The round has finished, thanks everybody, hope you liked the problems!

Congratolations to the winners of the third round of Mail.Ru Cup 2018:

  1. Radewoosh
  2. V--o_o--V
  3. ch_egor
  4. ksun48
  5. RAVEman

The results of the Cup will be announced shortly.

The editorial is here.

Read more »

Announcement of Mail.Ru Cup 2018 Round 3
  • Vote: I like it  
  • +198
  • Vote: I do not like it  

By danya.smelskiy, 3 weeks ago, translation, In English,

Hi, Codeforces!

Codeforces Round #524 (Div. 2) will be held on Nov/24/2018 10:35 (Moscow time). The round will be rated for the second division (rating is less than 2100). As usual, participants from the first division will be able to participate out of competition.

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

This round was prepared by me, arsijo, and StasyaCat.

Thanks to Markellonchik, iSlava, and I_love_Maria_Ivanova for testing, AHDPIYKO for pictures to the problems, and MikeMirzayanov for wonderful platforms Codeforces and Polygon.

The round is based on the II stage of Ukrainian Olympiad in Informatics, that is why please do not discuss the problems before the system testing start.

UPD: Scoring distribution: 500 — 750 — 1250 — 1750 — 2250 — 2500.

UPD2: Congratulations to the winners:

  1. LingXuan
  2. Laggay
  3. H-C-H
  4. lqs2015
  5. Trrui

UPD3: Editorial.

Read more »

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