antontrygubO_o's blog

By antontrygubO_o, 3 days ago, In English

We invite you to participate in CodeChef’s May Lunchtime, this Sunday, 15th May, rated for all.

Time: 8:00 PM — 11:00 PM IST

Joining me on the problem setting panel are:

Also, announcing Scholarship for CodeChef Certification in Data Structure & Algorithms — More than 100 Indian participants in Divisions 1, 2, and 3 will win scholarships for the CodeChef Certification exam (discounted prices). Scholarship criteria can be found on the respective contest pages.

The video editorials of the problems will be available on our YouTube channel as soon as the contest ends. Subscribe to get notifications about our new editorials.

Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Hope to see you participating. Good Luck!

Read more »

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

By antontrygubO_o, 3 weeks ago, In English

We invite you to participate in CodeChef’s May Cook-Off, this Sunday, 1st May, Rated for All.

Time: 8:00 PM — 11:00 PM IST

Note that from this month, Cook-Off and Lunchtimes will be held on Sundays instead of on Saturdays.

Joining me on the problem setting panel are:

A couple of extra words about the contest:

  • All Div-1 problems have been set by me.

  • The contest is harder than usually, so the duration is changed to 3 hours instead of 2.5 hours

  • I hope everyone will enjoy the contest!

Also, announcing Scholarship for CodeChef Certification in Data Structure & Algorithms — More than 100 Indian participants in Divisions 1, 2, and 3 will win scholarships for the CodeChef Certification exam (discounted prices). Scholarship criteria can be found on the respective contest pages.

The video editorials of the problems will be available on our YouTube channel as soon as the contest ends. Subscribe to get notifications about our new editorials.

Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Hope to see you participating.

Good Luck!

Read more »

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

By antontrygubO_o, 3 months ago, In English

I know that a lot of people here care about the war in Ukraine. If you are looking for ways to help, please, visit this link: Any support matters, any help matters.

Please, help to stop the bloody dictator of our neighbor.

UPD1: Another very good site

UPD2: With this website you can help to show Russians what's really going on in Ukraine. Props to this post.

UPD3: If your CF profile had country set to Ukraine at the moment of this post, and you haven't created Crowdforces account yet, you can do it by this link:, and receive 12 Near (which is around 100$ now).

You can find detailed instructions here. This document is available only in Ukrainian for now. Please, use this money for the maximum benefit.

Read more »

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

By antontrygubO_o, 4 months ago, In English

We invite you to participate in CodeChef’s January Lunchtime, this Saturday; 29th January from 8:00 PM — 11:00PM IST.

The contest will be 3 hours long. There will be 5 problems in Div 1/2 and 6 problems in Div 3. It will be rated for all three Divisions.

Joining us on the problem setting panel are:

The video editorials of the problems will be available on our YouTube channel as soon as the contest ends. Subscribe to get notifications about our new editorials.

Problem Submission: If you have original problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.


  • The top 10 Global Division 1 users will get $100 each.
  • The top 100 Indian Division 1 will get Amazon Vouchers worth Rs. 1500 each.

Good luck and have fun!

P.S. I think that problems are interesting, I encourage everyone to try them!

Read more »

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

By antontrygubO_o, 4 months ago, translation, In English

It’s finally time for one of the biggest events in the competitive programming world. The SnackDown ‘21 Grand Finale is here.

The entire Grand Finale event is scheduled to be completed in two days — January 8 (Saturday), and January 9 (Sunday).

For the Finalists

All the information has been shared over email, but summarising — The Grand Finale will be spread over two days and will be a closed event accessible only to the finalists, and a few invited guests. The SnackDown 2021 Final contest will be held on Jan 9th between 6:30 — 10:30 PM (IST).

For the last time for this SnackDown, meet the panelists!

For the Community

For those who would like to have a taste of the SnackDown Final problems, we also have the SnackDown Final Parallel Unrated Contest scheduled for January 9, 2022, 6:30 PM — 10:30 PM (IST). The problems will be the same as the Finale. Since the main Finals will be a restricted session, the rank list can be viewed here. Note that the rank list will be frozen for the last hour, and will be resolved in the post-contest ceremony on YouTube.

The Grand Finale Closing & Crowning Ceremony

The SnackDown ‘21 Finale closing ceremony will start on Jan 9th at 10.30 PM IST. It will be hosted by Kamil Debowski and Ashish Gupta, who will be analyzing the contest problems and the strategies and performances of the participants. This is also where you can witness the moment of truth, the SnackDown ‘21 Grand Finale winner announcement! Everyone is cordially invited to the event, and we request you to set your reminders here.

Read more »

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

By antontrygubO_o, 5 months ago, In English

As the last big contest of 2021 is over, I think it's time.

It seems that there were just more and more ad-hocs/"deeply analyze some complicated process" everywhere... But maybe you still liked something.

So, what were your favorite problems in 2021?

Read more »

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

By antontrygubO_o, 5 months ago, In English

We are very glad to invite you to participate in SnackDown Elimination round! It will be rated for all participants.

60 participants will qualify for the finals from the Elimination round. They include:

  • The top 25 participants from the Elimination round.

  • Additional top 2 school participants

  • Additional top 2 female participants

  • Additional 31 Indian participants, including:
    • 10 top Indian participants

    • The next 15 Indian participants from the Elimination Round qualify provided they solve at least 2 problems.

    • 3 top Indian School participants

    • 3 top Indian Female participants

Those, who haven't advanced, are invited to participate in the Parallel rounds, which will be held for all divisions. All three rounds are rated too.

Time: 7:30 PM — 10:30 PM IST

Please note that the duration was initially written as 5 hours by mistake, it will actually be 3 hours. The Finals duration will also be less than 5 hours.

Joining us on the problem setting panel are:

Users who have qualified to participate in the SnackDown Elimination should not participate in the Parallel rounds.

The Div-1 Parallel round and the Elimination ranklists will be merged to determine the winners of the cash/Amazon voucher prizes.

