cry's blog

By cry, 8 months 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.

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

»
12 hours ago, # |
  Vote: I like it +5 Vote: I do not like it

moo lang II when?

  • »
    »
    7 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    dec 2025 gold

»
12 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

election queries was a very sigma problem

»
12 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

reasons for my depression

»
11 hours ago, # |
  Vote: I like it +8 Vote: I do not like it

Best USACO and CF setter!

»
11 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Congratulations on graduating high school btw! Hope you will come up with more interesting problems in the future

»
11 hours ago, # |
  Vote: I like it +5 Vote: I do not like it

Congrats on your hard work you've done so far during the last 2.5 years in USACO and in general when it comes to problem setting! Your problems are really interesting and it's always a pleasure to try and assign your problems, as they are very insightful and worth solving even at the lower echelons.

I'm looking forward to seeing more of your problems in the future and I want to thank you for the hard work you've done so far as just this season alone your problems have been a quarter of the problems given on USACO across all divisions, on top of the problems you wrote in the previous seasons.

»
10 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Cheers to u mate.

u have been my good bud for a while and ik you will continue doing great things when u graduate hs.

I also think Farm game is ur best problem oat :]]] Huge redemption arc from Moo Language....

»
7 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

As a testuwuer, cry is orz.

»
7 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

orz, d u have gold cutoff predictions? :pray:

»
4 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

For, election queries I only able to solve in $$$O($$$ $$$n$$$.$$$q$$$.log $$$n$$$ $$$)$$$ using segment tree, what is the key point I'm missing for full solve. Any hints please

  • »
    »
    4 hours ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Full solve idea is: if you have K distinct integers that sum to N, K is O(sqrt N)

    ok maybe not full solve idea, but it's a key observation that is part of the full solve