created
last reply
- 3
replies
- 731
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 |
---|---|---|---|---|
What’s wrong in my code, in the problem Euclids algorithm revisited | Online Judge System | 2 | 257 | Jun '24 |
How to Tackle Difficult Problems on SPOJ? | Online Judge System | 1 | 262 | Jun '24 |
PALIN - wrong answer | Online Judge System | 1 | 85 | Mar 23 |
Username Invalid problem | Online Judge System | 0 | 42 | Apr 14 |