If you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Hope to see you participating. Good luck and have fun!

Read more »

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

By antontrygubO_o, 6 months ago, In English


Hi everyone!

2021 Southeastern Europe Regional Contest took place on November 21. Here you can view the full standings.

Congratulations to the winners of the contest!

Place Team Name Contestant 1 Contestant 2 Contestant 3 Problems Penalty
1 [Taras Shevchenko National University of Kyiv] KNU_0_GB_RAM KostasKostil VladProg kostia244 13 1788
2 [Kharkiv National University of Radio Electronics] KhNURE_Energy is not over BigBag Barichek Mustang98 12 1274
3 [Lviv National University] LNU Bulldogs mshcherba Vasyl_Protsiv PetroTarnavskyi 11 1429
4 [Faculty of Computer Science, Belgrade] GII Klub milisav Pajaraja MladenP 11 1433
5 [V.N. Karazin Kharkiv National University] KhNU_OtVinta kilt_01 Stroustrup 13022001 11 1444
6 [University of Bucharest] Unibuc Scrambled Eggs Rpd-Strike theodor.moroianu livlivi 11 1527
7 [Taras Shevchenko National University of Kyiv] KNU_Duplee Sonechko danya.smelskiy stanislav.bezkorovainyi 11 1608
8 [University of Bucharest] EchipaDulce Usu Stelutzu alexandra_udristoiu 10 1350
9 [Kharkiv National University of Radio Electronics] KhNURE_Lacrimosa kupriyanov dendi239 viskonsin 9 1068
10 [Babes-Bolyai University] UBB_Zalau00 Bodo georgerapeanu AlexPop28 9 1183

There will be a Grand Prix of Southeastern Europe based on these problems this Sunday, November 28, 08:00 UTC. Here is the link to the OpenCup.

This year, the sets of SEERC and OpenCup are a bit different: OpenCup won't include a few easier problems from SEERC and will additionally include several harder problems. In addition, problems are shuffled, so don't follow the standings of the official contest too much.

The authors of the OpenCup set are eudanip, Um_nik, bicsi, RomaWhite, Andrei1998, and me, antontrygubO_o. After the contest, the editorials to both versions of the contest will be published, and both versions of the contest will be uploaded to the gym.

We hope that you will enjoy the contest!



Both contests are uploaded to Gym:

Read more »

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

By antontrygubO_o, 7 months ago, In English

I am glad to invite you to AtCoder Grand Contest 055. This contest counts for GP30 scores.

The point values will be 400700900120015001800

I would like to thank:

Problem statements will be short again, and I really hope that you will like the problems. However, I have to warn you that contest will be closer to ABC than to AGC...

We are looking forward to your participation!

UPD1: Thanks for your participation!

The winners are:

1. ksun48

2. tourist

3. djq_cpp

4. hos.lyric

5. MiracleFaFa

Special congratulations to gnomina007 , the only person to solve F.

Sadly, nobody got E in the contest time, though a few people were close. I encourage you to try it, or to read editorial, I think that it's the best problem I ever invented.

I hope you enjoyed the contest!

Read more »

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

By antontrygubO_o, 7 months ago, translation, In English

We invite you to participate in CodeChef’s October Cookoff, this Sunday; 24th October from 9:30 PM — 12:00AM IST.

The contest will be 2.5 hours long. There will be 7 problems in Div 1/2 and 8 problems in Div 3. It will be rated for all three Divisions.

Joining us on the problem setting panel are:

Video Editorialists and Translators will be added a bit later

Problem Submission: If you have original problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.


Global Rank List:

  • Top 10 global Division One users will get $100 each.
  • Non-Indians will receive the prize via money transfer to their account.
  • Indian users will receive Amazon vouchers for the amount converted in INR.

Indian Rank List:

  • Top ten Indian Division One coders will get Amazon Vouchers worth Rs. 3750 each.
  • The rest in the top 100 will get Amazon Vouchers worth Rs. 1500 each.
  • First-time winners in Div 2 who make it to the top 200 for the first time will get Amazon Vouchers worth Rs. 750 each.
  • First-time winners in Div 3 players who make it to the top 200 for the first time will get Amazon Vouchers worth Rs. 750 each.

The video editorials of the problems will be available on our YouTube channel as soon as the contest ends. Subscribe to get notifications about our new editorials.

Good luck and have fun!

P.S. Seriously, try it, I think problems are interesting :P

UPD1: Sorry for confusion, the duration is 2.5 hours.

Read more »

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

By antontrygubO_o, 8 months ago, translation, In English

This summer, me and mhq held a contest in Petrozavodsk Programming Camp. $$$1$$$ problem was provided by gepardo, and we are very thankful for that, and other problems were created by us, mhq and antontrygubO_o. This contest will be held as an OpenCup contest on September 19, 11:00 UTC+3.

I and mhq are friends for long time, since our years of participation at IMO, and it's mhq who introduced me to competitive programming. Therefore, we decided to call this contest GP of IMO.

Link (OpenCup login needed to participate)

I will publish the editorial here soon after the contest ends.

Good luck and have fun!

UPD1: Shame on me, I forgot to thank testers of this contest: gamegame, Geothermal, nitrousoxide.

UPD2: Editorial

Read more »

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

By antontrygubO_o, 9 months ago, In English

//This is a short post motivated by the comment section of the last Div2 round (and of several rounds before)

Every problemsetter tries to make his contest as good as possible, and is upset when something goes wrong. Most problemsetters don't set contests for money, the payments are not worth the time and efforts spent on coming up with problems, preparing them, and hosting the contest. The most rewarding thing in this process in not the money, it's to see contestants enjoying your problems.

That's why feedback is so important. If the comment section is filled with comments praising the contest, setter will most likely want to come back with another contest, and if it's filled with hate and offenses, it's possible that setter will just give up on problemsetting and won't want to host another round.

This means two things.

