Блог пользователя xiaowuc1

Автор xiaowuc1, 8 дней назад, По-английски

The first contest of the 2024-2025 USACO season will run from December 13th to December 16th. 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).

There are some new rules regarding the gold division of USACO, please refer to the website regarding the updates, especially if you are trying to promote into platinum.

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 December 13th. 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.

  • Проголосовать: нравится
  • +38
  • Проголосовать: не нравится

»
8 дней назад, # |
  Проголосовать: нравится -18 Проголосовать: не нравится

LGM when?

»
8 дней назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Are prewritten macros allowed?

»
8 дней назад, # |
  Проголосовать: нравится -22 Проголосовать: не нравится

phlap will ak gold in 15 minutes and take plat! Also, gggg0 and nyctivoe will ak platinum!

»
8 дней назад, # |
  Проголосовать: нравится +113 Проголосовать: не нравится

ugh i failed usaco dirt. the first problem, "even cows", was about finding if $$$N$$$ was even and the limits were $$$1 \leq N \leq 10^9$$$ and it was so hard. my first idea was to store an array of all even numbers in the world but it said memory limit exceeded for some unknown reason. then i realized exactly what the problem was. i was using to much memory!! so i reduced the array size to $$$10^5$$$, and it passed the sample test case :). but for the rest of the test cases, it had an exclamation mark for some reason. i must have not added enough for loops and recursion. so then i added infinite recursion and resubmitted, and was sooo disappointed when it time limit exceeded on the first test case :(. but at least the code ran, unlike when it was just a big fat exclamation mark, so it was an improvement i guess. but right as i was about to submit again, the 4 hr time limit passed, and i ran out of time. does anyone know how to solve this problem??

  • »
    »
    8 дней назад, # ^ |
      Проголосовать: нравится +24 Проголосовать: не нравится

    Man, you were so close! The ideia was to add random elements from the even array, so then the memory would be small. Here is my code, it passed after 1048576 submissions.

    https://pastebin.com/U3yUCLRU

    • »
      »
      »
      8 дней назад, # ^ |
        Проголосовать: нравится +24 Проголосовать: не нравится

      your code only have $$$\frac{\binom{499999999}{99999}}{\binom{500000000}{100000}} = \frac{1}{5000}$$$ probably to be correct, for 25 test cases, the probably to be pass will be around 3.3554432e-93, man your luck is hard core

  • »
    »
    8 дней назад, # ^ |
    Rev. 2   Проголосовать: нравится +8 Проголосовать: не нравится

    alright guys, I just want to share my deterministic solution, with 11*10+3 submission in worst case. firstly, we found N <= 1e9, but the digit of N <= 10, that's nice, so, we can read the N as string, and submit something that, if s[1] == sth(like '0'~'9', or 0 that the N's length may differ), and if so, do a infinite malloc so that you are surely getting MLE verdict, to differ this from others.

    now, we get the input testcases. now, we output YES or NO, for output testcases. then we got all of these, then the code will be like: switch(n) {case 12831728: case 2347238: puts("YES"); break; default: puts("NO");}

    I hope this will work.

  • »
    »
    5 дней назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
»
8 дней назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Does stack overflow count as language documentation or is that not allowed too

  • »
    »
    8 дней назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    nope, stack overflow isn't documentation. documentation is stuff like cppreference.com or the official Python docs

»
8 дней назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Can we use IntelliSense based IDEs? I couldn't find any information regarding this in the rules.

»
8 дней назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

praying for weak testcases :), it's like one of the best additions to usaco

»
8 дней назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

good luck everyone!

»
8 дней назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

If I don't mind my score being not certified, can I start the Platinum contest not on Saturday?

»
8 дней назад, # |
Rev. 3   Проголосовать: нравится -16 Проголосовать: не нравится

#

»
7 дней назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

