Sphere Online Judge

Computer geeks! Show off your skills and claim the job of your dreams! RecruitCoders.com

SPOJ Problem Set (challenge)

919. Prime checker

Problem code: PRIC

For this task you will have to check as many numbers as possible to see if they are prime. As not to make the problem I/O oriented, consider the numbers you should check in the following order: first take 1 and then construct the numbers in the sequence after the recursion: ai=(ai-1+1234567890) mod 231. Be careful not to use more than 4096 bytes of code.

Output

For each number you should write to output the digit "1" if the number is prime or the digit "0" if it is not prime.

Score

The score of your program will be the index of the first number in the sequence after which you do not have a correct answer. Because of some limitation you should not write more than 33 333 333 characters to output. If you reach this limit, your score will be adjusted in accordance to your runtime.

Example


Output:
01000000000000000000000000001000010000000001100000

should receive 50 points.


Added by:Gogu Marian
Date:2006-08-29
Time limit:25s
Source limit:4096B
Languages:All

hide comments
2011-12-01 16:44:44 David García Soriano
How is it possible to receive TLE in this problem? Is there a minimum number of correct digits one has to output?
2011-08-30 16:41:14 Jayanth Koushik
@Fadel did you return 0??
2011-07-18 17:50:18 Fadel SAAD
my code is 100% correct and the website give me runtime error (NZEC) ?????
SPOJ System © 2012 Sphere Research Labs | Projekty informatyczne i aplikacje na zamówienie. All Rights Reserved.