By MikeMirzayanov, 22 hours ago, translation, In English,


I am pleased to report that two rounds of Codeforces have gone quite well in terms of the work of Codeforces, I am very glad about it. These days nights I spent in a profiler, fixing the code, researching the settings of MariaDB.

In addition, I managed to allocate several hours on Sunday (to be honest, until Monday morning) to finish the long-planned innovation.

Meet, diagnostics of solutions in C++!

Many Codeforces visitors are already tired of the questions of less experienced participants: "Why does my solution not work on some test on the Codeforces servers, if I locally launch it and it works correctly? You have the wrong compiler/servers!" In 99% of cases this is an example of undefined behavior in a program. In other words, the program contains mistakes that, due to a number of circumstances, are not reproduced at local launch, but are reproduced at launch on the Codeforces servers.

Sometimes, it's not easy to notice such a mistake. A small overflow of the array can lead to an incorrect answer on the test and to an runtime error of the program.

In g++/clang++ there is a remarkable tools called sanitizers. It's such a way to compile a program in a special mode so that when it's working, it will check it for undefined behavior (and some other errors) and, if any, print them to stderr. The drmemory (it is similar to valgrind, but for Windows) has similar functionality, which starts the program in a special mode to detect errors. With such two diagnostic launches, the performance of the program suffers tremendously (the program is executed 5-100 times slower and requires more memory), but often it's worth it.

Now automatic diagnostics in some cases will prevent a question like "Why does not work ???", indicating the error or its appearance!

If your solution:

  • written in C++,
  • finishes with a verdict "wrong answer" or "runtime error"
  • on this test worked extremely quickly and consumed a little memory,

then it will be restarted using special diagnostic compilers (clang ++ with sanitizers and g++ with drmemory). If an execution error occurs during this launch, the diagnostics log will be displayed in the test details in the "diagnostics" section. Of course, this entry will contain a technical report in English, but often it will indicate to you the error of the program. Often it contains the cause of the mistake and even the source code line. If the diagnostics are not displayed, then at least one condition above is not fulfilled or the diagnostics has not detected any errors.

Example of the diagnostics:  here it is written that there was an array out of range error in the line 78.

Thus, the diagnostics will sometimes help you to find a mistake like "out of bounds error", "signed numbers overflow", "uninitialized variable", etc. Carefully read the diagnosis and do not make such mistakes in the future!

I wish your programs did not fail. I hope the innovation will be useful!

There are big plans as it is useful to apply such diagnostics. Do not go far, wait for news, soon there will be more innovations!

P.S. Also, diagnostic compilers are simply available for use. For example, you can use them on the "Custom invocation" tab. I recall that the program runs many times slower and consumes more memory in diagnostic mode.

Read more »

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

By Marco.L.Tsien, 2 days ago, In English,

Hello, Codeforces!

I'm quite excited to invite you to participate in Codeforces Round #447 (Div.2 Only) which will be held on November 19 16:55 MSK.

All five problems are created by Zerui Cheng (Marco.L.Tsien), Bingheng Jiang (NOIRP), Yiming Feng (whfym). And it's our first round on Codeforces. We want to show our great thanks to our school The High School Affiliated to Anhui Normal University and our coach Guoping Ye in competitive programming training.

And we also want to show our great appreciation to Mikhail Krivonosov (mike_live), Gleb Lobanov (glebodin), Weihao Zhu (Tommyr7), Shiqing Lyu (cyand1317) for testing the problems, to Nikolay Kalinin (KAN) for coordination and to Mike Mirzayanov (MikeMirzayanov) for the fantastic Codeforces and Polygon platforms. The round can't be realized without their great help.

The contest will consist of 5 problems and you'll be given 2 hours to solve them. As usual, the scoring will be announced shortly before the start of the contest.

The contest is rated for Div. 2 contestants. And the same as before, Div. 1 contestants can take part out of competition.

Wish everyone high rating and bugless code!

See you on the leaderboard!

Clarification: In the mail, it reads that the duration is 2 hours and 30 minutes and it'll contain 6 problems. There's a mistake. The duration of the contest is 2 hours and there will be 5 problems.

UPD1: Scoring: 500-1000-1500-2000-2500

UPD2: The contest is finished! Have fun hacking!

UPD3: The system test is finished! Congrats to the winners!

And do you find something interesting in the statements,especailly for Chinese contestants?

Div.1 & Div.2:

  1. fatice (solved all the problems and got 22 hacks)

  2. safety (solved all the problems and got 10 hacks)

  3. dreamoon

  4. KrK (solved all the problems)

  5. Benq (solved all the problems)


  1. fatice (solved all the problems and got 22 hacks)

  2. safety (solved all the problems and got 10 hacks)

  3. ec24 (made 16 hacks)

  4. daaaaaaaaaaaaaaaaaaa

  5. QYitong1

UPD4: Maybe you're complaining that there're too many hacks and the pretests are so weak,but it's our intention to do so. We regard hacks as a very important part and a feature of Codeforces.Do you agree?

UPD5: Editorial

Maybe B and C are a little harder than before,we'll be cautious about this next time.

Hope you have fun in solving the problems and hacking!

See you next time!

Read more »

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

By NotMoreThanANoob, 5 days ago, In English,

Hi Codeforces!

I'd like to invite you to join Codeforces Round #446 which will be held on November 17 at 17:35 MSK.

And yes it is rated.

