omsincoconut's blog

By omsincoconut, 3 days ago, In English

I hope everyone enjoyed the tasks, and thank you for participating.

Thank you to the coordinators and testers for suggesting solutions and modifications to the tasks, as I alone wouldn't be able to solve my own tasks or make it to how it is right now. Also thank you to them for dealing with me since July.

Please tell me in the comments if the editorial is written incorrectly or unintelligibly somewhere. I'm not the best at phrasing some things, and would appreciate amendments to the editorial.

2078A - Final Verdict

Hint
Solution

2078B - Vicious Labyrinth

Hint 1
Hint 2
Solution
Extra

2077A - Breach of Faith

Hint 1
Hint 2
Solution
Note

2078D - Scammy Game Ad

Hint 1
Hint 2
Hint 3
Solution 1
Solution 2
Note

2077B - Finding OR Sum

Hint 1
Hint 2
Solution

2077C - Binary Subsequence Value Sum

Hint 1
Hint 2
Hint 3
Solution

2077D - Maximum Polygon

Hint 1
Hint 2
Solution

2077E - Another Folding Strip

Hint 1
Hint 2
Solution

2077F - AND x OR

Hint 1
Hint 2
Solution

2077G - RGB Walking

Hint 1
Hint 2
Hint 3
Solution

Some ending notes

Rating predictions
A small (?) story of this contest.
About Arcaea and the soundtracks
  • Vote: I like it
  • +60
  • Vote: I do not like it

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

For 1A/2C how does the given solution ensure that the missing number produced satisfies the given constraint of being less than 10^18? Wasn't that also a constraint for the missing number? Am I missing something obvious here?

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

    We see that the right hand side of the equation in the editorial is the sum of $$$n+1$$$ terms which are no greater than $$$1e9$$$, so this can't be larger than somewhere around $$$2e14$$$.

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

      Ahh right. I forgot to see the bounds for b_i and just assumed they were from 1 to 1e18. Thank you for the clarification!

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

    Yes, just see that the input value for array b doesn't exceed 1e9, and all the elements in b would be less that 1e9, so with some basic calculations it will give you that the missing value wouldn't exceed around 1e14.

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

can someone tell me why this div2 D solution doesnt work https://codeforces.net/contest/2078/submission/310325385 , its close but i dont know what is wrong with it

maybe i misread the problem at some point

thank you .

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

can someone please help me understand div2D DP editorial I just do not get it how is it working ?

  • »
    »
    12 hours ago, # ^ |
    Rev. 4   Vote: I like it +1 Vote: I do not like it

    The key idea is that you must decide where to assign your bonus people based not just on the very next gate, but on all the gates that come later. At first, it might seem that looking just one step ahead would work, but that only gets you close—not the full answer as you can see here https://codeforces.net/contest/2078/submission/310322360.

    Instead, you need to see the entire future. By processing the multiplication operations from the end (backward), you determine the best multiplier chain available for each lane. In simple terms:

    When you add bonus people at a gate, every multiplication that comes after will boost that bonus.
    By working backward, you figure out the maximum boost (or “suffix multiplier”) each lane can get.
    This future boost tells you how valuable it is to add bonus people at a specific moment, so you can make the best decision right then.

    In short, knowing the full future multiplier effect lets you reliably choose the best lane to assign your bonus people—because once they’re placed, you can’t move them later

    you can check my code here https://codeforces.net/contest/2078/submission/310327912

    where i just compute the greatest multiplying factor using a prefix sum-like approach

    so that i can greedily and reliably decide which lane to insert the bonus people and by having that you can do a normal dynamic programming approach

    i would also encourage you to try all the ideas in your head and see them fail so that you can clear the doubts and understand it perfectly

    Hope this helped :)

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

      Thanks a lot

      • »
        »
        »
        »
        91 minute(s) ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        your welcome , i just relaized that i didnt actually put the AC submission

        i edited it now

»
12 hours ago, # |
Rev. 2   Vote: I like it +16 Vote: I do not like it

In problem 1E, I don't think we can prove both $$$l,r$$$ should be in $$$s$$$.

We can only prove $$$l \in s$$$ and the last element $$$k \in s$$$ in $$$[l,r]$$$ has the same parity as $$$r$$$. For example, consider $$$a = [1,0,1]$$$, then $$$s = [1]$$$ but $$$l=1,r=3$$$. Of course in this case the following proof still holds so it doesn't matter much :)

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

    We can only prove $$$l \in s$$$ and the last element $$$k \in s$$$ in $$$[l, r]$$$ has the same parity as $$$r$$$.

    Yes, I had even mentioned it in the editorial but mistakenly wrote that $$$r$$$ should be present in $$$s$$$ as well. I have fixed it.

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

div2 D, DP solution. So hard to understand. Can't even understand the first sentence

»
2 hours ago, # |
  Vote: I like it +3 Vote: I do not like it

In case someone struggles to understand the $$$\binom{n}{i+cnt_0}$$$ thing like me, we can think it this way.

For a sequence A selected by $$$\binom{n}{i+cnt0}$$$, we form our sequence B by taking the 1s in A and the 0s not in A. Say A has $$$x$$$ 0s. So we have $$$(i + cnt_0 - x)$$$ 1s and $$$(cnt_0 - x)$$$ 0s in B. The score would be $$$(i + cnt_0 - x) - (cnt_0 - x) = i$$$. Namely what we'd like to achieve.

  • »
    »
    95 minutes ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Ohhhh, how is someone supposed to come up with something like this in contest tho?? Thank you so much, I've been trying to get deepseek to explain that derivation to me for the last half hour :_)

»
75 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it

I solved Div2 D like "mathematically on paper", storing "variables" at each step and, in the end, maximizing a certain function based on the upper bounds of those variables.

Let's say that in the i-th step, the total number of added people is x. In the next step, I assign y to the left gate and x — y to the right gate, ensuring that 0 <= y <= x. This process continues until the last step, where I sum up the values in the left and right gates and maximize the function.

To achieve that maximization, I looped through the coefficients from the last to the first, setting the variable to 0 if the coefficient was ≤ 0 or to its upper bound if it was ≥ 0