ALETHIO - Editorial

No but my question is that an algorithm has to be generic and valid for all kinds of test cases.What the test cases are is an altogether different thing.

i m getting 7028544864737656560892…and apparently it is correct…but still m not getting AC…:frowning:

both have the same digits and so logically yours is right @dush22

Try this : 0A000B99

2 Likes

Your atoi() cannot handle digits with a length of 1000.
Find some other mechanism for comparison.

thanks a lot…!!!

string can do it?

In C/C++ I guess thats the only way to do it.
Java provides you with BigInteger.
And python is the king in such cases…

1 Like

@malaykeshav finally got AC…thanks a ton dude!!!

7028544864737656560892 i’m also getting it’s correct but getting TLE in python code :frowning:

i’m also getting 7028544864737656560892 but it shows wa

try 0 or 000 there is no output!!!

see this link http://ideone.com/acvoy8

1 Like

Ohhh…I added the wrong link. I’ve changed that. And corrected for the above cases as well…Still not working.
And Now the code is less generic and more of test case driven…:-/

plz tell me why am i getting NZEC error in this code…http://www.codechef.com/viewsolution/2292156

the ans can have upto 1000 digits…you can not store it using an int and also the NZEC is due to number format exception!!!

@kunal361 thanx … but when i used biginteger then i got wrong answer…:frowning:

@d27v then you must be missing some corner cases.
Have you checked the points @prad_adm has posted above.

@prad_adm : Here is link to my submission, which got AC : http://www.codechef.com/viewplaintext/2290226

I had used long double to store the maximum.
Was it due to the test cases or long double is sufficient to store values upto 10^1000.

Was really surprised at AC. Initially I started with long long int, but got WA. Then I switched to long double.
Just curious to know.

@xnon Your code doesn’t produce any output for all zeroes.
Try 00000 or 0000000000 (any string of 0’s), there is no output.

long double can store huge numbers…but sometimes the precision may be lost!!!