By Radewoosh, history, 31 hour(s) ago, In English,

Hello, codeforces!

Sorry for the long break, but the last weeks of holidays and the first weeks of academic year took my attention. I hope today's trick will make you forgive me. :P

I invented this trick a few years ago, but for sure I wasn't first, and some of you already know it. Let's consider the following interactive task. There are n (1 ≤ n ≤ 105) hidden integers ai, each of them from range [1, 1018]. You are allowed to ask at most 103000 queries. In one query you can choose two integers x and y (1 ≤ x ≤ n, 1 ≤ y ≤ 1018) and ask a question ''Is ax ≥ y?'' The task is to find the value of the greatest element in the hidden array. The checker isn't adaptive.

Unfortunately, this task is only theoretical, and you cannot solve it anywhere, but it'll turn out, that solution can be handy in many other, much more complicated problems.

Read more »

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

By KAN, 37 hours ago, translation, In English,

Hi all!

This weekend, at Oct/21/2018 11:10 (Moscow time) we will hold Codeforces Round 517. It is based on problems of Technocup 2019 Elimination Round 2 that will be held at the same time.

Technocup is a major olympiad for Russian-speaking high-school students, so if you fall into this category, please register at Technocup 2019 website and take part in the Elimination Round.

Div. 1 and Div.2 editions are open and rated for everyone. Register and enjoy the contests!

The round authors are Kostroma, Golovanov399, komendart, Denisson and Dashk0.

Have fun!

The round is over, congratulations to the winners!

Technocup 2019 - Elimination Round 2

  1. Holidin
  2. andrey_efremov
  3. Sonechko
  4. radoslav11
  5. scanhex

Codeforces Round #517 (Div. 1, based on Technocup 2019 Elimination Round 2)

  1. Radewoosh
  2. ainta
  3. 300iq
  4. fjzzq2002
  5. RAVEman

Codeforces Round #517 (Div. 2, based on Technocup 2019 Elimination Round 2)

  1. cz_yixuanxu
  2. orbitingfIea
  3. I_Love_Irelia
  4. djq_fpc
  5. buaads

The editorial is published.

Read more »

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

By MikeMirzayanov, 3 days ago, translation, In English,


ACM-ICPC Southern Subregional Contest (NEERC/Northern Eurasia) 2018 has ended on October 16. There were 72 teams onsite in Saratov, most of them were invited because of their result on the qualification stage.

On Oct/20/2018 11:05 (Moscow time) will start online-mirror 2018-2019 ICPC, NEERC, Southern Subregional Contest (Online Mirror, ACM-ICPC Rules, Teams Preferred).

In this contest I play a role of Cheif Judge and the jury teams consists of ex-participants of ICPC from Saratov and jury members from other cities. Many thanks to all of them! I hope you will like the problems!

I invite ACM-ICPC teams and individual participants of Codeforces competitions to take part! Sure, the contest will be unrated.


Read more »

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

By isaf27, 5 days ago, translation, In English,

Hi all!

I'm happy to welcome you at the Div.1 and Div.2 shared rated round Mail.Ru Cup 2018 Round 1, it will start at Oct/18/2018 19:35 (Moscow time). The problems were prepared by me — Ivan Safonov. I'd like to thank Dmitry _kun_ Sayutin for an idea and preparation of one of the problems and Egor I_love_isaf27 Gorbachev for an idea for another one.

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

The championship feature 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.

Huge thanks to Grigory gritukan Reznikov and Ilya izban Zban for testing the problems, to Nikolay KAN Kalinin and Ildar 300iq Gainullin for their help in preparation, and to Mike MikeMirzayanov Mirzayanov for Codeforces and Polygon platforms.

The round will feature eight problems to solve in two and a half hours. The scoring will be announced closer to the beginning of the round.

I hope everyone will find some problems interesting. I wish everybody a successful round and a positive rating change!

Good luck!

UPD1,Scoring distribution:

500 750 1250 1500 2000 2250 3000 4000

Congratulations to the winners of Round 1!

  1. mnbvmar
  2. Um_nik
  3. V--o_o--V
  4. LHiC
  5. lewin



Read more »

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

By ch_egor, 9 days ago, translation, In English,

Hi everybody,

This Sunday there will be a 16th Moscow Team Olympiad, high school students competition based in Moscow that is an elimination contest for All-Russian Team Olympiad. This contest is prepared by Moscow Olympiad Scientific Committee that you may know by Moscow Open Olympiad, Moscow Olympiad for Young Students and Metropolises Olympiad (rounds 327, 342, 345, 376, 401, 433, 441, 466, 469, 507).

Round will be held at 10:05 UTC on Sunday and will last for 2 hours. Each division will have 6 problems.

Problems are prepared gritukan, Glebodin, Andreikkaa, qoo2p5, mingaleg, Flyrise, _kun_, achulkov2, grphil, Sehnsucht, Aphanasiy, Sender, DebNatkh, GreenGrape under my supervision with great help of GlebsHP, _meshanya_, Endagorion, Zlobober and Helen Andreeva.

