### MarioYC's blog

By MarioYC, 11 years ago,
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.

• +3

 11 years ago, # |   0 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.
 » 4 years ago, # |   -10 what exactly is almost lucky number? sorry if it is stupid but sb pls answer
•  » » 3 years ago, # ^ |   0 It is a condition given in the problem statements of codeforces beta round 91. If you read any problem statement from this round I hope you will understand.
 » 4 years ago, # |   -8 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
 » 18 months ago, # |   0 Can you please provide testcase 26 of A problem
•  » » 18 months ago, # ^ |   0 799
•  » » » 18 months ago, # ^ |   0 i am also stuck in the same test case and i think it is wrong ie 799 in problem https://codeforces.com/problemset/problem/122/A
•  » » » » 18 months ago, # ^ |   0 Hello! For 799 the answer would be "YES" because it is divisible by 47 which is a lucky number. The question asks that it should be divisible by any lucky number and not necessarily just 4 or 7. Hope this helps.
 » 18 months ago, # |   -10 I think if code give "YES" for 141(input) then it will also work fine for test case 26(799).141/47=3141 is not lucky 47 is lucky141 gets evenly divided by 47
•  » » 15 months ago, # ^ |   0 yes Thank you
 » 4 months ago, # |   0 Wont 74 be a lucky number too? one of the solution gives NO for it and it is accepted.
•  » » 3 months ago, # ^ |   0 74 is a lucky number, Test cases might not contain dividend of 74