By ArtDitel, history, 6 days ago, In English,

Hi all, we participated in challenge24 as aimfund team (zeliboba, artditel,Zhukov_Dmitry), took 6th place and here is my writeup. We really love challenge24 and 24-hour format, thank you guys for making it, and we are waiting for the next year. But I should say that writeup will be mostly negative because of overall impression.

UPD Psyho's 1st place writeup with solutions:

Read more »

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

By fcspartakm, history, 8 days ago, translation, In English,

Hello, Codeforces!

Previously, my contribution to the development of Codeforces was limited only by rounds preparation (Codeforces Round #288 (Div. 2), Codeforces Round #293 (Div. 2), Codeforces Round #297 (Div. 2)). But a month ago, I joined the wonderful Codeforces team led by Mike Mirzayanov (MikeMirzayanov). Traditionally, to understand all the niceties of this project, my work begun from Polygon system. I would like to tell you about its changes.

Polygon 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.

To edit the files in Polygon now used Ace Editor. It has a nice looking syntax highlighting and autocompletion (you have to press Ctrl + Space). Soon planned to implement this editor in Codeforces.

Read more »

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

By fcspartakm, 8 days ago, translation, In English,

Hello, Codeforces!

I'd like to invite you to Codeforces Round #311 (Div. 2). It'll be held on Tuesday, June 30 at 18:00 MSK and as usual Div. 1 participants can join out of competition. Note that round starts in the unusual time!

Great thanks to Maxim Akhmedov (Zlobober) for helping me preparing the contest, to Maria Belova (Delinur) for translating the statements into English, to Mike Mirzayanov (MikeMirzayanov) for the great Polygon platform and ideas of some problems and to my friends Ilya Los (IlyaLos) and Danil Sagunov (dans) for writing solutions.

The scoring distribution will be announced later. Good luck everyone!

UPD The scoring distribution will be standard today 500-1000-1500-2000-2500.

UPD2 Competition completed! Thank you all!

UPD3 You can find editorial here.

Read more »

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

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

Hello, Codeforces.

Soon, on 27 june at 17:00 MSK regular, 310-th Codeforces round will take place. Problems have been prepared by me, Andrey Sergunin, and Egor Shcherbin (Lord_F).

We want to thank Max Akhmedov (Zlobober) for helping us preparing the contest, Maria Belova (Delinur) for translating statements in English and Mike Mirzayanov (MikeMirzayanov) for great Codeforces and Polygon systems.

Participants will be given five problems and two hours to solve them. Scoring will be announced later.

Good luck everyone!

This round will use the dynamic scoring.

UPD: Due to technical reasons round is delayed by 10 minutes.

UPD: The preliminary version of an editorial was posted.

UPD: Congratulation to the winners:

Div 1

  1. qwerty787788

  2. Petr

  3. Haghani

  4. KADR

  5. zxqfl

Div 2

  1. onufryw

  2. munaiyi

  3. aitch

  4. Chenyao

  5. mhadih

Read more »

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

By lewin, 13 days ago, In English,

Hello Codeforces!

I invite all of you to participate in regular Codeforces round #309 that will take place on 24 June, 19:30 MSK.

Some of you may know me as lg5293 on Topcoder (you can see some of my past problems here), but this is my first time ever writing a Codeforces round. I've designed all the problems myself and I hope you enjoy them.

I want to thank ctunoku for helping me come up with stories for the problems, Zlobober for his immense help with preparation for this round, winger for testing the problems, Delinur for translating statements, and of course MikeMirzayanov for the superb Codeforces and Polygon systems.

I hope to see you all at the round. Good luck and have fun! :)

UPD: Scoring will be dynamic. Problems will be arranged by what I think is increasing difficulty.

UPD: Editorial is here. Congratulations to the top 5:

Div 1:

  1. ecnerwal

  2. scott_wu

  3. enot.1.10

  4. KADR

  5. yeputons


  1. Elsa_Elsa

  2. Chenyao

  3. NightWare

  4. Shayan_Cheshmjahan

  5. M_H_M

Read more »

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

By I_love_natalia, history, 3 weeks ago, translation, In English,

On April 4th, V (XVI) Volga Region Open Team Student Programming Contest was held in Samara State University. And now, we invite everyone who haven't already participated in the championship to join the Codeforces training contest version on June 21st (11:00 — 16:00 MSK, UTC+3). We believe that participants of any level will find problems that will be interesting for them. The contest will probably be mostly interesting to participants with violet and orange levels (difficulty is 4 stars).