Thanks to _kun_ for the round coordination and statement translation, and also thanks for MikeMirzayanov for systems codeforces and polygon, which was used to prepare problems of this olympiad.

Good luck everybody!

UPD1: The scoring distribution will be:

500 — 10001000 — 1500 — 2000 — 2500 for div. 1.

500 — 1000 — 1500 — 20002000 — 2500 for div. 2.

UPD2: Editorial

UPD3: Winners:

Div. 1:

  1. mnbvmar
  2. bmerry
  3. j_______________________
  4. tlwpdus
  5. WA_TLE

Div. 2:

  1. Ebola_Emperor
  2. Orange_User
  3. orbitingfIea
  4. little_waxberry
  5. fnch

Read more »

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

By MikeMirzayanov, 9 days ago, translation, In English,

Hi Codeforces!

For you, perhaps it was yet another Codeforces round. But not for me. Codeforces Round #515 (Div. 3) is the first round tested on new judging servers at ITMO University. And this is not just an update of location. Ta-dam! Now your solutions will be judged on the new Intel i3-8100 processors. And this is not all news. The number of judging servers has increased, which means fewer queues during rounds!

I am pleased to announce that now I live in St. Petersburg, I work at ITMO, and Codeforces is gradually moving from the walls of dear to me Saratov University to ITMO University. The decision to move was not easy for me. My plan is that, based on ITMO, I can focus more on Codeforces development and work on the platform. The number of world champions per square meter is simply overwhelming, and working with a large team of such enthusiasts (and professionals!) of sports programming, like me, is extremely inspiring. I always liked St. Petersburg and the atmosphere of ITMO. Intuition did not let me down. I feel surrounded by people close to me in spirit (and I’m not only talking about a work). I am sure there are many interesting common projects ahead!

I do not say goodbye to Saratov. This is my hometown, full of people dear to me. I came to my first programming training at SSU exactly 20 years ago. Antonina Fedorova, thank you very much. Natalya Andreeve, I would like to say a personal thank you now. You have opened for me an interesting world of programming competitions. We were happy together when we first advanced to the ICPC Finals, and later when we became champions of Russia and the World. We made countless competitions and helped many Saratov students find themselves in programming. I fervently support the future of the Programming Competitions Training Center at SSU and future generations of Saratov contest participants. And now, I am in Saratov and still the head of the jury of the ICPC Subregional Contest, and even an SSU employee. I hope that we will make a good and interesting contest.

I will try to make a complete relocation of the Codeforces infrastructure to ITMO without downtimes. A good Internet connection between SSU and ITMO is encouraging. All the planned work will adapt to the schedule of the rounds, and now it pleases more than ever (I send my greetings to the coordinators!).

Currently, all Codeforces and Polygon solutions are being judged on new servers based on Intel i3-8100 processors. Fortunately, the performance of a single core is not very different from the one that the old generation of judging servers had. Thus, the time limits in all problems remain the same.

Such news. I am waiting for you on Codeforces Round #516 (by Moscow Team Olympiad).


Read more »

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

By SannikovDmitry, 11 days ago, translation, In English,

Mail.Ru Group together with Codeforces invites everyone to take part in the new Mail.Ru Cup competitive programming championship.


The championship is holding on the Codeforces platform in the format of four rounds: one practice round and three main rounds. Each round is open to all comers. There are no restrictions on participants in any of the rounds.

The practice round is intended for familiarization with the championship platform, participation in it is optional, the results of performances in the practice round do not affect the results of participation in the championship. It is unrated, the duration is 72 hours.

All three main rounds are independent, the results of participation in each of it do not affect the possibility of participation in next rounds. A competitor may take part in any number of main rounds. Each main round lasts 2.5 hours. All of them are open for everyone and rated for all participants.

Read more »

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

By mgch, history, 5 weeks ago, In English,

Hello CodeForces community!

With great enthusiasm and excitement, I would like to invite you to register for CodeChef’s 5th edition of SnackDown which is open to anyone who has a knack for programming. In a truly global spirit of competition, CodeChef organizes SnackDown with an aim to bring the top coders from the world under one roof for its final onsite round in India. Along with the total cash prizes of $20.5K , there are special slots and prizes for Top School Teams, Top Girls teams and Best Indian Teams. And of course the chance to experience a fully sponsored trip to India.

To know how it feels to be an onsite finalist at SnackDown, Have a glance at last year’s SnackDown video here-

The registrations for the online rounds of SnackDown have begun, You can register a team upto 2 or go solo!

To register, go to —

If you are a programming enthusiast who likes to spread the love for coding by spreading awareness about competitive programming, join our SnackDown Representative Program — The objective of the program is to spread the awareness about SnackDown and competitive programming among students and professionals alike across various institutes/organisations.

Read more »

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

By Vovuh, history, 10 days ago, translation, In English,

After the long delay (disease, conference and many other things) the new Div.3 round is coming!



Codeforces Round #515 (Div. 3) will start at Oct/12/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.

Read more »

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

By neal, 10 days ago, In English,

C++ has always had the convenient data structures std::set and std::map, which are tree data structures whose operations take 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

Read more »

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