Most probably the solution which was used for generating ans uses long long.
No
Most probably the solution which was used for generating ans uses long long.
No
https://www.codechef.com/viewsolution/33049526
This solution is giving Runtime Error(SIGSEV)
Can anybody help where i am going wrong
Why i is taken as 42 in the code?
Why is in tester’s solution the he is shifting till only 42…but not 64
because the max no of bits a long can have in this case is upto 40… i.e(2^40>10^12)
(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)
you are saying that you want to iterate over the whole range…that range is 0 to 10^12…of course it will give TLE as we can have at max 10^8 operations in a sec generally.
Not iterating but …2^64 would have 64 bits right?
yes bro
So to account for them we we would have to shift till 63.
Your solution is very close.
You are probably missing these cases.
1
33637 9437797 2334 25376
The correct output is 2917.
I am having the same problem. My brute force checker is giving the answer 15684 Can you check my submission? Its just for the second sub-task, but don’t know why is it failing.
Try these…
1
227040 37014 0 2
The answer should be 0.
In that case, we would return L, as otherwise, 0 can possibly be less than L and therefore, will be undermining the range.
Can anybody help
https://www.codechef.com/viewsolution/33031560
please provide me the test case in which it is failing for subtask 2
Try L = R = 0 in your code and try even try generating some random cases as well.
because 2 ^42 is > 10^12, which is the upper limit
thanks.