First, if you liked the round, or some particular problem, why not to write a comment about it? I am sure that most setters would really appreciate it, and feel more motivated to come up with problems like the one you liked. Positive comments from high rated contestants, or from experienced problemsetters matter especially, but I rarely see positive comments from such users.

Secondly, we should try to avoid hateful comments, or unconstructive criticism. This doesn't mean that there shouldn't be any criticism, it is necessary to help setters to improve, but not all criticism is good. Below I will give several comments, which, in my opinion, aren't the best way to express your opinion about the contests. I won't mentioning authors of these comments, as I don't want to call anyone out, and I myself sometimes left not very cool comments.

What's the point of leaving such comments? How will this help setters to improve in problemsetting? These comments are not even telling what's exactly is wrong with the contest — it's just hate and a complete lack of respect to the setters (though I would consider Codechef comment as a compliment).

This is another type of comments — just saying that some particular problem was bad/shitty. However, this isn't much better, as this still doesn't help setter to improve much, it just discourages him from writing any problems in the future. If you are criticizing some problem, tell what exactly was wrong about it: was it well-known, standard, was it too caseworky, or too implementation heavy, maybe the constraints were too strict?

Again, I am not saying that criticism of contests in comments is bad. Here are some good examples (in my opinion).

They aren't disrespectful to the setters, and the authors of these comments are saying what exactly they didn't like about the contest, so that setter can avoid such mistakes in the future.

People may have different opinions about what's a good problem, or what makes a contest good, and setters won't always take all the criticizing comments into account when hosting their next round, but the feedback is still very important for improvement. So, when you leave negative comments, please try to not use them as an opportunity to call the author a stupid moron. It's better to tell what exactly went wrong, politely and respectfully, without any hate. There aren't that many problemsetters out there, so instead of telling people to stop writing problems, it's better to support them.


Read more »

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

By antontrygubO_o, 12 months ago, In English


Hi everyone,

I am happy to announce that the 2020 Southeastern Europe Regional Contest will take place on May 23 at 10 am UTC+3. The link to the live results will be published here after the start of the competition.

Moreover, later this day, at 4 pm UTC+3, there will be the Grand Prix of Southeastern Europe based on these problems. Because of the Grand Prix, we are asking the official contestants not to discuss the problems in public.

After it, we will upload the contest to the gym and publish the editorial. We hope that you will enjoy the contest.

Good luck to all participants!

UPD. SEERC standings

UPD2. Congratulations to the winners!

Place Team Name Contestant 1 Contestant 2 Contestant 3 Problems Penalty
1 KhNU_OtVinta kilt_01 Stroustrup 13022001 8 1043
2 RAF Penguins Pajaraja milisav allllekssssa 8 1128
3 Echipa Dulce alexandra_udristoiu Stelutzu Usu 7 736
4 UAIC Endgame lungualex00 cristian1997 denis2111 7 837
5 KNU_stascool5 danya.smelskiy Sonechko stanislav.bezkorovainyi 7 1029
6 KhNU_GangBand dendi239 viskonsin Eikgrim 7 1230
7 cpu_goes_brrr muratt ykaya ekrem 7 1239
8 KhNURE_Energy is not over BigBag Barichek Mustang98 6 426
9 CodeBusters LucaSeri Hikori robxln 6 647
10 LNU Jackals BohdanPastuschak PetroTarnavskyi mshcherba 6 655

UPD3. Editorial

Thanks for your participation!

UPD4. The contest is available in gym:

2020-2021 ICPC Southeastern European Regional Programming Contest (SEERC 2020).

Read more »

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

By antontrygubO_o, 14 months ago, In English

I am glad to invite you to AtCoder Grand Contest 052. This contest counts for GP30 scores.

I would like to thank:

Statements are very short, and I really hope you will like the problems.

We are looking forward to your participation!

UPD 1: The point values will be 400-800-1000-1000-1500-2000, and the duration is decided to be 160 minutes

UPD 2: Congratulations to the winners!

  1. ksun48
  2. mnbvmar
  3. tourist
  4. Benq
  5. Radewoosh

Thanks for your participation :P

Read more »

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

By antontrygubO_o, history, 17 months ago, In English

As Morphy hasn't posted this yet, and as the last big contest of 2020 is over, I think it's time.

2020 was a hard year for all of us, but it still gave us a lot of great contests and, luckily, no notorious coincidences. So, what were your favorite problems in 2020?

Read more »

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

By antontrygubO_o, 20 months ago, In English

We invite you to participate in CodeChef’s September Lunchtime, this Saturday, 26th September, from 2000 hrs to 2300 hrs IST.

Please Note — Unusual starting time. The Contest will begin at 2000 hrs instead of 1930hrs

The contest will feature 5 problems for 3 hours. I am author of all problems. I hope you will like them.

Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Joining me on the problem setting panel are:

  • Tester: Alexander scanhex Morozov
  • Statement Verifier: Jakub Xellos Safin
  • Editorialist: Colin galen_colin Galen
  • Admin: Ildar 300iq Gainullin
  • Mandarin Translator: Gedi gediiiiiii Zheng
  • Vietnamese Translator: Team VNOI
  • Russian Translator: Fedor Mediocrity Korobeinikov
  • Bengali Translator: Mohammad solaimanope Solaiman
  • Hindi Translator: Akash Shrivastava

Prizes: The top 10 Indian and top 10 Global school students from ranklist will receive certificates and CodeChef laddus, with which they can claim cool CodeChef goodies. Know more here.

Good luck and have fun!

Read more »

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

By antontrygubO_o, 22 months ago, In English

Hello everyone!

I finally decided to write some response/explain my view after all recent discussions of my problems and rounds I coordinate, and I would like to make a few points.

1. After some recent contests there were a lot of comments saying that Data structure problems should appear as easy problems (say, D2A-D2D in a Div2 of $$$6$$$ problems)

I don't think I agree with this. To begin with, I don't think that having Data Structure problem is a requirement for a good contest at all, not just in first few positions.

