JOIN
Get Time
forums   
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat (newest first)  | Threaded  | Tree
Previous Thread  |  Next Thread
did any one | Reply
did any one try to solve 310 div1 500

with BIT

i solved it with segment trees and i get the worst time aroun .7 sec

i used BIT instead of segment trees and TLE...

....
Re: did any one (response to post by vlad_D) | Reply
I solved it using similar structure.
Click here

Edit:

Known bugs:
should be
res-=h[l];
instead of
res+=h[l];
in sum().
Luckily it doesn't matter because I only used sum(1,X)

Conclusion: have it prewritten to avoid such misprints :)
Re: did any one (response to post by vlad_D) | Reply
The worst test case runs under 0.2 sec at me (I think 0.144). I made mistake while I indexed values, so maybe it is your mistake (note that value can be 0).

EDIT: Note that I just copied code from tutorial.
RSS