xiaowuc1's blog

By xiaowuc1, 3 months ago, In English

The first contest of the 2025-2026 USACO season will run from January 9th to January 12th. Good luck to everyone! Please wait until the contest is over for everyone before discussing anything contest-related (including but not limited to your scores or anything about the problems).

For US high school students vying for IOI, there are some new rules regarding the format this year, please refer to the website regarding the updates.

For those unfamiliar with the USACO contest format, please refer to the contest instructions and rules. We provide a short FAQ but folks should read all the rules carefully.

I have a question about the contest. Where do I ask it?

Email the contest director via the instructions above. Do not post anything publicly about the questions (including but not limited to your scores, how you felt about the problems, any content of the problems, etc) until after the contest is over for everyone. Do not DM me or anyone else affiliated with USACO, only the contest director can assist you. The contest director does not monitor Codeforces, this blog post is merely a courtesy to inform other people of the contest.

When can I enter the contest?

For bronze and silver, the contest will open on January 9th. For gold and platinum, the contest opens at 12pm ET on Saturday, and you must start the contest between 12pm and 12:15pm ET on Saturday to get a certified score.

If I submit multiple programs, which one gets evaluated?

Only the last submission will be evaluated for official scoring purposes.

Can I use prewritten code / templates?

No.

Can I use AI tools during the contest including but not limited to ChatGPT and Copilot?

No.

Am I allowed to use outside resources during the contest?

You may only refer to language documentation.

Can I solve problems in Rust?

No, the only languages supported are C, C++, Java, and Python. Consult the instructions for language-specific technical details.

Will Rust support be added?

Probably not. Petition IOI to add Rust support first.

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

»
3 months ago, hide # |
 
Vote: I like it +14 Vote: I do not like it

No Rust support, tragic news for the unemployed.

»
3 months ago, hide # |
 
Vote: I like it +23 Vote: I do not like it

An important note that I see a lot of people miss, the USACO grader is whitespace sensitive, so having an extra space at the end of a line can give you WA.

Also, best of luck to everyone!

»
3 months ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

Good luck everyone!

»
3 months ago, hide # |
 
Vote: I like it -9 Vote: I do not like it

fahhh

»
3 months ago, hide # |
 
Vote: I like it +16 Vote: I do not like it

I think the contest is ended for everyone, so I can write:

After the contest, my friend said we can do dsu + offline for Problem A in Gold easily. But I didn't think that in the contest. And I write an online solution in the contest with euler tour + segtree solution. For anyone interested in my code during the contest: https://pastebin.ubuntu.com/p/ZzrnskvQm8/

Firstly, I didn't notice everyone was demoted to gold from plat, and I didn't really expect to get a great score in plat, and it was held on the night in my time zone, so I postponed the contest. And I joined the contest after; I didn't notice I was solving gold problems until I AKed the contest lol. Next time, please write it more noticeably (if you think it is really noticeable, sorry I didn't notice).

  • »
    »
    3 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    I also overcomplicated p1

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I spent three hours on the segtree soln too.

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I’m in the same boat with SegTree. TBH, when it dawned on me that the problem could be handled offline, I properly kicked myself. I should've spent more time on the strategy first cos the offline logic is so elegant. That said, if a problem has multiple ways to be solved, I reckon any valid algorithm that gets the job done in a timed contest is a win : )

»
3 months ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

The contest has ended. Is it possible to access the statements today?

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Honestly thought the silver problems were harder than expected.

P1 was all maths, and I spent 2 hours on it and got ac

P2 was even worse, wth was it even testing? Could only get 1/10 test cases.

