|
|
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 except: ERL TECS JS |
|
|
|
|