However, for positions D2A-D2D, I just don't see a way to properly include data structure problems. Take some Data Structure problem, it consists from two parts:

  • Knowing/implementing the Data Structure
  • Actually thinking about the problem, and how this Data Structure should be applied

The problem is, that even the simplest Data Structure (say, Segment Tree), makes the first part already at least D2D difficulty in a Div2 of $$$6$$$ problems. Now, if the second part is completely trivial, then the problem shouldn't be used in official CF contest (maybe in Educational Round only): implementation part can't be much harder than thinking part. If the second part isn't trivial, the problem can't be less than D2E. Therefore, I can't really see how can Data Structure problem appear on positions D2A-D2D.

Remark: Here I don't even count sets/maps as Data Structures.

2. A lot of people lately are sad because graphs, dp and all other topics don't appear now. Only constructives and ad hocs are left!

To begin with, this is not true. All topics appear! I went through last $$$3$$$ Div2 contests I coordinated. Among them:

1372E - Омкар и последний этаж and 1363F - Вращение подстрок are DP.

1364D - Последнее следствие Ехаба, 1363C - Игра на листьях and 1363E - Перестановка дерева are graph problems.

1363D - Найдите максимумы is binary search problem.

However, it's somewhat true that easier problems are more often not related to these concepts. From my perspective, the reason for this is similar to the reason I provided in argument above: it's impossible hard to create an interesting DP/Binary Search/Graph problem which could fit positions D2A-D2C. Just because that concepts themselves are already quite challenging.

And I don't want to accept standard problems on DP/Binary Search/Graphs just to make the set more diverse or because you want it, and won't do so, I think.

3. While I understand that many people really like these topics and want them to appear as early problems, I believe that a lot of this feedback is coming from participants who learned some new algorithms/techniques and are sad when they don't become red they don't see these problems in contests.

Well, from my perspective, CP isn't about knowing algorithms, it's more about solving problems. Algorithms are tools. Knowing many algorithms means that you have a lot of tools, but if you don't know how to apply them, this won't help. That's why you should learn how to solve problems, not just learn algorithms.

4. Some people think that contests by me/coordinated by me aren't diverse enough, and contain too many constructive problems.

And well, I agree with this. I also believe that having too many constructive problems is not a good thing for a contest. From this perspective, Codeforces Global Round 9 wasn't very good. I also believe that the problemsets should be more diverse. However, when choosing between having less diverse problemset and accepting fairly standard problem, I will always prefer first.

Still, this is a valid objection. I will try to make problemsets more diverse :)

5. Some people think that I just won't accept Data Structure/Flow/Some string structures/Anything except ad hoc.

This is a very wrong point of view. I will accept problems in which idea is interesting enough. The problem is: it's much harder to create a problem on these topics which would at the same time be interesting than creating a good ad hoc problem. It seems that CP has evolved significantly in recent few years, and some things which weren't standard $$$4$$$ years ago, are very standard now. So yes, the reason why good nonstandard problems on these topics appear less now, is that there aren't many of them in proposals! However, still, expect to see some problems on these topics in future contests :D

6. While I understand people who say that it's sad when algorithms don't appear in contests, I don't think I understand people who get joy from struggling with implementing some problems. I am not against problems with quite long implementation, as long as implementation difficulty is smaller than the thinking difficulty. My opinion is best expressed here:

7. I would like to thank:

  • People who provide objective criticism
  • People who support my position
  • MikeMirzayanov for great systems Codeforces and Polygon

Read more »

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

By antontrygubO_o, 2 years ago, In English

Disclaimer: as always, everything in this blog is just my opinion.

Some problemsetters don't take easy problems seriously. One very popular opinion is that the D2A-B problems are just stupid implementation exercises intended for beginners to learn how to code.

It's true that D2A-B problems are mostly like this on most platforms. This is one of the reasons why a lot of people don't like combined rounds: they think that solving D2A-B problems can't be interesting and just takes time which could be spent on solving fascinating problems of higher level. From point of view of most participants, easy problems just can't be good, because if problem requires some thinking than it's not easy enough for D2A-B level. Easy problems can't be interesting, they say!

This situation really upsets me. This kind of attitude from the community leads a lot of problemsetters to care about easy problems even less. At the same time, I am sure that easy problems can and should have nice ideas in them. Yes, even D2A-B level problems can need some observation/insight!

I will start with some examples of D2B level problems which I consider really nice. I recommend trying them! Some comments are under spoilers.

1325B - КопияКопияКопияКопияКопия


1300B - Разделение на классы


1270B - Интересный подмассив


A few more nice D2Bs where you have to think a bit:

1305B - Курони и простые строки

1189B - Числа на окружности

1091B - Новый год и местоположение сокровища

You may be surprised, but even D2As can have nice ideas in them! Here are some examples:

1326A - Плохие некрасивые числа


1305A - Курони и подарки


1269A - Уравнение


556A - Дело о нулях и единицах


1174A - Ихаб не может стать Таносом


Here are a few more nice D2A problems:

1325A - ЕхАб И нОд

1237A - Сбалансированные изменения рейтинга

1206A - Выберите два числа

1189A - Киану Ривз

1119A - Илья и красочная прогулка

I hope you found these problems nice. All of them require at least some insight/observation, and they are still easy enough for beginners and for D2A level. All of them have quite a short and clear statement, and you don't have to waste a few minutes understanding the problem's statement.

However, first problems in rounds aren't usually like this. Very often the first problems are just: Do what's written in the statement, or Bruteforce all possibilities to find the answer. Majority of D2A-Bs don't have any idea at all. Here are some "best" examples:

1281A - Suffix Three

1228A - Различные цифры

1200A - Отельер

1186A - Казак Вус и контест

1097A - Геннадий и карточная игра

At this point a lot of readers may disagree with me. Some people may say:

Yes, these problems aren't interesting for you, but if there isn't any idea in these problems from your perspective, it doesn't mean it's the case for beginners. For them even these problems are tough and interesting enough. Implementation problems also can exist, and they are useful to learn how to code for beginners. After all, this is not a thinking contest, this is a programming contest!

