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

By Vovuh, history, 23 hours ago, In English,

I'm in the middle of the session but I'm still trying to prepare Div. 3 rounds.



Codeforces Round #527 (Div. 3) will start at Dec/18/2018 17:35 (Moscow time). You will be offered 6 or 7 problems with expected difficulties to compose an interesting competition for participants with ratings up to 1600. Probably, participants from the first division will not be at all interested by this problems. And for 1600-1899 the problems will be too easy. However, all of you who wish to take part and have 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. I tried to make strong tests — just like you will be upset if many solutions fail after the contest is over.

You will be given 6 or 7 problems and 2 hours 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 a 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 MikeMirzayanov for the platform, help with ideas for problems and for coordination of my work. Thanks to my good friends Mikhail PikMike Piklyaev, Maksim Ne0n25 Mescheryakov and Ivan BledDest Androsov for help in round preparation and testing the round.

Good luck!

I also would like to say that participants who will submit wrong solutions on purpose and hack them afterwards (example) will not be shown in the hacking leaders table.


UPD: I also would like to thank Roman Ajosteen Glazov for help with testing the round.

Read more »

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

By fjzzq2002, 3 days ago, In English,


I'm glad to invite you to participate in Avito Cool Challenge 2018 which starts on Dec/16/2018 17:35 (Moscow time). The round will be rated to participants of both divisons.


The problem setters are fjzzq2002, yjq_naive, fateice, yanQval and quailty.

We would like to thank:

This round is conducted on the initiative and support of Avito. is a Russian classified advertisements website with sections devoted to general good for sale, jobs, real estate, personals, cars for sale, and services. is the most popular classifieds site in Russia and is the third biggest classifieds site in the world after Craigslist and the Chinese website

Avito presents nice gifts for participants. Top 30 participants and also 10 random participants with places 31-130 will be awarded with a special T-shirt.

You will be given 8 problems and 2.5 hours to solve them. As usual, the score distribution will be revealed shortly before the contest.

This is the first contest on Codeforces for most of us. Hope to see you participating! Good luck!

There will be an interactive problem in the round. If you have never solved interactive problems before, please read this.

UPD: The scoring distribution is standard 500-1000-1500-2000-2500-3000-3500-4000.

UPD: Congratulations to winners!

Also, you can find the list of T-shirt receivers here.

UPD: Editorial

Read more »

Announcement of Avito Cool Challenge 2018
  • Vote: I like it  
  • +523
  • Vote: I do not like it  

By PikMike, history, 4 days ago, translation, In English,

Hello Codeforces!

On Dec/15/2018 17:35 (Moscow time) Educational Codeforces Round 56 (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 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!


Congratulations to the winners:

Rank Competitor Problems Solved Penalty
1 waynetuinfor 7 190
2 nuip 7 226
3 Ali.Sh 7 246
4 danya.smelskiy 7 252
5 Batrr 7 272

Congratulations to the best hackers:

Rank Competitor Hack Count
1 9646516 75:-20
2 interestingLSY 49:-24
3 NIKITA_BY 12:-1
4 katana_handler 11
5 marismmm 8
298 successful hacks and 565 unsuccessful hacks were made in total!

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

Problem Competitor Penalty
A sorry_stefdasca_snsdsux 0:01
B anti_my_abis 0:02
C Golovanov399 0:05
D Golovanov399 0:09
E ko_osaga 0:25
F gritukan 0:28
G tfg 0:09

UPD: Editorial is out

Read more »

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

By savkinsd2089, history, 8 days 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  
  • +170
  • Vote: I do not like it  

By NeercNews, 11 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  
  • +88
  • Vote: I do not like it  

By skywalkert, 2 weeks 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  
  • +203
  • Vote: I do not like it  

By mohammedehab2002, 2 weeks 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  
  • +476
  • Vote: I do not like it  

By NeercNews, 3 weeks 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  
  • +173
  • Vote: I do not like it  

By Errichto, 3 weeks 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  
  • +470
  • Vote: I do not like it