The contest is prepared by Omid Azadi (OmidAzadi), Mehrdad Saberi (Sa1378), Arshia Soltani (Ckodser), Aryan Esmailpour (ArEsma) and me (I honestly didn't do anything).

And also thanks to Mahdi Amiri (Amiri), AmirReza PoorAkhavan (Arpa) for helping us, Weihao Zhu (Tommyr7) for testing the round and Nikolay Kalinin (KAN) for round coordination and Mike Mirzayanov (MikeMirzayanov) for awesome platforms Codeforces and Polygon.

You will have 2 hours and 5 problems each division.

Contest theme will be about Seven Deadly Sins but the statements will be short and brief.

The scoring distribution will be posted soon and good luck and stuff.

Update 1 : The scoring for both divisions is 500 — 1000 — 1500 — 2000 — 2500.

Update 2 : The round is over. Hope everybody had fun and enjoyed it. And as you can see the round is rated so yay!

Top 5 Div1 participants :

1.moejy0viiiiiv (The only one who solved all problems)





Top 5 Div2 participants:






The editorial is posted.

Read more »

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

By kuviman, 6 days ago, translation, In English,

Hey everyone!

Good news — Russian AI Cup 2017 has started! This competition is being held for the sixth time, and this time, hopefully, we will make happy all the fans of the RTS game genre — you will be controlling 500 vehicles of 5 different types at once. The task is to destroy the opponent!

Try yourself in creating an artificial intelligence, it's simple and fun. Go to Russian AI Cup site and enter the battle. Good luck!

 Russian AI Cup

Read more »

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

By MikeMirzayanov, 8 days ago, In English,

The contest is declared unrated. For Technocup, results of this round will be counted for elimination. Also, we plan to hold one more (the fourth) elimination round to compensate this failure. Stay tuned for updates. We apologize for the situation, hope you enjoyed the problems.


If you are upset about today round, I understand you. Please, downvote this blog instead of the official announcement. The coordinator, writers and tester did a great job making the round. But technical issues erased their effort.

The chain of technical issues leaded to so bad work of the website. This week our server with Polygon system had broken and Mail.Ru quckly replaced it with another one. I forgot to reconfigure Polygon on the new server and it leaded to 502 during the contest. Also today one Codeforces server stopped to respond and I do not know the reason yet (it is first time issue with this server).

Right now I feel myself very upset and thinking about the way to change an approach to have enough time to setup, monitor and develop the system.

Sorry again about it.

Read more »

  • Vote: I like it  
  • -694
  • Vote: I do not like it  

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

Hi all!

This weekend, at 16:05 UTC on November 12th, 2017 we will hold Codeforces Round 445. It is based on problems of Technocup 2018 Elimination Round 3 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 2018 website and take part in the Elimination Round.

I want to thank MrKaStep, komendart, veschii_nevstrui, bixind, AndreySergunin and DPR-pavlin, who authored and prepared problems for Technocup, and lewin, who kindly suggested the last problem. I also want to thank zemen and AlexFetisov for testing the round.

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

UPD: We apologize that we run into technical issues during the round. The round will be unrated. I hope you liked the problems.

Anyway, congratulations to winners!

Технокубок 2018 - Отборочный Раунд 3

  1. potapov_al
  2. gainullin.ildar
  3. qoo2p5
  4. Vosatorp
  5. manoprenko

Codeforces Round #445 (Div. 1, based on Technocup 2018 Elimination Round 3)

  1. V--o_o--V
  2. Petr
  3. Um_nik
  4. SirShokoladina
  5. LHiC

Codeforces Round #445 (Div. 2, based on Technocup 2018 Elimination Round 3)

  1. mosthenio
  2. Ingugugus
  3. paulsohn
  4. xX_ucfNOTpt_Xx
  5. OmarYasser

Editorial is published.

Read more »

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

By BledDest, history, 12 days ago, In English,

Hello Codeforces!

On November 09, 18:05 MSK Educational Codeforces Round 32 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.

The round will be unrated for all users and will be held on extented ACM ICPC rules. After the end of the contest you will have one day 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 prepared by Mikhail PikMike Piklyaev and me.

Good luck to all participants!

UPD: Editorial.

I also have a message from our partners, Harbour.Space University:

Thank you for taking part in the 2nd Hello Barcelona Programming Bootcamp in collaboration with Moscow Workshops ACM ICPC. It was a pleasure to have you on board. We hope you enjoyed it and we would love to have you back next time.

Congratulations ITMO and Harbour.Space University teams for winning divisions A and B! It was amazing watching the scoreboard throughout all nine days as teams from New South Wales, Saint Petersburg, Tokyo, among many others, challenged the top spots. Watch the recap here!

``Geometry is the key to success in modern contests'' states Andrey Stankevich, coach of 7 ACM-ICPC World Champions

Lecturing both divisions A and B, Andrey brought a vast wealth of knowledge to the boot camp, and shed light on how to better tackle the problem sets that teams will face in their upcoming regional competitions.

“What technology should we use to analyze big data?” asks Alexey Dral, Head of Data Science School at Corporate University of Sberbank

Leisure day was a full one, with bus city tours, to gaming, to lectures and workshops. We had many special guests Sberbank, including Alexey Dral, who talks about the impact of a boot camp that is not only focused on the coding aspect, but the machine learning, the data processing and the practices that each participant can utilise to become an ACM-ICPC competitor to be reckoned with.

Scholarship Information

We are offering a Scholarship for each of our three tech programmes: Data Science, Computer Science and Cyber Securityfill out the Form for the January 2018 programme start period or the September 2018 programme start period. We will contact you soon. Can't wait to see you here!

Go to form

Read more »

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