|
|
back to boardwrong ans in case #3 Code removed Edited by author 20.08.2019 21:12 Re: wrong ans in case #3 8*n-7 <--- integer overflow Re: wrong ans in case #3 Integer overflow. But why? And How? Edited by author 17.08.2019 19:12 Re: wrong ans in case #3 [code deleted] This code gets wrong answer in case #3. Edited by author 18.08.2019 20:49 Edited by author 18.08.2019 20:49 Edited by moderator 17.11.2019 18:48 Re: wrong ans in case #3 On timus 'long int' is equal to 'int', to use 64-bit integers you need to write 'long long'. Also, there is a precision error in your 'per_sq' function. This line: return ((x-floor(x))?0:1); must be written as return (abs(x-floor(x)) > 1e-8 ? 0 : 1); Re: wrong ans in case #3 Thanks. I didn't know about the bit size of long in Timus. And what you said about the function. I had problem in the argument. I used double instead of int then it got accepted. |
|
|