Can someone please identify the problem with the submission 24848243 . It got hacked during the contest by Endagorion and I resubmitted it by removing the floor which I had used unnecessarily while computing total range for a given n. I don't think it should make a difference though. Resubmission ID : 24860951
Thanks in advance.
Auto comment: topic has been updated by eat_code (previous revision, new revision, compare).
Your Hacktest is
1125899906842623 1125899906742623 1125899906842623
I tested this on my Accepted Code. It prints 100001 on Codeforces but on Ideone and my PC it prints 50000.
Can someone please explain this ?
Even my code had the output 5000 for the hacktest. Also hacktest is one of the maintests(test 29)
I just changed log2() to my own LOG2() function and now its working fine.
Now I can see the reason why all top coders use their own log function. Never use C++ log() and pow() function or any similar function as it may give unexpected results on some machine.
I just added my own log function to your rejected code and now it gives correct output 100001 for the hacktest.
Oh..thanks. I'll take care about this in future
Yeah, even i noticed that.:( Lesson learnt though
1125899906842623=2^50-1. Perhaps it's because of the loss of significance when you use the floor.