And they would be right to some extent. However,

  • Codeforces is not a platform where you learn how to code. There are a lot of much better places to learn programming language syntax, and we are here to solve problems, not to learn how to code.

  • The first problems aren't only for beginners. All participants of the round solve these problems, and it's sad when from the very beginning of the round you are bored by the first problems, which turned out to be statement comprehension + implementation exercise. I am often upset when the first problems are such exercises, and get much more excited about the round as a whole and further problems if D2A-B are nice.

  • I think that the best way to make someone love CP is to show nice, cute, beautiful problems. Too standard/boring first problems may destroy wish to proceed in CP in beginners.

After all, the first problems are the ones that the largest number of participants will try to solve, and half of the participants won't even get past D2B. How can we not care about D2A and D2B then?

Yes, setting nice D2A and D2B which require some ideas and are still easy enough is hard. Really hard. But setting good problems is hard in general. If you decided to spend some time to make a good round you should spend some time and try to make all problems good. I believe that D2A and D2B level problems shouldn't be created like this:

I have to note that the situation now is much better than it was a few years ago, and that the quality of all problems, even of D2A-B has improved a lot since then. But I still hope that after reading this blog some of you will spend more time thinking on D2A-D2B problems before submitting contest proposal on CF :P From my side as a coordinator, I try to not let boring problems get into CF rounds, and I hope to become better at this in the future.

What are your thoughts? Should authors spend more time coming up with nice easy problems, or is it just a waste of time?

Read more »

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

By antontrygubO_o, 2 years ago, In English

Hello Codeforces!


We are glad to invite you to the upcoming “Ozon Tech Challenge 2020”, which will start at Mar/03/2020 17:35 (Moscow time). The round will be open and rated for everybody!

This round is initiated and supported by Ozon.

Ozon — one of the leading players in e-commerce (provides its customers with over 2.5 million product names in 24 categories), a tech company that actively developing its IT department. They already have the largest Golang team in Russia, a proprietary WMS fulfillment management system completely written by the Ozon team, 250 million lines of logs per day, collected on the site and in the Ozon mobile application. Ozon experts perform at the leading profile conferences GoperCon, Heisenbug, GoWayFest, GolangConf, and also at the company site meetups are held for the IT community.

The company shows great interest in the support of the developer community — for schoolchildren there is Ozon Academy, for the older audience there is an internship program Ozon Tech Camp and training program Ozon Masters.

Participants will be asked to solve 8 problems in 2 hours 15 minutes. Scoring will be announced a bit later.

The problems were created by AkiLotus, Sexpert, Kuroni, zscoder, xuanquang1999, and antontrygubO_o

We would like to thank:

Thanks to Ozon for the gifts to the participants:

  • top 10 participants will receive stylish branded backpacks and branded T-shirts;
  • 11-20th participants will receive compact portable chargers for 10000 mAh and branded T-shirts;
  • 21-60th participants will get branded t-shirts;
  • another 30 T-shirts will be played among the rest of the participants, who solved at least two problems, randomly.

We hope everyone will find an interesting problem for themselves. Wish everyone a successful round and high ratings! Good luck!


Score distribution:

500 — 1000 — 1250 — 1750 — 2000 — 2500 — 3250 — 4000

UPD2: Editorial

UPD3: Congratulation to the winners!

  1. tourist
  2. maroonrk
  3. greenheadstrange
  4. ksun48
  5. Endagorion
  6. Benq
  7. gisp_zjz
  8. neal
  9. Um_nik
  10. yasugongshang

Information about prizes will appear soon.

Read more »

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

By antontrygubO_o, history, 2 years ago, In English

Previous part

Hi there again! Previous part with opinions of some amazing problemsetters turned out to be interesting for you, so I decided to gather some more opinions :D. I really hope that this post will help someone in their problemsetting future!

When and how did you start problemsetting?

300iq: April, 2017

maroonrk: In 2015 Summer, I hold the first contest with friends at high school club. It was a local Japanese contest.

Radewoosh: In high school, so probably for 5 years. I was creating problems for other people from my school as my teacher told me that it's a completely different point of view.

voidmax: It was 3 years ago. I was on plane and I didn't have a clue what to do in my free time. Then I realized that I can try myself in problemsetting. Later I created first and one of my favorite problem (963B - Уничтожение дерева). I was full of inspiration and so I decided to make round... That's how it started.

How do you usually come up with new problems? What ways help you to create your best problems??

300iq: I am just thinking a lot, trying to come up with some beautiful construction, or thinking about something that looks "completely unsolvable" and trying to solve that.

maroonrk: There are two ways:

1. To use existing ideas.

Firstly I have some algorithm or beautiful structure of something in mind, then create a problem related to it. This is an "idea->statement" problem-setting.

2. To somehow "generalize" daily events.

In daily life I often try to think "is it possible to generalize this happening?", and sometimes it succeeds. This is a "statement->idea" problem-setting.

Radewoosh: My favorite way is to do it backwards, starting with an idea what the solution should be about. (1097H - Матеуш и бесконечная последовательность)

Also, I like mixing known things, the result can be surprising. (102341L - Lati@s)

Of course, it's great when you come with something totally fresh by an accident, but this doesn't happen very often. (698F - Взаимно простые перестановки)

voidmax: Usually I take some well-known problem or structure and try to look at it in a new way.

What is your opinion about subtasks? Is this format suitable in CF/TC/AtCoder contests??

300iq: I think subtasks ARE suitable, but it is sad when a subtask is adding something very stupid and not interesting. I participate in OI contests, so for me subtasks are OK because I am familiar with them.

maroonrk: Some subtasks are nice, but they are so rare. Besides, I strongly believe that "solving easier subtask first and then harder" should not be worth more than "just solving the hard".

