Osijek Competitive Programming Camp 2023 Day 8: Dilhan Salgado Contest Solutions
Otomachi_Una_ · · 个人记录
Problem A. And Xor Tree
Score:
Since we only care about squaring, we can enumerate the contributions generated by the two bits
Problem B. Balanced Permutations
Score:
I can't do it, and the official problem solution isn't very complete.
It's probably just that you build the Cartesian tree and find that it's pretty average. I'm not too good at the specifics.
Problem C. Cyclic Shifts
Score:
Good question!
You notice that
With parity sorting, we can use exactly
Problem D. Distinct Subsequences
Score:
Consider a subsequence automaton that matches greedily. The complexity is too high, how to optimise?
We split the original sequence into left and right solve segment, we return a few dp
Consider how the information returned by
- Case
1 : the subsequence only passes throughL . Superimpose theL information. - Case
2 : the subsequence passes throughR , so the beginning of the subsequence on that side ofR cannot be added toL .
This completes the transfer.
Using NTT convolutional optimisation this can be done
Problem E. Epidemic Escape
Score:
For a critical point
Pull out the convex envelope that surrounds
Problem F. Five Letter Warning
Score:
Enumerate the centre of the echo, assuming
Then you find that the time, space complexity is
You find that space can be rolled off, and time can be done in time
Problem G. Gridlandia
Score:
Constructed Question. Will not.
Problem H. Holiday Regifting.
Rating:
Actually, the order in which the elf hands out the gifts is not necessary. We can solve all the requirements of
Maintain
- If when
c_i|a_i , then just push the gift to the back. - Otherwise, we need to double time, specifically, doubling
\dfrac{c_i}{\gcd(a_i,c_i)} and then just doubling all thea_i that follow.
Time complexity
Problem I. Julienne the Deck
Scoring:
If
Problem J. Knight's Tour Redux
Score:
Slap this plane flat and only care about the transformations on your rows and columns. You find that only
You find that