|
|
back to boardfor wa#10 Posted by vahan 14 Aug 2012 23:40 I had int n,i; and I had wa #10, then I changed them to long long and got ac, but I can't understand why I got wa10 with int n,i; where i and n can't exceed 10^6. Re: for wa#10 Same thing :( Re: for wa#10 It's obviously a mistake in task's text. Program won't be accepted until it will work with n=10e6. Re: for wa#10 Posted by esbybb 12 Sep 2015 11:31 thanks for your hint, helped me to get accepted verdict Re: for wa#10 When you divide at the end by n*(n - 1) it gets overflow so you need to have type long long Edited by author 31.10.2020 16:46 Edited by author 31.10.2020 16:46 Re: for wa#10 You need long long n. Because you divide at the end by n*(n - 1),n*(n-1) is overflow. |
|
|