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 1502. Domino Dots

Test
Posted by Zeva [USU] 28 Oct 2006 17:07
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
Posted by emotional blind 28 Oct 2006 17:30
Did you use "long long"
Re: Test
Posted by emotional blind 28 Oct 2006 17:31
Did you use "long long"?
Re: Test
Posted by Madiyar Tursunbayev 29 Oct 2006 12:11
Just use int64 instead of longint;
Re: Test
Posted by Todor Tsonkov 30 Oct 2006 16:02
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
Posted by USTU-FTF KOIBAS Team 30 Oct 2006 16:30
I got Accepted using BrutForce!!!
Re: Test
Posted by Todor Tsonkov 30 Oct 2006 17:02
Already solved this problem, read the hint below :)

Edited by author 30.10.2006 21:20
Re: Test
Posted by N.M.Hieu ( DHSP ) 30 Oct 2006 18:28
Yes , me , too .
WA#5 but AC now , you should change "int n" into "long long n" .
Re: Test
Posted by Todor Tsonkov 30 Oct 2006 21:20
Yup, 10x pal, you saved me from reading again and again this task and to wonder where I was wrong :)
WA on 5
Posted by Alexander Prokazyuk (TKTL) 2 Nov 2006 07:17
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
Posted by Anton [SUrSU] 2 Nov 2006 11:49
This is my formula
  for (int i = 0; i <= n; ++i)
    res += (i + n) * (n - i + 1) / 2 + i * (n - i + 1);
Re: Test
Posted by Petromil Petkov 10 Nov 2006 01:00
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
Posted by Mihran Hovsepyan <<RAU>><<1 kurs>> 8 Nov 2007 16:00
Delete your AC code.
Re: Test
Posted by ImranYusubov 29 Feb 2008 15:06


Edited by author 02.03.2008 12:53
Re: Test
Posted by ImranYusubov 29 Feb 2008 15:07


Edited by author 02.03.2008 12:54
Re: Test
Posted by foodie 30 Jul 2013 17:55
senks bro