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

Hello Codeforces!

On April 15, 17:35 MSK will be held Educational Codeforces Round 19.

This Educational Round is held as Harbour.Space university initiative. It's the second round supported by Harbour.Space. You can read the details about the cooperation between Harbour.Space and Codeforces in the blog post.

Some educational programs in Harbour.Space are interesting for most Codeforces users. One of them is Data Science Program. Here is few words from Sergey Nikolenko, Harbour.Space lecturer and Senior Researcher, Steklov Institute of Mathematics at St. Petersburg Russia.

The round will be unrated for all users and it will be held with extented ACM ICPC rules. After that 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 6 problems and 2 hours to solve them. We tried to prepare such problems that both novices and experienced coders will find something interesting in this contest.

The round was prepared by Ivan BledDest Androsov, Mikhail MikeMirzayanov Mirzayanov and me.

Wish you enjoy the contest! Good luck!

UPD: Editorial

Read more »

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

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

Hello Codeforces!

HFT Battle 2017 is going on – the trading algorithms competition, in which every participant can try on an HFT researcher’s hat. The goal is to create a stable and profitable HFT algorithm by researching a market microstructure and a behaviour of the financial instrument. In May we will be hosting another 24-hour competition in code optimization and speeding up based on algorithms created during HFT Battle. We hope that Codeforces users will especially like this format :)

During the competition we provide you a set of real HFT-instruments for research and strategy analysis and real market data from one of the world’s largest exchanges. Same as last year, trading conditions are simplified compared to the real ones: there are lower fees and round-trip.

Also there are some significant differences from the previous competition:

  • You are able to create your strategies both in C++ or Python.
  • We made it possible to participate in teams. To do this you should create a single account for the entire team and provide the information about one of the participants during the registration process.
  • You can call out any other participant for a duel, where your strategies can see and affect each other’s transactions. Let the battle begin!

How to start

To make the strategy development easier, we have prepared the sample strategy and collected few ideas for the algorithm improvement at one place with the corresponding code examples.

We suggest you to start with the brief documentation, which will be enough for you to become familiar with the competition system. Also we have developed the offline development package:

The competition ends on the 30th of April 2017. The final testing will be held after that on a set of 20 new trading sessions.

This year TOP-20 participants will be awarded with valuable prizes. The best competitors will be invited to an interview at AIM Tech and will have an opportunity to join our team.

We will be happy to hear your feedback! You may use “Support” button in the web interface or text directly to You may also join the active discussion of the contest in our Telegram channel!

It is not required to have any specific economical knowledge to create your strategy. Basic C++ or Python skills would be enough. We are confident that most of Codeforces participants will be able to reach excellent results!

We wish you high rating and great results in HFT Battle 2017!

Read more »

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

By fcspartakm, 3 weeks ago, translation, In English,

Hello, Codeforces!

It is time to tell about the improvements in Polygon. It is a system for the preparation of programming problems. All Codeforces rounds and many other olympiads prepared in Polygon. Everyone at any time can use this system.


A special fields with examples now displayed on a page with a list of files which used in problem and on checker, interactor and validator pages. It will be very useful for the new users and will help them faster understand the system.

Read more »

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

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

NAIPC is coming up on April 15 (start time here). More information can be found on the site. The contest will be on Kattis on the 15th. About 15 hours later, it will be available as an open cup round as the Grand Prix of America. Please only participate in one of them, and don't discuss problems here until after the open cup round.

The deadline to register for the contest on Kattis is April 12th. You can register by following instructions on this site: You will need an ICPC account to register.

You can see previous NAIPC rounds here: 2015, 2016. 2016 is also available in the codeforces gym here:

UPD 1: The deadline to register is in a couple of days.

UPD 2: Both contests are now over

NAIPC standings:

Open Cup standings:

I'll update this one more time with solutions once they are up.