P3 was okay, but I missed 2 lines in my O(n) solution:(. Got 3/10 for a subtask.

So ig I'm not passing silver this time:(

Anybody have any thoughts for doing p2?

  • »
    »
    3 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it +3 Vote: I do not like it

    700 cutoff :pray: (i got exactly 700 lmao)

    1,3 ac 2 literally only the first non sample tc

  • »
    »
    3 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    P2: Each connected component is independent, so consider one of them. Let's fix one node in the CC to have the value $$$x$$$. Then, note that all nodes will have values of the form $$$x+c$$$ or $$$-x+c$$$ for some constant $$$c$$$.

    Case 1: If the CC is not bipartite, I claim that if the answer exists, it is unique. This is because if you try to color the CC with two colors, you will eventually reach a node that has a color contradiction, in which case it can be represented as $$$-x+c_1=x+c_2$$$ (check for divisibility by 2 as well) so you can solve for $$$x$$$. Now plug in this $$$x$$$ value and check that there is no contradiction (otherwise the answer is -1) and get the number of constraints that it satisfies.

    Case 2: If the CC is bipartite, then nodes of one color will be of the form $$$x+c$$$ and nodes of the other color will be of the form $$$-x+c$$$. We can calculate these $$$c$$$ values and check that there is no contradiction (otherwise the answer is -1). When there is no contradiction (check that the same node does not have multiple $$$c$$$ values), we will try to find $$$x$$$ that maximizes the number of constraints satisfied. Note now that the constraints for each node to be satisfied are of the form $$$l\leq x\leq r$$$ for some $$$l,r$$$. Now you can sort in order of these values of $$$l,r$$$ for this CC and sweep from small to big to find the maximum number of satisfied constraints over all possible values of $$$x$$$.

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Is p2 the one with $$$a_x+a_y=z$$$ condition?

    Hint
    Solution
  • »
    »
    3 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    If i remember it correctly the problem was to find such array s of size n such that

    All m statements a, b, sum are correct s[a] + s[b] must be equal to sum

    we need to maximize number l[i] <= s[i] <= r[i] (array l and r are given in input).

    Spoiler
  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it +3 Vote: I do not like it

    Problem 2 was my favorite problem of the silver contest. Good work AksLolCoding!

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    3 hours for P2, passed, but the time ran out before I worked out the solution for P3 :(

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I thought of some sort of connected components idea. If you set a number for one of the nodes, you'll be able to figure out all of them. Couldn't get it to pass all test cases, got most of them tho. Solved the 3rd problem after implementing a wrong solution for so long lol. Sadly couldn't get AC on the 1st problem, didn't have enough time even though my solution was correct :(

»
3 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

When will results be finalized? I was hoping to look at the Bronze/Silver problems from this contest.

»
3 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

sold so hard :(. got to lock in for second contest

»
3 months ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

When will I be able to submit again?

»
3 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Does the rule of certified results apply to only in-contest promotion or to promotion in general?

If the answer is promotion in general, it is so unadvantageous to hobbyists like me who lives in half the globe away: we cannot wake up at... e.g. 5am just to make sure we could have a chance to advance to the Platinum division, and it is unincentivized to some non-official participants if we always get stuck to an easier problemset.

»
3 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

I got my first AK in the Gold Division and was promoted to Platinum in this contest.

(The bed time for Chinese :((( )

The contest is interesting,thanks the contest.

P1 can be solved with offline processing and DSU.

P2:

The optimal solution for the second problem must be to arrange the elements in a V-shape with smaller numbers in the middle.

P2 also has a similar trick to 2129B (the contribution of each element is independent).

P3: DP + Segment Tree only, the easiest in Gold Division.

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    can you elaborate your P2 solution?

    also is it random guess that solution is V-shape form?

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      First, we note that the final sum is equivalent to each element multiplied by a weight, where these weights are $$$\frac{1}{2},\frac{1}{4},\cdots,\frac{1}{2^{n-1}},\frac{1}{2^{n-1}}$$$ respectively. We aim to multiply smaller numbers by smaller weights and larger numbers by larger weights. Thus, assuming $$$a$$$ is already sorted in ascending order, we merge $$$a_1$$$ and $$$a_2$$$, then merge the result with $$$a_3$$$, followed by merging the new result with $$$a_4$$$, and so on until all elements are merged. To achieve this, a V-shaped merging sequence is required.

      Here's my full solution.

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Why people want to add rust (i think c++ is ENOUGH for most problems)?

»
3 months ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

Platinum is math-math-math.

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    how to solve P1

    It's too difficult for me.

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it +8 Vote: I do not like it

      Note that

      $$$ p_1 h_2 + s_1 p_2 + h_1 s_2 \gt p_2 h_1 + s_2 p_1 + h_2 s_1 $$$

      is equivalent to

      $$$ (s_1 - h_1)(p_2 - h_2) \gt (p_1 - h_1)(s_2 - h_2) $$$

      Then by transforming $$$(h,p,s)$$$ into $$$(s-h,p-h)$$$, it becomes a 2D problem of finding three vectors $$$\mathbf{x},\mathbf{y},\mathbf{z}$$$ such that

      $$$ \mathbf{x} \times \mathbf{y} \gt 0, \mathbf{y} \times \mathbf{z} \gt 0, \mathbf{z} \times \mathbf{x} \gt 0 $$$

      which can be solved using two-pointer + prefix sum.

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    In PC, it needn't ensure $$$\sum R$$$ and $$$\sum C$$$ is under $$$10^6$$$.

    Fun fact: I think $$$R,C\le2\times10^9$$$ and there are no limits on $$$\sum$$$ of them and got a $$$O(\sum X\log X)$$$ solution. However, this solution's code is very long and I can't debug it out during the contest.

»
3 months ago, hide # |
 
Vote: I like it +56 Vote: I do not like it

I really think that requiring plat promotion to be certified yearly and for everybody is a bit too strict. Of course it helps maintain fairness, which is probably very important for US participants competing for a spot in the national team, but I think the current rules deprive many international plat-level participants of the chance to participate in a competition of their level. It is much easier to adapt your schedule once to participate in certified gold, and then compete in plat whenever you want, rather than yearly.

That being said, I’d like to propose a solution. It goes as follows: make plat promotion possible even without a certified result (but still yearly!), provided that the student had already achieved a certified promotion in another year or achieved significant plat results in the past. Or, at least, do this for non-US participants, who both have lower stakes of competing and might suffer due to time zone differences.

I’m really looking forward to hearing your opinions on this!

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it +16 Vote: I do not like it

    USACO is, by definition, not intended to serve foreign students. It just happened that the past format was convenient for different timezones, and the new format isn't. You can upsolve or virtual USACO problems on the website or qoj, just like how we can upsolve or virtual your country's OI.

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it -26 Vote: I do not like it

    Back when I was practicing it took less than 2 hours to sweep from bronze to plat so I think it doesn't matter if you're really plat-level.

»
3 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Every gold problem had an unintended segtree solution...

»
3 months ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

I'm going live to discuss Gold and Platinum problems today https://www.youtube.com/watch?v=rVSmZjyvC5A

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

S2 is easy to think and s**t to code.

»
3 months ago, hide # |
 
Vote: I like it -8 Vote: I do not like it

First USACO contest here. Did anybody find the bronze problems more difficult? I thought it felt much harder than compared to bronze in years past. To this point, I am still confused on problem 1. It seem simple of on the surface, but you need to do each test case in basically constant time. I don't see how you could do it without deriving a full mathematical floor equation analysis and also implementing something like a binary search to find the min x, but I mean that can't be it cuz its just bronze right (I might sound dumb lol) I was wondering if anyone could please explain how to do it.