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 1726. Visits

Show all messages Hide all messages

for wa#10 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 MOPDOBOPOT (USU) 29 Aug 2012 23:51
Same thing :(
Re: for wa#10 vtalgo14_boogakov 6 May 2014 12:00
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 Михаил Аршинов 12 Sep 2015 11:31
thanks for your hint, helped me to get accepted verdict
Re: for wa#10 LaVuna [KHNURE] 31 Oct 2020 16:45
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 hduads2020_19322111 5 Apr 2021 18:00
You need long long n.
Because you divide at the end by n*(n - 1),n*(n-1) is overflow.