UPD 3: Test data is available here (solutions may show up later, but I'm not sure when):

Read more »

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

By zoomswk, 3 weeks ago, In English,

Hi, everyone!

Unfortunately, the round was moved two hours later. Sorry for the inconvenience.

It is my honor to announce that the Codeforces Round #408 rated for the second division is going to take place tomorrow at 16:35 UTC. As usual, participants from the first division will be able to participate out of competition.

As the author of this contest, I (zoomswk) would like to thank poomrokc, nisaruj, and Phoom for testing the problems, KAN and netman for their help in contest preparation, and MikeMirzayanov for the awesome Codeforces and Polygon platforms. Cute graphics in this round are designed by my friend Chonphuech Sripongtanakul, so thanks to her also!

In this round, you will be given 6 problems and 2 hours to solve them. Zane the Wizard, along with his puppy and his crush, will be asking for your help. It is advised that you read all problems and read them carefully.

As per tradition, the scoring distribution will be announced later.

I hope you will enjoy the problems.

Good luck! :D

UPD: The scoring distribution is 500-750-1000-1500-2000-2500.

UPD: The round has ended. Thanks everyone for participating. I'm deeply sorry that the problems turn out to be way harder than I expected. Please stay tuned for the editorial. T_T

UPD: The system testing is complete. Congratulations to the winners!

Div. 2 Winners

  1. Wissenschaft

  2. newcolas

  3. ckw1140

  4. VAVAvile

  5. pantelija

  6. Harmonica

  7. mateuszdanowski

  8. Mohammad_kilani

  9. Al2K

  10. LovelyPLY

Div. 1 Winners

  1. fanache99

  2. HellKitsune

  3. unused

  4. KrK

  5. petrescu

I sincerely apologize that slow input/output methods caused so many TLEs. Unfortunately, it is not possible to rejudge the submissions nor increase the time limit at this point. This is my fault, and I'm terribly sorry. I was not aware of this because my solutions run in < 500 ms of time limit in all problems. I hope you understand.

The editorial will be published in a few minutes, and I'll update this post when it's available.

UPD: The editorial is ready!

Read more »

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

By dalex, 3 weeks ago, translation, In English,

Hello everyone,

Some days ago there was an annual programming contest in Samara University, and yet again we copy it into Codeforces Gyms. The gym contest takes place on Saturday, 8 April, at 9:30 MSK. Site says that there are no intersections with something important that day.

Second time in a row it is a personal contest. So we ask everyone to participate solo. It must be very interesting for yellow and lower guys, and, who knows, maybe for reds too. You can start virtual participation at any time.

And as usual,

Read more »

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

By Zlobober, 4 weeks ago, translation, In English,

We are announcing the annual Yandex.Algorithm 2017 championship! This is a great opportunity to compete with the strongest programmers of the world, win a fancy T-shirt, visit Yandex office or even receive some serious money prize.

Read more »

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

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

Hi all!

Tomorrow, on April 5th 2017, at 15:35 UTC the first Wild-card Round of VK Cup 2017 will be held. Along with it there will be parallel unofficial round in which everyone can take part.

The rounds will use special rules, the rounds will be unrated. The problems were prepared by Codeforces team.

The detailed rules will be added to this post 30 minutes before the rounds. I can say now that there will be 24-hours open hacks phase after the round, like in Codeforces Educational Rounds.

Round rules:

The round will be almost usual contest with ACM ICPC rules. There will be 12 problems for 2 hours. During the round your solutions will be tested on some basic tests, they should be much stronger than usual pretests. After the round you will have 24 hours to find tests against other participants’ solutions, this part is the same as in Educational rounds. After that we will add all succesful hacks and our tests and rejudge all submissions. Then the results will be final.

The main difference between ACM ICPC rules and this round is the following rule.

You should submit each problem in a unique programming language. Different compilers of same language are considered the same language. For example, GNU G++, GNU G++ 11, GNU G++ 14 and MS C++ compilers are C++ language. Thus, you are not only to solve problems, but also try different and new for you languages. We don’t think you know 12 languages, we hope that you will quickly learn some basic syntax.

Formally, the following check is performed when you submit a task:

  • If there is at least one submission in queue or submission that passed at least one test for this problem in another language, your solution will be ignored. Thus, if your program passes at least one test, you can only solve this problem using this language.
  • If there is at least one submission in queue or submission that passed at least one test for another problem in same language, your solution will be ignored. Thus, you can’t use a language for more than one problem.

Remember that you can view filter status of some other round by language and view submissions in a specific language. Also, you can view examples of codes in any of the supported languages on the table below. Also, the table contains the groups of compilers considered the same language.

You can use “custom invocation” tab to run a solution if you don’t have the compiler locally.

Language Group Compilers Examples
C GNU C, GNU C11 10903473, 17029870
C++ GNU C+, GNU C++11, GNU C++14, MS C++ 23794425, 5456501
C# Mono C#, MS C# 3195513, 3794163
D D 5482410, 2060057
Go Go 7114082, 21366098
Haskell Haskell 455333, 1668418
Java Java 8 25491359, 23678167
JavaScript V8 6174887, 5743720
Kotlin Kotlin 25779271, 25204556
OCaml OCaml 6157159, 1281252
Pascal Delphi, FPC 1275798, 1259434
Perl Perl 2519448, 1277556
PHP PHP 413942, 4475965
Python Python 2, Python 3 4432133 (Py2), 15729882 (Py3)
Ruby Ruby 1837970, 1289551
Rust Rust 25180002, 24643411
Scala Scala 22577830, 2456025

The main rules of ACM ICPC contest: each problem can either be completely solved (when all tests are passed), or not solved. The participants are ranked by the number of solved problems, in decreasing order, in case of a tie they are ranked by penalty time. The penalty time is the sum among all problems the time in minutes that had passed between the start of the round and the moment the problem got solved, plus 20 minutes for every rejected submission. Note that the problems are not arranged by difficulty. Also, you can resubmit a solution even if it passed all tests, because there will be more tests after the open hacks.

Good luck!

Open hacks phase has ended, the solutions are rejudged. Congratulations to winners!

Official round:

  1. I_love_2007, Ed_Os
  2. VernitaGreen, svxf
  3. gars, Provet
  4. Me-and-Myself, zetilovn
  5. svetlana_lana, GoldenMan

Open mirror:

  1. lewin
  2. Bugman
  3. uwi
  4. ifsmirnov
  5. Tinsane

Read more »

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

By RussianCodeCup, 4 weeks ago, translation, In English,

Hi, everyone!

This Sunday, April, 2 at 19-00 Moscow time the First Qualification Round of Russian Code Cup 2017 will take place. 200 top participants will qualify for the Elimination Round, those who wouldn't qualify can still take part in two following qualification rounds.

We have a news for you: we have added Kotlin, Haskell and Free Pascal to our list of programming languages, also you can now submit your Python programs to run in PyPy. Exact versions of compilers and compilation commands are published at the official web site. We are working on adding more programming languages.

Good luck to everyone and see you at!

UPD Editorial is published

Read more »

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