This contest uses ACM ICPC rules.

Please, do not use the Internet, prewritten code and other sources: participants of the championship could not use any of these.

Contest was prepared by Dmitry Matov (Nerevar), Constantine Drozdov (I_love_natalia), Andrew Antipov (Sinner), Andrey Gaidel (Shlakoblock), Elena Rogacheva (elena), Sergei Shteiner (steiner), Alexander Efimov; Igor Baryshnikov (master_j) was of great help in English translation.

Read more »

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

By Wild_Hamster, history, 3 weeks ago, translation, In English,

Greetings to the Codeforces community!

Regular Codeforces round #308 for participants from the second division will take place on 18 June, 19:30 MSK. Participants from the first division are able to participate out of the contest.

It is my second round on Codeforces(First round — Codeforces Round #280 (Div. 2)). Hope you will enjoy this round.

I want to thank Max Akhmedov (Zlobober) for help with preparation of this round, Maria Belova (Delinur) for translation of statements and Mike Mirzayanov (MikeMirzayanov) for great Codeforces and Polygon systems.

Participants will be given five problems and two hours to solve these problems.

UPD: Scoring is standard: 500-1000-1500-2000-2500.

UPD: Congratulation to the winners:

  1. Ttocs45

  2. RNS_jgm

  3. RNS_mhm

  4. kouekosita

  5. grenade

UPD: Contest is over. Thanks for participating :)

UPD: Editorial

Read more »

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

By allllekssssa, history, 4 weeks ago, In English,

Hello Codeforces community !

I am glad to announce Codeforces Round 307 (Div. 2) on 12th of June at 19:30 MSK. Authors of this contest are Nikola Mandic (nikola12345) and Aleksa Plavsic (allllekssssa). This is our first round and we really tried to make interesting and solvable problems. Traditionally Div.1 participants can take part out of the competition ( personally I believe that the problems are worth to Div 1 participants, and nobody can solve everything in 20 minutes ). This is the first Serbian round and we want to invite our friends from Serbia to take part in this round and maybe prepare some of next rounds.

The main character of this round is gonna be GukiZ ( our proffesor of computer science ). He really helps us to become better people and developers !

We want to thank Zlobober for help in preparing contest and great advices, Delinur for translating problems statements into Russian and MikeMirzayanov for fantastic Codeforces and Polygon platform !

We wish you great fun, a lot of Successful hacks, Accepted solutions and high rating !

UPD: Scoring distribution: 500 — 1250 — 1750 — 2000 — 2500.

UPD2: Due to technical reasons round was delayed by 10 minutes. Stay tuned!

UPD3: +5 minutes. Thanks for your patience!

UPD4: System testing is complete, but the rating update won't be that fast since we are working on improving our cheater catching system. Thanks for your understanding!

Congratulations to winners!

DIV 1:





DIV 2:





Thanks to all participants. We hope you have a good time and learn something new.

UPD5: Link of editorial !

Read more »

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

By I_love_Hoang_Yen, history, 4 weeks ago, In English,

If you have written some programming problems, and have prepared test cases, you will probably experience the terrible feeling that some test cases may be invalid (meaning it does not agree with the constraints in problem statement): upper bound can be violated, your graph not satisfied connectivity requirements or is not at tree... It is reasonable to feel that way. Even experienced problem setters make mistakes sometimes (for example, in the prestigious ACM ICPC World final 2007).

It is strictly recommended to write a special program (called validator) to formally check each test to satisfy all requirements from problem statements. Validators are strictly required for problems on Codeforces. Polygon has built-in support of validators.

It is really easy to write a validator using testlib.h.


Following is the validator was written for the problem 100541A - Stock Market:

#include "testlib.h"

int main() {
    int testCount = inf.readInt(1, 10, "testCount");
    for (int i = 0; i < testCount; i++) {
        int n = inf.readInt(1, 100, "n");
        inf.readInt(1, 1000000, "w");

        for(int i = 0; i < n; ++i) {
            inf.readInt(1, 1000, "p_i");
            if (i < n-1)


The wonderful thing about this validator is that it is very simple and it is very difficult to write something incorrect.

More examples can be found at the Github repo

Available methods

The first line of your code should be registerValidation() which does some magic in the background, so that you can use the necessary methods.

Read more »

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