cry's blog

By cry, 4 months ago, In English
  • Vote: I like it
  • +403
  • Vote: I do not like it

By cry, 8 months ago, In English

I am extremely delighted to invite you to participate in my first solo round, Codeforces Round 1050 (Div. 4), starting on Sep/13/2025 17:35 (Moscow time). There will be $$$7$$$ problems to be solved in $$$2$$$ hours and $$$15$$$ minutes.

The format of the event will be identical to Div. 3 rounds:

  • ICPC rules with a penalty of 10 minutes for an incorrect submission;
  • 12-hour phase of open hacks after the end of the round (hacks do not give additional points)
  • after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated
  • by default, only "trusted" participants are shown in the results table (but the rating will be recalculated for all with initial ratings less than 1400 or you are an unrated participant/newcomer).

We urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism but to take part unofficially. Please do not spoil the contest for the official participants.

Only trusted participants of the fourth division will be included in the official standings table. This is a forced measure for combating unsporting behavior. To qualify as a trusted participant of the fourth division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them),
  • do not have a point of 1400 or higher in the rating.

Regardless of whether you are a trusted participant of the fourth division or not, if your rating is less than 1400 (or you are a newcomer/unrated), you may choose to participate rated or unrated.

PLEASE NOTE the rule restricting AI use. If you are caught using AI in an unorthodox manner, either by us manually or detected automatically, YOUR ACCOUNT WILL BE TERMINATED and your entire family will be sent to my basement (which has no toilets available). We will be actively scouring submissions and terminating rulebreakers.

I would like to thank the following individuals for making this contest possible:

I know it has been a while without a division 4, so GLHF!

Editorial is Up!

Full text and comments »

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

By cry, 8 months ago, In English

2148A - Sublime Sequence

Solution (written by cry)
Code (C++) (MikeMirzayanov)

2148B - Lasers

Solution (written by cry)
Code (C++) (MikeMirzayanov)

2148C - Pacer

Solution (written by cry)
Code (C++) (litfan)

2148D - Destruction of the Dandelion Fields

Solution (written by cry)
Code (C++) (AksLolCoding)

2148E - Split

Solution (written by cry)
Code (C++) (kwant)

2148F - Gravity Falls

Solution (written by cry)
Code 1 (C++) (cry)
Code 2 (Python) (Vladosiya)

2148G - Farmer John's Last Wish

Solution (written by avighankc)
Solution 2 (written by Jteh)
Code (C++) (Jteh)

Full text and comments »

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

By cry, 9 months ago, In English

Hello Codeforces.

I was stuck on a 3 hour flight with nothing to do, so what better way to spend my time than catching up on the new CSES problems. But it turns out I finished those too quick so I guess I'm writing the solutions for some of them here. No one probably asked.

This will only cover the new problems from the 2025 update and in the Additional Problems I section. For old problem solutions you can probably find them somewhere on the internet. For new problems not in this section, some of their solutions are in this blog.

Distinct Values Sum

Smash Me

Distinct Values Splits

Smash Me

Beautiful Permutation II

Smash Me

Bubble Sort Rounds I

Smash Me

Bubble Sort Rounds II

Smash Me

Nearest Campsites II

Smash Me

Counting LCM Arrays

Smash Me

Square Subsets

Smash Me

Subarray Sum Constraints

Smash Me

Water Container Moves

Smash Me

Water Container Queries

Smash Me

Maximum Average Subarrays

Smash Me

Subsets With Fixed Average

Smash Me

Two Array Average

Smash Me

Permutation Subsequence

Smash Me

Full text and comments »

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

By cry, 15 months ago, In English

Codeforces!

Proof_by_QED, chromate00, larush, Edeeva, and I would like to invite you to participate in Codeforces Round 1003 (Div. 4), starting on 09.02.2025 17:35 (Московское время). We have baked $$$8$$$ problems to be solved in $$$2$$$ hours and $$$15$$$ minutes. We hope the problems will be interesting, unique...and skibidi.

The format of the event will be identical to Div. 3 rounds:

  • ICPC rules with a penalty of 10 minutes for an incorrect submission;
  • 12-hour phase of open hacks after the end of the round (hacks do not give additional points)
  • after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated
  • by default, only "trusted" participants are shown in the results table (but the rating will be recalculated for all with initial ratings less than 1400 or you are an unrated participant/newcomer).

We urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism but to take part unofficially. Please do not spoil the contest for the official participants.

Only trusted participants of the fourth division will be included in the official standings table. This is a forced measure for combating unsporting behavior. To qualify as a trusted participant of the fourth division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them),
  • do not have a point of 1400 or higher in the rating.

Regardless of whether you are a trusted participant of the fourth division or not, if your rating is less than 1400 (or you are a newcomer/unrated), you may choose to participate rated or unrated.

