Page 3 of 3

10519 - RTE

Posted: Sun Jul 06, 2008 2:48 pm
by zyxw
I'm new to Java..
My code gets RTE.

Is my method of taking input wrong?
Please help :roll:

Code: Select all

cut after AC

Re: 10519 - Really Strange

Posted: Tue Nov 04, 2008 6:28 pm
by DD
dust_cover wrote:can anybuddy tell me what should be the output for inout 0 & 1.....I am getting WA.
I used BigInt library
Also used the standard formula for the problem!

Thanx in advance
To dust_cover:

You should output 1 if input is 0, and 2 if input is 1.

Hope this can help you.

Re: 10519 - Really Strange

Posted: Tue Nov 11, 2008 3:26 pm
by zyxw
This is REALLY STRANGE :oops:

The code which i posted in my previous post got WA today!
I don't understand how RTE changed to WA..
Anyway after correcting the error, got AC :)

Re: 10519 Very Strange... Key formula...

Posted: Tue Dec 23, 2008 9:33 pm
by mak(cse_DU)
soyoja wrote:I read previous article that the key formula for solving this problem is

"f(n) = n^2 - n + 2 ".

But I'm very anxious how can generate this formula....

Could anyone explain this principle?
I just count the number of intersection and add 2.
That means F(N)=number_Of_Intersection + 2;

How can we calculate number_Of_Intersection?
Just think that........
Using two circle we can make intersection.......
--------------------------------------------------------------------------
So select 2 circle from N circle= nC2.
Every two circle make 2 intersection.
so number_Of_Intersection=2 * nC2 .
F(N)=2* N*(N-1)/2 + 2
=>F(N) = N*(N-1)+2
=>F(N) = N*N - N + 2.

Special case:
0------------>1

Re: 10519 - Really Strange

Posted: Fri Dec 09, 2011 8:33 pm
by plamplam
Nice problem but lame description. It took me a lot of time just to understand what the problem-setter was saying. I suggest this problem-setter guy needs to learn how to communicate properly.
Best Regards.

Re: 10519 - Really Strange

Posted: Sat Mar 08, 2014 9:11 am
by uDebug
Here's some input / output that I found useful during testing / debugging.

Input:

Code: Select all

0
1
4589723412211934134013
1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
AC Output:

Code: Select all

1
2
21065561000606359857403149578459628309350158
999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002