Input
- Code: Select all
10
100
10000
503
101
9999
997
412
586
777
8764
My Output
- Code: Select all
53
5003
257
53
5003
499
211
307
389
4391
Thx in advance
Moderator: Board moderators
10
100
10000
503
101
9999
997
412
586
777
8764
53
5003
257
53
5003
499
211
307
389
4391
Antonio Ocampo wrote:Hi fellows, could someone give me the output for this inputs ??
sumankar wrote:Oh really!I never put any such special check though.Guess I was plain lucky.
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?
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.

Users browsing this forum: No registered users and 1 guest