Large text, to get your attention for the following:

PLEASE NOTE the rule restricting AI use. If you are caught using AI in an unorthodox manner, either by us manually or detected automatically, YOUR ACCOUNT WILL BE TERMINATED. We will be actively scouring submissions and terminating rulebreakers.

Anyways, I would like to orz the following:

UPD: Editorial

UPD2: Regarding Skipped Submissions

Full text and comments »

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

By cry, 15 months ago, In English
Rating Predictions

2060A - Fibonacciness

Problem Credits: Proof_by_QED
Analysis: larush

Solution 1
Solution 2
Code (C++)
Rate The Problem!

2060B - Farmer John's Card Game

Problem Credits: Lilypad
Analysis: larush

Solution
Code (C++)
Rate The Problem!

2060C - Game of Mathletes

Problem Credits: Friedrich
Analysis: macaquedev

Solution
Code (C++)
Rate The Problem!

2060D - Subtract Min Sort

Problem Credits: Proof_by_QED
Analysis: Proof_by_QED

Solution
Code (C++)
Rate The Problem!

2060E - Graph Composition

Problem Credits: Friedrich
Analysis: DivinePunishment

Solution
Code (C++)
Rate The Problem!

2060F - Multiplicative Arrays

Problem Credits: Proof_by_QED, cry
Analysis: -firefly-

Hint 1
Hint 2
Hint 3
Solution 1
Solution 2
Code (C#)
Rate The Problem!

2060G - Bugged Sort

Problem Credits: chromate00
Analysis: macaquedev

Hint 1
Hint 2
Hint 3
Hint 4
Solution
Code (C++)
Rate The Problem!

Full text and comments »

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

By cry, 16 months ago, In English

It seems like all GIFs in problem statements are broken.

Remember when the triangle in the notes section of 2009D - Сатьям и подсчет used to animate? I sure did, because I spent 2 hours making it (5 minutes on the actual GIF and the other 115 minutes on compressing the image size). Now it's just a static image D;

It's worth noting that Polygon never supported GIFs, I just converted my GIF to an APNG then uploaded it as a PNG as described in this comment.

But it's a new era now and that has broken as well. If anyone finds any other bypasses, then please let me know. Otherwise, KAN and MikeMirzayanov may have to actually implement GIFs D;

Full text and comments »

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

By cry, 16 months ago, In English

Special thanks to our hub of testuwuers for contributing solution explanations!

2044A - Easy Problem

Problem Credits: cry
Analysis: macaquedev

Solution
Code (Python)

2044B - Normal Problem

Problem Credits: Lilypad
Analysis: Lilypad, macaquedev

Solution
Code (C++)

2044C - Hard Problem

Problem Credits: cry
Analysis: macaquedev

Solution
Code (C++)

2044D - Harder Problem

Problem Credits: cry, Proof_by_QED
Analysis: macaquedev

Solution
Code (C++)

2044E - Insane Problem

Problem Credits: Proof_by_QED,Lilypad
Analysis: macaquedev, chromate00

Solution 1 (Binary Search)
Solution 2 (Intervals)
Code (C++)

2044F - Easy Demon Problem

Problem Credits: chromate00, Proof_by_QED
Analysis: DivinePunishment

Are you a python user and failing test 12?
Solution
Code (C++)

2044G1 - Medium Demon Problem (easy version)

Problem Credits: Lilypad
Analysis: macaquedev

Solution
Code (C++)

2044G2 - Medium Demon Problem (hard version)

Problem Credits: Lilypad
Analysis: Proof_by_QED

Solution
Code (C++)

2044H - Hard Demon Problem

Problem Credits: cry
Analysis: chromate00

Solution
Code (C++)

Full text and comments »

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

By cry, 17 months ago, In English

Hello Cowodeforces :D

Art by chromate00

Proof_by_QED, Lilypad and I are very to invite you to participate in Codeforces Round 993 (Div. 4), which will start on Dec/15/2024 17:35 (Moscow time). There will be $$$8$$$ problems, with one split into two subtasks, to be solved in $$$2$$$ hours and $$$15$$$ minutes. Participate or you'll have to wait another millennium for a Div. 4 round.

The format of the event will be identical to Div. 3 rounds:

  • ICPC rules with a penalty of 10 minutes for an incorrect submission;
  • 12-hour phase of open hacks after the end of the round (hacks do not give additional points)
  • after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated
  • by default, only "trusted" participants are shown in the results table (but the rating will be recalculated for all with initial ratings less than 1400 or you are an unrated participant/newcomer).

We urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism but to take part unofficially. Please do not spoil the contest for the official participants.

Only trusted participants of the fourth division will be included in the official standings table. This is a forced measure for combating unsporting behavior. To qualify as a trusted participant of the fourth division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them),
  • do not have a point of 1400 or higher in the rating.

