MarioYC's blog

By MarioYC, 7 years ago, In English,
I was looking at solution 810236 from hpfdf and also other users, who only for every query "add l r d" do a for loop from l to r and make at most two update operations in a BIT.

Why does this work? I think something like this would do more than 109 operations.
 
 
 
 
  • Vote: I like it  
  • +3
  • Vote: I do not like it  

7 years ago, # |
  Vote: I like it 0 Vote: I do not like it
I think the data is rondom,so the length of each query range is not large.I also used a BIT to solve this problem although it is not the best solution.
»
14 months ago, # |
  Vote: I like it -10 Vote: I do not like it

what exactly is almost lucky number? sorry if it is stupid but sb pls answer

»
14 months ago, # |
  Vote: I like it -8 Vote: I do not like it

I think that because of this condition:

The operations are such that after all additions the array won't have numbers that would exceed 104