|
|
вернуться в форумWhat's wrong, if the second test is 10^18? the ones of 1 to 10^18 have over the range of int64 The number of ones is less than number of floor. For me tha answer must be in Int64 The answer is within Int64. So, try to find bug in your code or algorithm... if you use line like this at TIMUS will a bug ... long long INF = 1e18; you should use long long INF = 1e9; INF *= INF; Use unsigned __int64, might help. Also, if you use binary search, make sure that left+right does not overflow prior to /2 or >>1. 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! Try this test 12 Answer 19 (not 20) |
|
|