Regardless of whether you are a trusted participant of the fourth division or not, if your rating is less than 1400 (or you are a newcomer/unrated), you may choose to participate rated or unrated.

We want to express overwhelming gratitude to the following orzosities for making the contest possible:

UPD: Editorial

Full text and comments »

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

By cry, 18 months ago, In English

Welcome to Natlan, Codeforces!

sum, Proof_by_QED and I are like a dog with two tails to welcome you to participate in Codeforces Round 988 (Div. 3) at Nov/17/2024 17:35 (Moscow time). We have cooked up $$$7$$$ problems to be solved in $$$2$$$ hours and $$$15$$$ minutes.

The round will be hosted by rules of educational rounds (extended ICPC). Thus, solutions will be judged on preliminary tests during the round, and after the round, it will be a 12-hour phase of open hacks. After open hacks all accepted solutions will be rejudged on successful hacks.

Note that the penalty for each wrong submission in this round is 10 minutes. Also, note the rule restricting AI use!!! If you are caught using AI in an unorthodox manner, bad things will happen to you. We will be watching you all...

IMPORTANT!!! There is at least one interactive problem in the problemset. Please familiarize yourself with the guide for interactive problems beforehand.

Remember that only the trusted participants of the third division will be included in the official standings table. As it is written by link, this is a compulsory measure for combating unsporting behavior. To qualify as a trusted participant of the third division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them)
  • do not have a rating of 1900 or higher at any moment in time.

Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you (unless you register unrated).

We would like to orz the following individuals for making the contest possible:

UPD: Editorial!!!

Full text and comments »

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

By cry, 18 months ago, In English

2037A - Twice

Problem Credits: cry
Analysis: cry

Solution
Code (Python)

2037B - Intercepted Inputs

Problem Credits: cry
Analysis: chromate00

Are you a python user and failing test 4?
Solution
Code (Python)

2037C - Superultra's Favorite Permutation

Problem Credits: sum
Analysis: chromate00

Solution
Code (Python)

2037D - Sharky Surfing

Problem Credits: cry
Analysis: chromate00

Solution
Code (Python)

2037E - Kachina's Favorite Binary String

Problem Credits: Proof_by_QED
Analysis: Intellegent

Solution
Code (Python)

2037F - Ardent Flames

Problem Credits: Proof_by_QED
Analysis: Proof_by_QED

Solution
Code (Python)

2037G - Natlan Exploring

Problem Credits: Proof_by_QED
Analysis: Proof_by_QED

Solution
Code (Python)

Full text and comments »

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

By cry, 18 months ago, In English

Haiii Codeforces ^_^

Note the unusual starting time. This round starts 30 minutes before the standard starting time.

Proof_by_QED and I are extremely excited to invite you to Codeforces Round 979 (Div. 2) on 19.10.2024 17:05 (Московское время). You will be given 7 problems and 2 hours and 15 minutes to solve them. One problem will be split into two subtasks. This round will be rated for all participants with rating below 2100.

This round is based on... absolutely nothing.

We would like to mention the following individuals for making the contest possible:

Score Distribution: $$$250 - 500 - 1000 - 1500 - 2000 - 2500 - (3000 + 1500)$$$

UPD: Editorial

Full text and comments »

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

By cry, 18 months ago, In English

Below is a timeline of the changes made to the round from start to finish. I hope this can depict what setting a contest is actually like for aspiring problemsetters. Please give me feedback about this in the comments. What else about the round would you like to know? Was this helpful?

Round Timeline

Please check out this amazing animated video tutorial by one of our beloved testers redpanda!!!

2030A - Подарок от орангутана

Problem Credits: Proof_by_QED
Analysis: Proof_by_QED

Solution
Code (Python)

2030B - Минимизируйте единичность

Problem Credits: Proof_by_QED
Analysis: Proof_by_QED

Solution
Code (C++)

2030C - ИСТИННАЯ битва

Problem Credits: Proof_by_QED
Analysis: Proof_by_QED

Solution
Code (C++)

2030D - Любимая перестановка ЧТД

Problem Credits: Proof_by_QED, cry
Analysis: cry

Solution
Code (C++)

2030E - MEXимизируйте счёт

Problem Credits: Proof_by_QED, cry, satyam343
Analysis: cry

Solution
Code (C++)

2030F - Орангутано-одобренный массив

Problem Credits: Proof_by_QED, satyam343
Analysis: Proof_by_QED

Solution
Code (C++)

2030G1 - Уничтожение Вселенной (простая версия) and 2030G2 - Уничтожение Вселенной (сложная версия)

Problem Credits: Proof_by_QED, satyam343
Analysis: satyam343

