sumankar wrote:Oh really!I never put any such special check though.Guess I was plain lucky.
My solution could behave badly for n=0,1,2 so I put an assert for n>99 and got a SIGABRT.
Simply removing the assert got AC although I didn't check if my solution was correct for such low values...
I dont know, but I'll assume we use different algorithms and for badly formed input we'll throw up different stuff, so there's not much chance that the judge solution can match them.Can you post your code...if you want to us
have a look?
sumankar wrote:I dont know, but I'll assume we use different algorithms and for badly formed input we'll throw up different stuff, so there's not much chance that the judge solution can match them.Can you post your code...if you want to us
have a look?
Basically I take the half of the input number and search the prime number next to it. For small numbers you have to assume wether 1 is prime or not, leading to different solutions based on the assumption.
CDiMa wrote:
Basically I take the half of the input number and search the prime number next to it. For small numbers you have to assume wether 1 is prime or not, leading to different solutions based on the assumption.
Yeah!I was hoping against hope that we differ.We don't