|
|
вернуться в форумПоказать все сообщения Спрятать все сообщения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. It's obviously a mistake in task's text. Program won't be accepted until it will work with n=10e6. thanks for your hint, helped me to get accepted verdict 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 You need long long n. Because you divide at the end by n*(n - 1),n*(n-1) is overflow. |
|
|