Solution (Easy Version)
Solution (Hard Version)
G1 Code (C++)
G2 Code (C++)

Full text and comments »

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

By cry, 20 months ago, In English

Heyo Codefoworcers!

Proof_by_QED and I are very delighted to invite you to participate in Codeforces Round 971 (Div. 4), which will start on 03.09.2024 17:35 (Московское время). There will be $$$7$$$ problems, with one split into three subtasks, to be solved in $$$2$$$ hours and $$$30$$$ minutes. We encourage you to participate and hope you have fun, regardless of your division!

The format of the event will be identical to Div. 3 rounds:

  • 5-8 tasks;
  • ICPC rules with a penalty of 10 minutes for an incorrect submission;
  • 12-hour phase of open hacks after the end of the round (hacks do not give additional points)
  • after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated
  • by default, only "trusted" participants are shown in the results table (but the rating will be recalculated for all with initial ratings less than 1400 or you are an unrated participant/newcomer).

We urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism but to take part unofficially. Please do not spoil the contest for the official participants.

Only trusted participants of the fourth division will be included in the official standings table. This is a forced measure for combating unsporting behavior. To qualify as a trusted participant of the fourth division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them),
  • do not have a point of 1400 or higher in the rating.

Regardless of whether you are a trusted participant of the fourth division or not, if your rating is less than 1400 (or you are a newcomer/unrated), you may choose to participate rated or unrated.

We want to express overwhelming gratitude to the following orzosities for making the contest possible:

01100 00000 11000 10011 00111 01000 10010 01001 01110 10100 10001 01101 00100 11000 01011 00100 00000 00011 10100 10010 10010 10011 00000 10001 10110 00000 10001 00011

UPD: The round will be unrated, even though m1.codeforces.com, m2.codeforces.com, and m3.codeforces.com were functioning correctly. While there were issues on the main site (which lasted more than an hour), no participant was able to view the leaderboard, ask a question, or receive an answer.

Editorial

Full text and comments »

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

By cry, 20 months ago, In English

Thanks for participating! Despite the round being unrated, we hope you've enjoyed the problemset. We put a lot of effort into this round :prayge:

I want to give huge thanks to Dominater069 and satyam343 for their heavy contributions to the subtasks of G. If you're participating out of competition, we hope you enjoyed attempting these bonus subtasks. Otherwise, we hope you will enjoy upsolving them!

2009A - Minimize!

Problem Credits: cry
Analysis: cry

Solution
Code (Python) (ntarsis30)

2009B - osu!mania

Problem Credits: cry
Analysis: cry

Solution
Code (Python) (chromate00)

2009C - The Legend of Freya the Frog

Problem Credits: Proof_by_QED
Analysis: cry

Solution
Code (Python) (ntarsis30)

2009D - Satyam and Counting

Problem Credits: Proof_by_QED
Analysis: cry

Solution
Code (Python) (ntarsis30)

2009E - Klee's SUPER DUPER LARGE Array!!!

Problem Credits: cry
Analysis: cry

Solution
Code (Python) (ntarsis30)

Bonus: Solve in $$$\mathcal{O}(1)$$$.

Code (Python) (Non-origination)

2009F - Firefly's Queries

Problem Credits: cry
Analysis: cry

Solution
Code (C++) (awesomeguy856)

2009G1 - Yunli's Subarray Queries (easy version)

Problem Credits: cry, Proof_by_QED
Analysis: Proof_by_QED

Solution
Code (C++) (yash_9a3b)

2009G2 - Yunli's Subarray Queries (hard version)

Analysis: Solution 1: Proof_by_QED, Solution 2: awesomeguy856

Prologue
Solution 1 (Lazy Segment Tree, Offline)
Code (C++) (vgoofficial)
Solution 2 (Binary Lifting, Online)
Code (C++) (awesomeguy856)

2009G3 - Yunli's Subarray Queries (extreme version)

Analysis: Dominater069

Solution
Code (C++) (awesomeguy856)

Full text and comments »

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

By cry, 20 months ago, In English

Hello Codeforcers, especially fellow problemsetters.

I'm lazy. I like setting cool problems, but I don't enjoy preparing them. Sometimes, I take longer to prepare a problem than coming up with the idea. Surely I'm not the only one. My laziness has motivated me to make this blog about a feature I think will benefit the future of problemsetting and more frequent contests for codeforces.

I propose that there should be a hub for crowdsourcing useful generators from past problems. Similar to a hub for Minecraft mods, I think there should be something similar for testlib generators. Authors of past rounds should be able to upload generators to that hub. They should be able to specify the tags (number theory, brute force, tree) solutions that their generator targets to TLE, and be able to specify what makes their generator special. For example, there can be generators focused on special kinds of trees required to make strong tests for a certain tree query problem. Future problemsetters should be able search up the types of generators they need for their own problems and examine these posted generators and modify it to their own needs. This should save them a lot time. Sometimes, they can recognize other problems on CF and think "man, it would be nice if I had a generator that this problem also requires".

