ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1553. Caves and Tunnels

AC at least, but for me this problem very strange!
Posted by xurshid_n 25 Jun 2012 17:39
Heavy-Light-Decomposition -> GOOD data structure! thank you all!
Re: AC at least, but for me this problem very strange!
Posted by Solver 4 Jun 2026 11:35
sqrt(n) decomposition also works here (0.5 sec) and easier to implement
it's actually does not differ much because heavy-light with segment/fenvick over chains will be something like Q*log^2(N) with bad constant over it
Re: AC at least, but for me this problem very strange!
Posted by Solver 4 Jun 2026 12:33
Actually it was the other way around :) except for ram usage
SQRT: 0.437    11 532 KB
HLD:  0.296    14 784 KB