So I don't think Subtasks are suitable for CF/TC since they have drain points system. And even if the penalty is calculated only by last submission time, we should be prudent in setting Subtasks.

Radewoosh: It's hard to say, when I'm competing, I'm always trying to go for the whole problem. They can be, but only if there is a good point for making a subtask (so both solving the subtask and moving from the subtask to the full problem are hard).

voidmax: Obviously, subtasks are great. I see only pluses. Sometimes problems are still interesting, even with lower limitations. Also subtasks are motivating to solve problem. A lot of people give up after trying solving hard task, but subtask can give them hope that problem is solvable.

What is your opinion about Thinkforces? Should round have some amount of more standard, less ad-hoc problems to be balanced?

300iq: I think Thinkforces is very good, and these problems are the best problems.

maroonrk: I think easy and medium problems can be (but not necessarily) standard problems, since it would be a nice opportunity for beginners to learn common techniques. However, hard problems should be ad-hoc to some extent. I don't like the round where the winner is determined by tasks like "Do you know this particular algorithm?", or "Can you implement this in 1 hour?". I'm not saying they should be pure ad-hoc. They can require some advanced algorithms and moderate amount of implementations, but they must have ad-hoc part.

Radewoosh: I like ad-hoc problems, most of times they are invented in the third mentioned way, so I'm always impressed by them. It depends on the problem, but if all the problems require just roaming to get the solution it isn't so nice for everybody. I like thinking about the participants during the preparation and in my opinion is good to let them have some breaks and force them to just implement something.

voidmax: I think every round should be Thinkforces (except Educational). We are writing rounds for fun, right? And where is fun when you immediately starting to write solution, without a moment of thinking about the task? I am absolutely sure that even a easy problem can be interesting. Also standard problems sometimes are dishonest. Take for example FFT problems. If you don't know FFT, you have no chance to solve that problem.

Should every contest have data structure problem?




No. Data structure is just a tool to solve problems. Of course it is good that the round have a wide variety of tasks, but, If all of the round tasks can be solved without data structures, you can just leave it.

Radewoosh: Of course not, but I like giving tags to my problems and it's nice if there is a variety of them and they don't repeat too much in one contest.

voidmax: No, I think not. Most of data structure problem are similar and quite boring.

What is better: many tasks, to have to choose what to think about, or less tasks, to have more time to think on each problem?

300iq: I love solving ICPC contests solo, so for me first variant is better.

maroonrk: I don't have an opinion on this matter. However, I believe that contests should be designed so that one participant can solve all tasks with non-zero probability.

Radewoosh: Depends on the contest's style, you should always try to fit in. Less problems are ok if they still touch different topics.

voidmax: Less tasks is better.

Do you sometimes have a feeling that you have run out of problems? If so, how do you deal with this?

300iq: Yeah, I have this feeling every day. But somehow I come up with more and more new ideas, it just depends on the time I spend on thinking about new problems.

maroonrk: I often feel like that. At such time I stop creating problems, and concentrate on solving problems.

Radewoosh: Sometimes yes, but the first and second mentioned way usually work if you spend enough time.

voidmax: It is normal situation. Usually I create many problems in some short period and most of the time don't have any good ideas. It's a matter of time. I just wait for inspiration.

How often do you discard your problem ideas?

300iq: Very often. Often I come up with some idea that is trivially solvable for small $$$n$$$, but for large $$$n$$$'s looks almost impossible to solve.

maroonrk: I don't remember, but around half of them.

Radewoosh: Very rarely, I try to change them to make them OK. For example when a similar problem had appeared somewhere before.

voidmax: Almost never.

Opinions about problems may be subjective, but still. What is your opinion about criticizing the problems after the contest? Do people criticize problems in Codeforces comments too little?

300iq: I think that is OK to criticize the problems, and it is very useful to listen to good critics. But if one writes something without any arguments, like "Mathforces. Please stop creating new problems.", then it is useless.

maroonrk: We should be open to constructive criticism, but they are too few.

Radewoosh: No problemsetter is perfect. Even if they aren't nice I try to read all the opinions about my problems to make them better in the future, so every opinion (even if it's stupid) should count.