Here's an example, consider 1985E - Секретный ящик. The solution to it requires to loop through all possible factors of two of the three integers given in the input. Obviously, inputs that are big but also have a lot of factors should be nice. If only someone made a generator on selecting random numbers with large amount of factors in a range, like a more extensive list of Highly Composite Numbers :weary:

Anyways, TLDR: this would be quite cool though :v

KAN, MikeMirzayanov

Full text and comments »

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

By cry, 21 month(s) ago, In English

In the comments section of my most recent round, there has been a lot of misconceptions about interpreting score distribution. This blog is just to inform the correct way of understanding them from a problemsetter standpoint.

The biggest misconception I saw was score distributions are always almost equal to its difficulty. This is not true. Do you really think 1852A - Набор Ntarsis is a rated 500 problem?

The correct way to interpreting score distribution is looking at the differences between each adjacent gaps. I will give suggestions on interpreting difference in points in a Div. 2 round. Div. 1 Scoring may be different because the difficulty curve is different.

Usually, a $$$250$$$ point gap means the two problems are relatively similar in difficulty but with a slight difficulty increment. A $$$500$$$ point gap represents the standard gap between adjacent problems that you'd expect. I think any gap $$$750$$$ or above means there is a decently large difficulty discrepancy between the two problems. I will use Codeforces Round 965 (Div. 2) as an example.

Problems A and B are expected to be similar difficulty with B being slightly challenging. B and C are $$$500$$$ apart, which means that the difficulty difference between B and C is expected to be larger than that for A and B. In hindsight, I probably should've assigned a $$$750$$$ point difference. This is also why you shouldn't rely on score distribution to determine whether you should approach a problem or not, as the assigned difference could be higher or lower than the actual gap. Again, there is a $$$250$$$ gap between C and D so they are expected to be relatively close in difficulty but D should still be harder than C; same for D and E1.

Problems with subtasks usually come with $$$(x + y)$$$ in the announcement blog, with $$$x$$$ being the score assigned to the easy version and $$$y$$$ for the harder version. In most round, this usually means that if the easy version is a stand-alone problem, then it should be assigned $$$x$$$ points. If only hard version is proposed, then it should be worth $$$x+y$$$ points. However, I don't believe that this should always be the case in the future, which is why this blog is also a suggestion to future problemsetters.

Originally, E1 was going to be assigned $$$2000$$$ points and E2 assigned $$$1000$$$ points. Then, one of our testers, Dominater069 said "I wrote 10 mins of ds for E1 for $$$2000$$$ points... And then take 30 mins just for $$$1000$$$ points?" I thought about this and I was like, he has a point. There has been a lot of instances where the hard version is a lot harder than the easy version, but isn't worth a significant amount of points on its own. Therefore, I think setters should weigh the hard version like a standalone problem, and decrease its value based on how much of the observation that the easy version gives away.

Lastly, score distributions aren't always accurate. They are usually only decided by setters, the coordinator, and a small subset of the testers. You shouldn't get scared if you see a large score gap between problems. Most of the time, us setters also get surprised by the performance of you codeforcers.

Full text and comments »

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

By cry, 21 month(s) ago, In English

Wazzup Codeforcers!

sum, satyam343, and I are extremely ecstatic to invite you to Codeforces Round 965 (Div. 2) on 10.08.2024 17:35 (Московское время). You will be given 5 problems and 2 hours to solve them. 1 problem will have subtasks. This round will be rated for all participants with rating below 2100. We spent the most time cooking up this round than any other round, so it means a lot if you will participate.

We would like to orz the following individuals for making the contest possible:

Score Distribution: $$$500 - 750 - 1250 - 1500 - (1750 + 1750)$$$

UPD: We know there has been a lot of disapproval for problem C. We're sorry for it. Please view https://mirror.codeforces.com/blog/entry/132507

UPD: Editorial

Full text and comments »

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

By cry, 21 month(s) ago, In English

Hello Codeforces!

If you've somehow been living under a barn, USACO is the largest online competitive programming contest for the USA high school students. As I myself am a USA high school student about to graduate, I'd like to reflect on my experience with contributing problems to USACO. By the way, I don't select problems that end up on each contest — I just contribute possible candidates. Also, I guess this is inspired by xiaowuc1's blog, who also used to be a pretty active USACO problemsetter.

The difficulty column is purely based on my own opinion.

