Test
1000 => 501501000
500 => 62875500
333 => 18629685
1 => 3
3 => 30
4 => 60
But Wa#5
Edited by author 28.10.2006 17:09
Re: Test
Posted by
ФерПИ_2 28 Oct 2006 17:21
The same with me: WA#5 can anybody tell me why
Re: Test
Did you use "long long"
Re: Test
Did you use "long long"?
Re: Test
Just use int64 instead of longint;
Re: Test
My solution is very short and I also get WA5, my answers are the same as those posted, can anyone give some hint ?
Re: Test
I got Accepted using BrutForce!!!
Re: Test
Already solved this problem, read the hint below :)
Edited by author 30.10.2006 21:20
Re: Test
Yes , me , too .
WA#5 but AC now , you should change "int n" into "long long n" .
Re: Test
Yup, 10x pal, you saved me from reading again and again this task and to wonder where I was wrong :)
WA on 5
Who can find my mistake?
[code deleted]
it passes all my tests, but it can't pass 5
Edited by moderator 29.12.2006 09:16
Re: WA on 5
This is my formula
for (int i = 0; i <= n; ++i)
res += (i + n) * (n - i + 1) / 2 + i * (n - i + 1);
Re: Test
Thanks for the advice. Could you tell me what brings this change? n=10000 fits in an int, doesn't it?
Ha! Got accepted only with __int64 and not with long long... my djgpp returns a compilation error on such a line... could anybody explain me what should that be?
Edited by author 10.11.2006 01:16
Re: WA on 5
Posted by
Leonid 30 May 2007 18:01
This one is mine:
n*-~n*-~-~n>>1
Have fun!
Re: WA on 5
Delete your AC code.
Re: Test
Edited by author 02.03.2008 12:53
Re: Test
Edited by author 02.03.2008 12:54
Re: Test
Posted by
foodie 30 Jul 2013 17:55
senks bro