voidmax: Criticizing is normal. It helps authors to see the strong and the week sides of their creations. (I've almost never seen a criticizing in the comments) Also, yes, opinion is subjective, but sometimes there are objective reasons why a problem is bad.

Who are your favorite problemsetters?


MiracleFaFa (GP of Zhejiang is very cool, and his problems from other places too), rng_58 (I really like CDE from new AtCoder WTF, but I don't like a lot of other problems from AtCoder), izban.


rng_58, AtCoder WTF2019 was amazing!

Radewoosh: Huh, I don't think if I have any specific problemsetter, but I think that I like most of the Chinese/Korean problemsets, as they seem to really touch many different topics and don't try to avoid any of them.

voidmax: ko_osaga, majk, antontrygubO_o

Name best three problems authored by you (with links if possible). What are the stories behind setting them?


102268H - Hall's Theorem:

I am a big fan of Hall's Theorem, so somehow I created this constructive problem. My solution was very strange without any proof (just write and see), but after some time I found proof and realized that this problem may be reformulated as a good math problem! (Proof that for each k it is possible).

I like this problem because it is one of the few constructive problems that I created, and I like constructive problems.

102331H - Honorable Mention:

I thought that this problem is "unsolvable", so I decided to think about it.

I found that we can use slope sorting + D&C to get the answer for each k on the array with some additional constraints, and after that, I found that it is possible to use Aliens Trick (I am a big fan of it!!!) to get the answer for segments to optimize.

I like this problem, because new ideas behind it may be used for a lot of other problems!


Two trees. Sorry, I don't remember the story behind this task.

Negative Cycle. The original version was "There are N=100000 vertices on a line and M=100000 additional edges. Check if there exists a negative cycle.". However, as you might guess, it was almost impossible to make strong tests. So I modified the problem and it was indeed a nice modification.

Meetings. When I came up with the statement, I couldn't solve this. However, around a month later, the solution suddenly came to mind when I was commuting and I got stunned.

Radewoosh: In random order:

102341D - Dedenne



It's hard to pick only three. The stories are different, but I think that in all of them I started with the solution.


1131G - Самая опасная акула This task really shines when you are finding solution with complexity $$$O(m)$$$. I tried my best to make pass $$$O(m)$$$, but I failed.

1181E2 - История одной страны (сложная) This task represent my view of 2D bracket sequence (It's normal, right?)

1239E - Черепашка

First two problems were on school olympiads for 6-9 grade. To my surprise both problems were solved.

What are your favorite problems of 2019?


GP of Xi'An All Pair Max Flow

AtCoder WTF (CDE)

GP of Warsaw Bulbasaur (about some max flow)

Bohemian Rhaksody (KAIST contest, Prefinals Workshop)

Поиск идеи (ROI 2019, LOL.)


Triangular Lamps Hard


102331H - Honorable Mention

Radewoosh: If not authored by me:

Parada by Errichto

102331H - Honorable Mention: by 300iq


1270E - Разделите точки

1254B2 - Отправьте коробки Алисе (усложнённая версия)

1188D - Сделайте равными

1229F - Матеуш и эскейп-рум

Read more »

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

By antontrygubO_o, history, 2 years ago, In English

So 2 weeks ago I changed my rank to specialist and color to cyan. Everything was alright, but today I woke up and my hair became cyan too! How does this even work

MikeMirzayanov please take a look into this issue...


Read more »

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

By antontrygubO_o, 2 years ago, In English

Hi there! The recent Good Bye 2019 was very important event for us, and thanks for all the positive feedback we got, especially from Radewoosh! As a follow-up, we would like to share some background on its preparation.


A: This one was the hardest to come up with. We wanted it to be super easy but still to include some idea, and this is like the $10$th version of the problem.

B: Initially there was another problem at this position. However, it turned out to be too hard for B (one orange couldn’t do it during the testing), and people didn’t like it in general, so we came up with another task.

C: Funny, but we didn’t know that it’s always possible to make array good with adding at most $$$1$$$ element before the contest.

D: This problem was created just 3 days before the contest to make it more balanced :O. We are glad that the contest did turn out to be well-balanced.

E: Initially we wanted this problem to be at position C, but the coordinator told us it was too hard for it and we moved it to D. However, testing showed that we have to move it even further!

F: This problem caused a lot of troubles because we wanted to cut $$$n^2$$$ brute force solution which was working very fast. Luckily, nobody managed to pass it in $$$n^2$$$ during the contest, but in upsolving savinov managed to!

G: Before there was another problem at this position, but this problem by a recent round by hugopm turned out to be too similar to it :(, so we had to replace this position.

Initially, I wanted to send the current problem G to IMO (asking to prove that there exists a nonempty set with zero-sum), and I think it would make a great P2, but we wanted to make this contest the best we could make, so I decided to use it here. We are glad you also found it beautiful!

I think it may be interesting how this problem was created. I wanted to come up with some problem with permutations, and the first (and obvious) version was:

Prove that for any permutation $$$p$$$ of $$$n$$$ elements there exists some set $$$S$$$ such that

$$$\sum_{x \in S} x = \sum_{x \in S} p_x$$$

Of course, this is a very bad problem, as even $$$S = {1, 2, \dots, n}$$$ would suffice. So I decided that permutation wasn't necessary, and the next version of the problem was:

Prove that for any array $$$a$$$ of $$$n$$$ elements such that $$$1\le a_i \le n$$$ there exists some set $$$S$$$ such that

$$$\sum_{x \in S} x = \sum_{x \in S} a_x$$$

But this one was too obvious and too well known...

I just decided to regroup terms, so that the new version became:

Prove that for any array $$$a$$$ of $$$n$$$ elements such that $$$1\le a_i \le n$$$ there exists some set $$$S$$$ such that

$$$\sum_{x \in S} (x - a_x) = 0$$$

It was left to just set $$$b_i = i - a_i$$$ and to ask to find subset with zero sum! Funny, that this simple process led to such problem O_O

Creating tests was really hard for this problem, you can read about one testcase here, but we are glad that not so many heuristics solutions managed to pass!

H: We needed some programming task (or otherwise some people would kill us). Initially we came up with the $$$q = 0$$$ version of that problem and considered it as Div2B — Div1A level, but then we thought about the queries and Mediocrity managed to find $$$n\log{n}$$$ solution!

We had problems with TL with this problem as well, wanting to cur $$$n\sqrt{n\log{n}}$$$ solutions, but didn’t manage too, unfortunately.

Fun fact: initially we considered G and H to be of about the same difficulty. The contest proved that we were very wrong :D

I: I loved this task a lot (this is my favorite problem in general) and wanted to create something with a similar idea (Idea: count some function for every cell such that some operation changes values of functions nicely).

Firstly I wanted to send it to IOI, but after I decided that it's really hard to come up with meaningful subtasks for this problem, so I decided to use it here.

I would like to point out, that problems E, G, I were created in direction solution -> problem. For some reason people keep saying that this way gives bad problems too often, and I want to persuade others that this way of creating problems is great :D

During the contest

We were really surprised when the first 2 accepted solutions of problem G came from people with ratings 1900 and 1700 :o

At the end of the contest, we thought that the decision to make it $$$3$$$ hours was wrong, as the number of attempts to pass some heuristics in G and some $$$nsqrt{nlog(n)}$$$ in H was increasing in last $$$30$$$ minutes :(.

Post-contest impressions

We expected people to complain about bad TL in F, H, about bad tests in G, and about the contest being too Mathforces in general (yes, that’s why I wrote Mathforces Thinkforces in the announcement. We were really surprised by the amount of positive feedback though, thank you a lot!

There was a very interesting post-contest discussion involving Radewoosh and Swistakk. We intended to make the problems heavily thinking oriented and less coding oriented, and we think that we succeeded. However, we would like people to share their opinions: do you think a lot of ad-hoc problems in one contest are bad for Codeforces?

Thank you for the amazing year though, we hope to return with other good contests!

Happy New Year!

(You will see my cyan hair in the next few days)

Read more »

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

By antontrygubO_o, 2 years ago, In English

Hello again, Codeforces!

We are glad to invite you to Mathforces Thinkforces Good Bye 2019, which will take place on Dec/29/2019 17:05 (Moscow time).

Some information about the round:

  • Rated for all participants!
  • 3 hours!
  • No subtasks!
  • There will be an interactive problem in this round. You can read the guide for interactive problems here
  • Editorial will be published right after the system testing

All problems in this round were prepared by us, antontrygubO_o and mhq. We worked on this round for a long time and tried to make all the problems very interesting. We hope that you will enjoy the round!

We would like to thank:

The number of the problems and point distribution will be announced shortly before the round (or earlier).

Good luck and have fun!

UPD1: Using opportunity, we would like to advertise the match between tourist and Um_nik, which will start in half an hour after this round ends.

UPD2: The last contest of the decade on Codeforces will feature 9 problems .

Score distribution:

500 — 1000 — 1500 — 2000 — 2750 — 3250 — 3750 — 4000 — 4500

UPD3: Editorial


Congratulations to winners:

  1. Radewoosh
  2. Um_nik
  3. yosupo
  4. FizzyDavid
  5. ksun48
  6. isaf27
  7. Petr
  8. WZYYN
  9. AndreySergunin
  10. saba2000

Read more »

Announcement of Good Bye 2019
  • Vote: I like it
  • +1517
  • Vote: I do not like it

By antontrygubO_o, 2 years ago, In English

Everything in this blog is only my opinion, motivated by the recent round. If you disagree with it, let's discuss in the comments!

It's always hard to prepare a balanced problem set, and when the contest turns out to be unbalanced, an army of angry coders will destroy you in the comments section. But how can setters make Codeforces contests balanced?

Before, authors usually had to spend more time coming up with new problems which would close a too large gap between some $$$2$$$ problems. But now we have an easier solution! Any time there is a big difficulty gap in a contest, add subtasks to it!

View on subtasks by MikeMirzayanov:

Subtasks became really widely used in Codeforces contests recently. I looked at last $$$30$$$ contests rated for Div1 users. In turns out that:

Rounds $$$30 - 21$$$ had only $$$1$$$ subtasks in total,

Rounds $$$20 - 11$$$ had $$$3$$$ subtasks in total,

The last $$$10$$$ rounds already had $$$7$$$ subtasks in total.

Codeforces rounds in the nearest future:

But what can be bad about subtasks if they are making contests so balanced? I have several thoughts.

To begin with, subtasks shouldn't be treated as a panacea. That means, that we can't create a random set of problems with hope to make it balanced by adding several subtasks: they should be treated as a safety bag. As MikeMirzayanov says, In a perfect world, probably, subtasks are not needed

Setter has to really aim to make a balanced round, and after that, if testing shows that there is some very large gap, then maybe try to close it with a subtask. This means that subtasks should be pretty rare in general. However, we see that the number of subtasks in Codeforces contests is growing. Did setters really become worse in making the rounds balanced during the last year? I don't think so, and, to be honest, it feels like the trend now is "Oh it's not balanced, don't bother, just add subtask". The earlier the round is ready the better!

Now the actual complaints about the subtasks on Codeforces:

1. The difficulties are almost always ruined.

Let's look at several examples:

Codeforces Round #602(Div 1). Both problems A and B1 in this round have difficulty $$$500$$$. However, I believe that B1 is easier than A.

Codeforces Round #601(Div 1) Problem B1 is worth $$$500$$$ points, B2 is worth $$$750$$$ points, while the only step that B2 makes with respect to B1 is that you can iterate only through prime divisors, not through all divisors!

And an example that really a lot of people were angry about:

Codeforces Round #584(Div 1), where both E2 and G1 were worth $$$1500$$$ points, which is nonsense.

2. The strategy of solving the easy subtask before trying hard gives more points than just solving hard from scratch too often.

Again, look at Codeforces Round #584(Div 1) with G1 worth $$$1500$$$ and G2 worth $$$2250$$$. Here implementing G1 before even trying G2 is the best strategy.

The same is true about B1 and B2 in Codeforces Round #602(Div 1) (for not too high rated users), about G1 and G2 in Codeforces Round #568(Div 2), and so on.

As pointed out by teja349 here, this would have been okay if the penalty was last submission time, but the decreasing problem value Codeforces system makes the situation with subtasks really sad. Basically, this gives a motivation to solve all easy problems first and doesn't give you nor motivation either time left to work on the harder version.

3. The subtasks should have some weight as problems even on their own, but often they are dead problems.

I will explain what I mean. Consider problem B1 from Codeforces Round #602(Div 1). I am sorry, but there is just nothing good about this problem. It's clear that it was created just for balance, and it's clear that no author with some self-respect would come up with exactly this problem, it's suitable only as a subtask. But as a result, we get a Frankenstein problem.

One more Frankenstein:

E1 from Codeforces Round #577(Div 2) — I really like E2 version, but E1 just makes you code all the possible positions on the board, and I don't think that there exists a person that would find that beautiful.

4. Often, the solution for subtask doesn't have anything in common with the solution of the original problem

Again, refer to problem B1 from Codeforces Round #602(Div 1), E1 from Codeforces Round #577(Div 2).

Just to clarify: I don't think that all problems with subtasks are bad. In particular, I think that F1 and F2 from Codeforces Global Round 4 were fitting perfectly, same about E1 and E2 from Codeforces Round #588(Div 1).

However, I don't feel that subtasks have been really successful in Codeforces (yet). Setting a good subtask doesn't require much less effort than coming up with a new problem, and should be treated with the same amount of responsibility, but it seems that's not true here (yet).

What do you think?

Read more »

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