Page 2 of 2

10521

Posted: Mon Sep 06, 2004 8:02 pm
by Eduard
Hello.
I'm getting TLE forr this problem can't understand why.I think there is some special cases.Because I solve problem 834 and my program is giving right answers for this kind of tests.
Input

Code: Select all

-5 7 
34 -64 
9 -5 
-33 -57 
123456789123456789 987654321 
55555555555555555555 66666666666666666666 
Output

Code: Select all

-5/7=-1+1/{3+1/{2}} 
34/-64=-1+1/{2+1/{7+1/{2}}} 
9/-5=-2+1/{5} 
-33/-57=0+1/{1+1/{1+1/{2+1/{1+1/{2}}}}} 
123456789123456789/987654321=124999998+1/{1+1/{70+1/{9+1/{2170+1/{2+1/{1+1/{2+1/{1+1/{1+1/{1+1/{2}}}}}}}}}}} 
55555555555555555555/66666666666666666666=0+1/{1+1/{5}}
If somebody can help please tell me what can be reason of TLE.
Thanks.

10521 Why WA?

Posted: Sun Oct 10, 2004 10:20 pm
by lovemagic
i think Q!=0,is it?
Is input terminated by EOF?
Here's some test cases.Where's the wrong?

-0 10
0 -10
-00 -100
-5 -5
-5 5
5 5
5 -5
-0000001 1
10 -01
123465417841234654 324324535293485945680579670
1111111 23243546534965867569756
348256345439658746 234234324
-12323214 2131234857943657
63214612 -0000213217362137658876876

my WA code gives----

0/10 = 0
0/-10 = 0
0/-100 = 0
-5/-5 = 1
-5/5 = -1
5/5 = 1
5/-5 = -1
-1/1 = -1
10/-1 = -10
123465417841234654/324324535293485945680579670 = 0+1/{2626845160+1/{12+1/{1+1/{1+1/{11+1/{1+1/{2+1/{6+1/{8+1/{2+1/{1+1/{3+1/{1+1/{1+1/{6+1/{1+1/{5+1/{6+1/{3+1/{1+1/{94+1/{1+1/{4+1/{2+1/{1+1/{1+1/{2+1/{1+1/{1+1/{3+1/{4+1/{2+1/{1+1/{1+1/{1+1/{20}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
1111111/23243546534965867569756 = 0+1/{20919193973388678+1/{6+1/{1+1/{1+1/{2+1/{6+1/{1+1/{1+1/{34+1/{1+1/{5+1/{1+1/{9}}}}}}}}}}}}}
348256345439658746/234234324 = 1486786135+1/{1+1/{2+1/{1+1/{45+1/{1+1/{3+1/{4+1/{4+1/{17+1/{1+1/{1+1/{1+1/{1+1/{5+1/{1+1/{14}}}}}}}}}}}}}}}}
-12323214/2131234857943657 = -1+1/{1+1/{172944724+1/{7+1/{1+1/{2+1/{2+1/{78+1/{1+1/{4+1/{2+1/{1+1/{10+1/{1+1/{1+1/{3+1/{2}}}}}}}}}}}}}}}}
63214612/-213217362137658876876 = -1+1/{1+1/{3372912612950+1/{1+1/{6+1/{1+1/{12+1/{7+1/{2+1/{2+1/{2+1/{3+1/{1+1/{1+1/{2+1/{3+1/{3+1/{3+1/{2}}}}}}}}}}}}}}}}}}

Are there any critical test case?

Posted: Tue Aug 22, 2006 7:09 am
by Darko
This problem helped me find a bug in my BigInt:

Input (should be one line, maybe it's wrapped):

Code: Select all

00000000000000000123456789123456789123456789123456789 -123456789123456789123456789123456789123456789
Output (same thing, should be one line):

Code: Select all

123456789123456789123456789123456789/-123456789123456789123456789123456789123456789 = -1+1/{1+1/{999999999+1/{1000000001000000001000000001}}}