Dear Codeforces community,
We are excited to invite you to TLX Regular Open Contest #33!
Key details:
- Contest URL: TLX
- Time: 1st July 2023, 21:05 UTC
- Writers: KindaNameless, kith14, SayedAulia
- Duration: 120 minutes
- Problems: 8
- Scoring distribution: 100 — 200 — 250 — 350 — 500 — 600 — 700 — 850
Many thanks to:
- steven.novaryo and Pyqe for their help in coordinating the round and in preparing the problem components.
- AMnu, Drew_, Faeee, and kayna for testing the contest.
- fushar for the amazing TLX platform.
Please register to the contest and we hope you will enjoy TROC #33!
Please help us improve TLX by filling out this survey.
UPD: Added scoring distribution.
UPD2: Contest is over!
Congratulations to the top 5:
rniya (same as the 4th rank)
Congratulations to our first solvers:
You can upsolve the problem here. Editorial is available in the upsolve link!
Thank you for participating and see you on the next contest!








Uwogh a TROC!
Uwogh a TROC!
Uwogh a TROC!
Uwogh a TROC!
Uwogh a TROC!
Uwogh a TROC!
Uwogh a TROC!
Uwogh a TROC!
Uwogh a TROC!
Uwogh a TROC!
Uwogh a TROC!
Uwogh a TROC!
Uwogh a TROC!
Uwogh a TROC!
Uwogh a TROC <3
Friendly Bump! Contest starting in 1 hour!
Don't forget to read all the problems! Good Luck Have Fun :D
Friendly reminder, the contest will start in about 20 minutes! Really hope you all enjoy the problems <3
Auto comment: topic has been updated by kith14 (previous revision, new revision, compare).
Auto comment: topic has been updated by kith14 (previous revision, new revision, compare).
I'd love to share an alternative solution to problem H. It's $$$O(n\log n)$$$ but I don't recommend anyone to try. I will tell you the reason later.
Consider the no-modify version, we can use naive centroid decomposition. The same as editorial' solution we get it offline to avoid any change of tree structure.
To achieve modification, we need to reuse the structure of divide and conquer. Each time we find the position to modify, we keep jumping upwards to the upper D&C layer and focus on its centroid. The information during the first naive centroid decomposition will be remained and maintained.
For each centroid, we maintain $$$cnt[x][d]$$$ meaning the number of vertex $$$y$$$ that satisfies $$$dis(x,y)=d$$$ in current D&C area. It's clear that only $$$O(n\log n)$$$ $$$cnt[][]$$$ will be used.
Additionally, don't forget to remove the contributions of non-simple path during the modification. That means you need another $$$cnt$$$.
If you choose hash table to precalculate distance between two vertexes, the total complexity will be $$$O(n\log n)$$$.
However, the constant factor is so EXTREMELY LARGE that it didn't even fit in the 4.0s TL. That's why I don't recommend it.