created
last reply
- 3
replies
- 734
views
- 4
users
- 2
links
5 years later
did you got the solution - pls share…
i understood this problem requires us to do preprocessing so when we query - we can use pre created vector which stores the sum of flowers starting from node V to node U(ancestor of V)
but can’t do this for each pair (U,V) so i think we should only do this for each pair (1,x) - and such vector for (U,V) can be written in terms of (1, V) , (1, U) and we can use binary search to find index where our suffix sum become greater than required
but how to handle point updates ?
I think you’re looking at a different problem. There are no flowers in HAPPYB4.
23 days later
Suggested Topics
Topic | Category | Replies | Views | Activity |
---|---|---|---|---|
Next Palindrome exception | Online Judge System | 1 | 76 | Mar 26 |
Username Invalid problem | Online Judge System | 0 | 59 | Apr 14 |