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

Автор woofwoof321, история, 7 лет назад, По-английски

I asked this from the best coder of my college and he was totally clueless and so am I. This is the question: https://mirror.codeforces.com/problemset/problem/4/A. My approach is to use a segment tree of balanced binary search trees and then apply heavy-light decomposition and binary lifting but it gives wrong answer on test 1.

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

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

Same doubt. woofwoof321

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

Please sir, help me!

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

I have also used similar approach and solved the problem. Actually you are doing it wrong you have to just create the equivalent binary tree and apply centroid decomposition on that tree. Final answer will be stored in a sparse table. I hope it helps. woofwoof321

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

nishantwrp Wow! Your approach is much simpler and way more intuitive than the one given in the editorial. Thanks for sharing such an awesome approach with the rest of the Codeforces community!

»
7 лет назад, скрыть # |
 
Проголосовать: нравится -18 Проголосовать: не нравится

woofwoof321 , Jimmy Neutron, boy genius

»
7 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится -33 Проголосовать: не нравится

Edit: sorry if I have offended anyone, I was just trying to meme it up.

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

what is this? a bullshit blog get 22 upvote?

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

I did the following: maintain a cartesian treap for each node in the graph and compute the number of hamiltonian paths after compressing the SCC's. This is a standard technique taught in my hometown of Area 69.