ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1564. Counting Ones

WA10
Posted by Серовиков Андрей 13 Oct 2007 14:53
What's wrong, if the second test is 10^18?
Re: WA10
Posted by caoqinxiang 25 Oct 2007 18:27
the ones of 1 to 10^18 have over the range of int64
Re: WA10
Posted by Piratek-(akaDK) 16 Mar 2008 18:14
The number of ones is less than number of floor. For me tha answer must be in Int64
Re: WA10
Posted by Vedernikoff Sergey 17 Mar 2008 22:03
The answer is within Int64. So, try to find bug in your code or algorithm...
Re: WA10
Posted by Chmel_Tolstiy 18 Mar 2008 19:44
if you use line like this at TIMUS will a bug ...

long long INF = 1e18;

you should use

long long INF = 1e9;
INF *= INF;
Re: WA10
Posted by Denis Koshman 5 Aug 2008 06:23
Use unsigned __int64, might help. Also, if you use binary search, make sure that left+right does not overflow prior to /2 or >>1.
Re: WA10
Posted by Oksana (TNU) 19 Jan 2009 20:59
Chmel_Tolstiy wrote 18 March 2008 19:44
if you use line like this at TIMUS will a bug ...

long long INF = 1e18;

you should use

long long INF = 1e9;
INF *= INF;

Thank you!
Re: WA10
Posted by alp 23 Feb 2011 21:32
Try this test
12
Answer 19 (not 20)