does this mean i can never be Plat as I live in +8 time zone and needs to sleep early?

  • »
    »
    7 дней назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    may I ask what actually is this "12:00 ET" in +8 time? I searched it but no answer(I don't need to sleep early bruh)

    • »
      »
      »
      7 дней назад, # ^ |
      Rev. 2   Проголосовать: нравится +17 Проголосовать: не нравится

      It would be 1 a.m. here. So if I want to take the contest and try to promote to Plat (I'm gold now), I probably need to stay up to 6 a.m.

      I think it's a big problem for many Chinese and people in the whole Asia Pacific region.

      • »
        »
        »
        »
        7 дней назад, # ^ |
        Rev. 2   Проголосовать: нравится +5 Проголосовать: не нравится

        Note that you don't need a certified score to promote — the certification system is mostly to ensure contest integrity for participants eligible for the US IOI team. You can take the contest whenever you want.

        Edit: Nvm, I'm blind, the usaco website explicitly says "In order to promote from gold to platinum, your score must be certified."

        • »
          »
          »
          »
          »
          7 дней назад, # ^ |
          Rev. 2   Проголосовать: нравится +11 Проголосовать: не нравится

          "In order to promote from gold to platinum, your score must be certified." — you can find this on the official usaco website

          it doesn't apply for promotion from bronze to silver or silver to gold.

          • »
            »
            »
            »
            »
            »
            7 дней назад, # ^ |
              Проголосовать: нравится +5 Проголосовать: не нравится

            yeah, realized it a minute after posting 😭

            I guess I won't promote either ://

            • »
              »
              »
              »
              »
              »
              »
              7 дней назад, # ^ |
                Проголосовать: нравится 0 Проголосовать: не нравится

              or... you could come to the us for a 1 day vacation :)

        • »
          »
          »
          »
          »
          7 дней назад, # ^ |
          Rev. 6   Проголосовать: нравится -13 Проголосовать: не нравится

          ....

      • »
        »
        »
        »
        92 минуты назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        So sad,had you participated in the contest and advanced to Plat successfully?

»
7 дней назад, # |
  Проголосовать: нравится +12 Проголосовать: не нравится

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

»
7 дней назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

xiaowuc1 I am having a problem while recovering my old account and creating new account,I am not receiving the confirmation emails.

What should I do now??

»
5 дней назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Did USACO contest start as of now for bronze?

»
19 часов назад, # |
Rev. 3   Проголосовать: нравится +9 Проголосовать: не нравится

The USACO 2024 December contest has recetly ended. Results are being compiled and will be posted here shortly.

I guess we can start discussing problems.

How I solved ItsMooinTime in Platinum.

Spoiler
»
18 часов назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

How to solve the 3rd problem in the Platinum division? I got the $$$p_0 = \frac{n}{2}$$$ subtask, but I couldn't extend it.

  • »
    »
    18 часов назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I didn’t type code this contest, but here’s an outline of a P3 idea. I think it works, but I’m hoping intended is easier to code?

    If you wrote a brute force you probably had that when N is even there are two permutations, and the hard case is when N is odd. I had ugly casework on the position of N/2 (first, last, even in the middle, odd in the middle). N/2 has to be adjacent to 0 and/or N. Placing N/2 and 0 and/or N adjacent to it tells us which cells must have low numbers <N/2 and which must have high numbers >N/2. From there, for each case there's a way to place pairs in a certain order such that we have exactly two choices for each pair.

    For example, if N/2 appears first and the second number is 0 (the case where the second number is N is symmetric), we know N/2 + 1 can only be adjacent to 0 and 1, so it must either be in the third position or the last, with 1 adjacent to it. But then N/2 + 2 can only be adjacent to 0, 1, and 2, so we have to pick 0 or 1 to put it next to and then place 2 adjacent to it. And we can keep going until we've placed all the numbers.

    From here, for each case, each constraint implies two options of the form "once we place the i'th pair, it must be the x'th pair we placed on the left and there must be y pairs on the right", and we can compute the number of ways to satisfy all constraints using an O(N) dp (taking care to avoid inserting a log by sorting). This gives an O(N^2) sol.

    The annoying part is translating the constraints on the input into constraints on the way we place the pairs into the arrangement--this looks substantially different for all four cases and while it works, it seems painful to implement.

    • »
      »
      »
      17 часов назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      I think the case where $$$0$$$ follows $$$n/2$$$ and $$$n-1$$$ follows $$$n/2$$$ are symmetric, so we can turn every number from $$$x$$$ to $$$n-x-1$$$ to avoid half of the cases.

      Though it's still really hard to implement because if only one number is fixed in a pair, then there will be two cases and the dp has to take care of four kinds of transitions, which is really annoying. I spent 3 hours implementing this and finally managed to get is passed in the last few minutes.

      I feel like there should be some more elegant solution, because the way to fill in the pairs is literally "choose the leftmost or rightmost position" every time. Can anyone provide some easier solution?

      • »
        »
        »
        »
        8 часов назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        Agree re: symmetry. I also think that n/2 in the first position and n/2 in the last position should be symmetric via reversing the array of constraints. I don't see an easy way to do fewer than three cases, though (n/2 at beginning/end, odd position, even position other than beginning/end).

        • »
          »
          »
          »
          »
          79 минут назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

          $$$n/2$$$ at beginning or end is the same as the case of even position. When $$$n/2$$$ is at the beginning for example, the number of ways to fill in the rest is as if we had a virtual pair of $$$-1$$$ and $$$n/2-1$$$ and put it at the left of $$$n/2$$$.

»
18 часов назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

How to solve the first problem in platinum? (Actually I couldn't solve anything but people already asked the other two) I managed to pass subtasks up to $$$k\leq 18$$$ with some inefficient $$$O(k^32^k)$$$ SOS DP

  • »
    »
    18 часов назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Can you teach me? I just know the $$$O(3^k)$$$ solution.

    • »
      »
      »
      6 часов назад, # ^ |
        Проголосовать: нравится +5 Проголосовать: не нравится

      Pretty much what Geothermal said but I didn't manage to find a way to count the PIE constants so I ran an SOS for every number of set bits lol

  • »
    »
    18 часов назад, # ^ |
      Проголосовать: нравится +5 Проголосовать: не нравится

    I didn’t type code for this contest, but I think something like this should work?

    1. Count the contribution of each bit separately (i.e, count sum of 1/union over each possible bit in the intersection). Fix a bit and consider only input strings with that bit set.
    2. Run SOS to get the number of input bitstrings that are submasks of each possible bitstring.
    3. Multiply each value in the SOS output by a magic number depending on the number of set bits.
    4. Invert the SOS (i.e, run sum over supersets). For the right choice of magic numbers (constants which can be found through a PIE-like computation), this will get you the answer for each input bitstring.
  • »
    »
    18 часов назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Well, this is funny, I also only got up to k<=18 but mine is $$$O(k^22^k)$$$ XD

»
18 часов назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится

Solutions for USACO Bronze-Gold

Videos for USACO Bronze-Gold

Bronze: Problem 1, Problem 2, Problem 3

Silver: Problem 1, Problem 2, Problem 3

Gold: Problem 1, Problem 2, Problem 3

Bronze P1, Silver P2 and P3 as well as Gold P2 were quite nice

»
17 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

where can i upsolve ?

»
12 часов назад, # |
  Проголосовать: нравится +14 Проголосовать: не нравится