Merry (Early) Christmas Codeforces community!
We are excited to invite you to TOKI Regular Open Contest #17!
Key details:
- Rated for all
- Contest link: TLX (combined divisions)
- Time: 13 December 2020, 14:05 UTC
- Writers: FreeJinG Nyse juancarlovieri prabowo
- Duration: 2 hours
- Problems: 8
- Scoring distribution: 100 — 250 — 250 — 400 — 500 — 600 — 650 — 750
Finally, we would like to thank:
- prabowo for coordinating the contest.
- hocky for helping with problem preparation.
- Ace_02, nandonathaniel, MetalPower, TakeMe and coderbodoh for testing the problems.
- fushar for the TLX platform.
Please register to the contest, and we hope you will enjoy the contest!
UPD: The contest is over :)
Congratulations to our top 10:
Congratulations to our first solvers:
- A: yz_
- B: kotamanegi
- C: hitonanode
- D: hitonanode
- E: hitonanode
- F: hitonanode
- G: tourist
- H: tourist
You can access the editorial here (English version available on page 7)
The problems can be upsolved here
Thank you for participating and we hope to see you on the next TROC!
Prabowo and his owo children 0w0
Prabowo is my dad
I think Prabowo will feel deeply in shame.
Never knew you were my sibling
As neither a tester nor a participant, I hope everyone enjoys the contest.
Jokes aside, looking forward for this contest!
Wait, there's a TROC 16?
Wait, there's a TROC 15?
UwU
Friendly reminder that the contest will start in 3 hours :))
Good luck to all participants!
The Contest will start in 20 minutes. Good Luck and Have Fun!
After 35 minutes of the contest... I just want to say GG :v...
Can you move Constraints section right after Description/Input Specification in problem page?
How to solve D, didn't get from the editorials?
Let the indices $$$j$$$ such that $$$A_i = j$$$ be called special indices.
Let's iterate from the back (from $$$N$$$ to $$$1$$$).
Let $$$i$$$ denote the current iterated index, if $$$i$$$ is a special index, then there would only be one way of placing an element in that index, the maximum value that hasn't been used, or the minimum value that hasn't been used by the previous iteration.
For example:
Say that indices $$$3$$$ and $$$5$$$ are special indices.
When iterating on the index $$$5$$$, you can only place $$$5$$$ or $$$1$$$ depending $$$T_5$$$ (but it doesn't actually matter, since you still end up with one possibility anyway).
When iterating on the index $$$4$$$, since placing any elements that hasn't been used doesn't violate any conditions, we can consider $$$4$$$ ways of placing an element.
When iterating on the index $$$3$$$, you can only place the highest / lowest unused element, since not placing the highest / lowest unused element would lead to a violation of the conditions, i.e. $$$max(P_1, P_2, \dots, P_3)$$$ or $$$min(P_1, P_2, \dots, P_3)$$$ wouldn't be equal to $$$P_3$$$.
And so on...
Making the final answer: $$$4 \times 2 \times 1 = 8$$$.
In short, when $$$i$$$ is a special index, there could only be one element that satisfy the conditions, and in contrast, there could be $$$i$$$ elements that could satisfy the conditions when $$$i$$$ is not a special index.