# Problem Contest Difficulty Comments
1 Circular Barn Silver, 2022 December 1700 This was my first attempt at setting a problem. Tbh, I had no idea what I was doing. Originally, this problem going to involve Goldbach's Conjecture and I came up with the basic idea involving game theory. However, I had no idea how to solve it (it was probably impossible anyways) so I did what any newbie wannabe problem writer does — send it to a friend and hope they solve it. Not only did US3RN4M3 end up solving the problem, he modified it to a much better version. He also ended up preparing the test cases of the problem. orz.
2 Moo Language Bronze, 2023 US Open 1900 erm.. I think I was prepping for the PSAT lol.
Best problem of all time.
I came up with $$$\mathcal{O}(N)$$$ solution a couple days before the contest, but I guess the problem had already been prepared.
P.S. I think the other two bronze problems in this contest are just as hard.
3 Farmer John Actually Farms Bronze, 2023 December 1400 The original problem had $$$a_i$$$ multiplied by $$$h_i$$$ after each day instead of addition. The intended solution was using logs with real numbers. However, we noticed that there can be floating point rounding issues, so I changed the problem to addition and slapped on a permutation $$$t$$$ to make it seem more original.
4 Milk Exchange (Bronze) Bronze, 2024 February 1200 I don't remember how this problem came to be.
5 Milk Exchange (Gold) Gold, 2024 February 2200 Was discussing and whining about preparing the bronze problem with sum, and he came up with this buff. Initially we both couldn't solve it so we enlisted omeganot's assistance.
6 Maximizing Productivity Bronze, 2024 February 1100 I don't know why I proposed this problem. Nowadays, the standards I set for myself would forbid me from proposing this. Note that there was absolutely no reason for queries to exist — asking for the minimum time for each $$$V$$$ from $$$1$$$ to $$$N$$$ suffices. I think I wanted to make it seem more original, lol.
7 Logical Moos Bronze, 2024 US Open 1600 The inspiration for this problem came from Truths (CALICO Spring 2022 Contest) where the samples were just a bunch of bitwise characters between ones and zeroes. I stared at this for a while and wondered: what happens if I remove "()" and "!" and made it not an annoying DP problem...
8 Farmer John's Favorite Permutation Bronze, 2024 US Open 1600 I just thought of removing elements from both the front and back of the array, and came up with this problem. When solving it, I found the solution to be super nice. It is one of the "accidentally setting a good problem" moments of all time.
9 Farmer John's Cheese Block Bronze, 2024 December 1000 I don't actually like this problem, and I don't know why it got chosen. Initially, the problem was phrased as placing a floating box in a dark room, shining a flashlight on one side, and counting the number of lit squares on the other side. Unfortunately, this goes against how physics works. We needed something concrete. You know what's concrete... Bricks. You know what can easily be carved... Cheese.
10 Cowdependence Gold, December 2024 2100 I proposed this problem before the 2023-2024 season, and it went unused for the entire season, so I forgot about this problem. I originally proposed it for silver since it technically only really required binary search and two pointers :D
11 Interstellar Intervals Gold, December 2024 2300 This problem went through a long journey. First, it was based on a problem proposal based on Geometry Dash by sum that was proposed for Codeforces Round 965 (Div. 2). Essentially, the solution of that problem required DP on positions with the same parity since intervals had to be even length, but it was quite boring, so I tried to modify it in many ways. After some extensive discussion, satyam343 modified the problem to its current state.

At first, went in reserves for a potential D1C. However when I presented the problem to Benq for testing, he solved it in .3 seconds. Then, satyam343 said it's no longer Div. 1 quality... After that, I shipped the problem to USACO.

Also, the name of this problem was due to my HSR addiction.
12 Farmer John's Favorite Operation Silver, January 2025 1600 I misread Calendars (mBIT November 2020) while doing a virtual contest with some friends and came up with this.

By the way, it was surprising that both o1-mini and DeepSeek R1 failed to solve the problem during testing.
13 Cow Checkups (Bronze) Bronze, January 2025 1200 Originally proposed for a d2B but wasn't up to quality. The idea was maximizing the number of indices such that $$$a_i = i$$$ after reversing one subarray. Of course, satyam343 would end up rejecting it. Then I asked Proof_by_QED if I could propose for USACO Bronze and he agreed.

When preparing, we found a very similar problem so we decided to modify it. Instead of $$$a_i = i$$$, we could just give another array $$$b$$$ and ask for $$$a_i = b_i$$$. Genius!

