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

Автор kith14, история, 3 года назад, По-английски

Dear Codeforces community,

We are excited to invite you to TLX Regular Open Contest #33!

Key details:

Many thanks to:

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:

  1. hitonanode

  2. errorgorn

  3. SSRS_

  4. noimi

  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!

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

»
3 года назад, скрыть # |
 
Проголосовать: нравится +42 Проголосовать: не нравится

Uwogh a TROC!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +39 Проголосовать: не нравится

Uwogh a TROC!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +46 Проголосовать: не нравится

Uwogh a TROC!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +45 Проголосовать: не нравится

Uwogh a TROC!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +47 Проголосовать: не нравится

Uwogh a TROC!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +37 Проголосовать: не нравится

Uwogh a TROC!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +28 Проголосовать: не нравится

Uwogh a TROC!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

Uwogh a TROC!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +27 Проголосовать: не нравится

Uwogh a TROC!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

Uwogh a TROC!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

Uwogh a TROC!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +28 Проголосовать: не нравится

Uwogh a TROC!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +20 Проголосовать: не нравится

Uwogh a TROC!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +23 Проголосовать: не нравится

Uwogh a TROC!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

Uwogh a TROC <3

»
3 года назад, скрыть # |
 
Проголосовать: нравится +39 Проголосовать: не нравится

Friendly Bump! Contest starting in 1 hour!

Don't forget to read all the problems! Good Luck Have Fun :D

»
3 года назад, скрыть # |
 
Проголосовать: нравится +21 Проголосовать: не нравится

Friendly reminder, the contest will start in about 20 minutes! Really hope you all enjoy the problems <3

»
3 года назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

Auto comment: topic has been updated by kith14 (previous revision, new revision, compare).

»
3 года назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

Auto comment: topic has been updated by kith14 (previous revision, new revision, compare).

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

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.

see: