|
|
вернуться в форумHeavy-Light-Decomposition -> GOOD data structure! thank you all! 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 Actually it was the other way around :) except for ram usage SQRT: 0.437 11 532 KB HLD: 0.296 14 784 KB |
|
|