sum would end up struggling to prepare good test cases so instead of asking for maximum number of indices we just asked for all possible reversals.
14 Cow Checkups (Silver) Silver, January 2025 1600 When modifying the bronze problem, sum over all possible reversals came naturally. We then realized it can be solved in subquadratic, so that was cool.
16 Reflection Bronze, February 2025 800 Unable to make the problem more interesting :(
17 The Best Lineup Silver, February 2025 1400 Originally a Div.2 B / Div.4 E / Bronze division candidate. The idea of the problem is mainly by Proof_by_QED. Lilypad and I just testsolved and tweaked the operation a bit. I formalized the problem into the current statement and prepared it. I liked this problem, though I don't think it belonged in silver. I think it is too easy, but somehow the other two silver problems in the contest are even easier...

By the way, both o3-mini high and deepseek R1 failed to solve it. This proves that is still possible to set problems that AI can brick. It just has to be high quality though :p
18 The Best Subsequence Gold, February 2025 2300 I was high when I proposed this problem with only a $$$\mathcal{O}(N^2)$$$ solution. Luckily it is a certain LGM that reviewed the problem and came up with a subquadratic solution.
19 It's Mooin' Time III Bronze, Open 2025 1200 I tried to modify It's Mooin' Time II while in the shower.
20 Election Queries Gold, Open 2025 2100 Probably one of my favorite problems that I've ever set. This problem was originally Problem D in Codeforces Round 979 (Div. 2), but as you probably read in the Round Timeline, we burned through quite a bit of D replacements... This problem was D'''''' btw, if you can keep track. Anyways, it wasn't used because we were worried about it being a tad too difficult and too much implementation (codeforces participants can't handle writing more than 50 lines of code before whining), so I thought it was perfect for USACO.

Difficulty wise, I thought it was definitely on the easy side of gold, but I was surprised to see the other two problems even easier...

Honorable Mentions

# Problem Contest Difficulty Comments
1 Bessie's Birthday Cake CodeTON Round 8 (Div. 1+2) 1300 I proposed this problem for USACO bronze just before the 2023-2024 season. However, it wasn't selected for any contests for the entire season. I liked this problem, and I didn't want this problem to sit in the USACO backend database for an entire year, so I proposed it for codeforces. Later, Benq would tell me that he didn't think it was a good fit for USACO.
2 Farm Game CodeTON Round 8 (Div. 1+2) 2300 I proposed this for 2024 Open Gold Contest, but wasn't selected :( I still think it's one of my best problems to date. womp womp for USACO.
Thanks to sum for extensively discussing the problem with me and solving it in the end.
3 Determine Winning Islands In Race CF Round 965 (Div. 2) 2100 Was originally proposed for USACO Bronze. I think I may have misjudged the difficulty by just a little.

Full text and comments »

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

By cry, 21 month(s) ago, In English

I accidentally copied a CodeChef problem.

I was just made aware by satyam343 that 1996A - Ноги somehow COINCIDES EXACTLY with FARMLEGS.

I had zero idea this problem even existed before right now. I even thought satyam343 was trolling and thought this problem was only published after my contest. It wasn't until I looked at submission dates that I noticed the problem was created more than three months ago... My problem was based on a mixture of middle-school word problems and me casually thinking of USACO cows.

Regarding how even the constraints are exactly the same: The constraints were initially $$$t \leq 10^5$$$ and $$$n \leq 2 \cdot 10^5$$$, but a tester did $$$O(tn)$$$ and still passed all test cases. Obviously, this is hackable, so we have to either decide to add a third test case with all tests being $$$2 \cdot 10^5$$$ or make $$$O(tn)$$$ comfortably pass. We didn't want to blow up queue even more, so we resorted to the latter option.

Anyways, this is way too funny, so I have to make a blog. This is also even more ironic since I advertised a CodeChef contest in the comments :skull:

Full text and comments »

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

By cry, 22 months ago, In English

Hewwo Cowodeforcers!

sum and I are overjoyed to welcome you to participate in Codeforces Round 962 (Div. 3) on 26.07.2024 17:35 (Московское время). This contest is the last stop on our mission to problemset for every division. We hope you've been enjoying our stuff so far!

The round will be hosted by rules of educational rounds (extended ICPC). Thus, solutions will be judged on preliminary tests during the round, and after the round, it will be a 12-hour phase of open hacks. After open hacks all accepted solutions will be rejudged on successful hacks.

You will be given 7 problems and 2 hours and 15 minutes to solve them.

Note that the penalty for each wrong submission in this round is 10 minutes.

Remember that only the trusted participants of the third division will be included in the official standings table. As it is written by link, this is a compulsory measure for combating unsporting behavior. To qualify as a trusted participant of the third division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them)
  • do not have a point of 1900 or higher in the rating.

Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you.

We would like to orz the following individuals for making the contest possible:

Thank you for reading and we hope you have a fun and educational interstellar adventure :3

UPD: Editorial

Full text and comments »

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

By cry, 21 month(s) ago, In English

1996A - Legs

Problem Credits: cry
Analysis: cry

Solution
Code (C++)

1996B - Scale

Problem Credits: sum
Analysis: cry

Solution
Code (C++)

1996C - Sort

Problem Credits: cry
Analysis: cry

Solution
Code (C++)

1996D - Fun

Problem Credits: sum
Analysis: cry

Solution
Code (C++)

1996E - Decode

Problem Credits: cry
Analysis: cry

Solution
Code 1 (C++)
Code 2 (A Little Different) (C++)

1996F - Bomb

Problem Credits: sum
Analysis: cry

Solution
Code 1 (C++)
Code 2 (C++)

1996G - Penacony

Problem Credits: cry
Analysis: cry, awesomeguy856

Solution - Segment Tree
Code (C++)
Solution - XOR Hashing (by awesomeguy856)
Code (C++)

Full text and comments »

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

By cry, 22 months ago, In English

1998A - Find K Distinct Points with Fixed Center

Problem Credits: sum
Analysis: cry

Solution
Code (C++)

1998B - Minimize Equal Sum Subarrays

Problem Credits: satyam343
Analysis: cry

Solution
Code (C++)

1998C - Perform Operations to Maximize Score

Problem Credits: cry, satyam343
Analysis: sum, satyam343, Dominater069

Hint 1
Hint 2
Hint 3
Solution
Code (C++)

1998D - Determine Winning Islands in Race

Problem Credits: cry
Analysis: cry

Solution
Code (C++)

1998E1 - Eliminating Balls With Merging (Easy Version)

Problem Credits: cry, sum, satyam343
Analysis: sum

Solution 1
Code 1 (C++)
Solution 2
Code 2 (C++)

1998E2 - Eliminating Balls With Merging (Hard Version)

Problem Credits: cry, sum, satyam343
Analysis: sum

Solution
Code (C++)

Full text and comments »

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

By cry, 2 years ago, In English

Hellowo Codeforcers :3

sum and I are very delighted, ecstatic, enchanted, euphoric, excited, exultant, jubilant, overjoyed, and proud to invite you to participate in Codeforces Round 952 (Div. 4), which will start on Jun/11/2024 17:35 (Moscow time). There will be $$$8$$$ problems, with one split into two subtasks, to be solved in $$$2.5$$$ hours.

As usual, I have to copy and paste the following...

The format of the event will be identical to Div. 3 rounds:

  • 5-8 tasks;
  • ICPC rules with a penalty of 10 minutes for an incorrect submission;
  • 12-hour phase of open hacks after the end of the round (hacks do not give additional points)
  • after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated
  • by default, only "trusted" participants are shown in the results table (but the rating will be recalculated for all with initial ratings less than 1400 or you are an unrated participant/newcomer).

We urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism but to take part unofficially. Please do not spoil the contest for the official participants.

Only trusted participants of the fourth division will be included in the official standings table. This is a forced measure for combating unsporting behavior. To qualify as a trusted participant of the fourth division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them),
  • do not have a point of 1400 or higher in the rating.

Regardless of whether you are a trusted participant of the fourth division or not, if your rating is less than 1400 (or you are a newcomer/unrated), then the round will be rated for you.

We want to express overwhelming gratitude to the following individuals for making the contest possible:

Vladosiya and mesanu for coordinating the contest and reviewing the problems.

Dominater069, omeganot, Phi-001, flamestorm, nika-skybytska, willy108, ScarletS, mark, yuan-shen, Proof_by_QED, htetgm, buffering, TheYashB, haochenkang, ETL, natalina, MC3297, and lcsc0 for testing the round.

MikeMirzayanov for the usual.

We suggest reading all of the problems as we have put mucho effort into all of them. Best of luck, mis amigos!

UPD: Editorial

Full text and comments »

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

By cry, 23 months ago, In English

This was our first time setting a Div.4 contest. We sincerely hope you enjoyed the problems!

1985A - Creating Words

Problem Credits: cry
Analysis: cry

Solution
Code (C++)
1985B - Maximum Multiple Sum

Problem Credits: cry
Analysis: cry

Solution
Code (C++)
1985C - Good Prefixes

Problem Credits: sum
Analysis: cry

Solution
Code (C++)
1985D - Manhattan Circle

Problem Credits: cry
Analysis: cry

Solution
Code (C++)
1985E - Secret Box

Problem Credits: cry
Analysis: cry

Solution
Code (C++)
1985F - Final Boss

Problem Credits: cry, sum
Analysis: cry, sum

About Hacks
Solution
Code (C++)
Bonus
1985G - D-Function

Problem Credits: cry
Analysis: cry

Solution
Code (Python)
1985H1 - Maximize the Largest Component (Easy Version)

Problem Credits: sum
Analysis: sum

Solution
Code (C++)
1985H2 - Maximize the Largest Component (Hard Version)

Problem Credits: sum
Analysis: sum

Solution
Code (C++)

Full text and comments »

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