Monday, September 29, 2014

ACM 1086. Cryptography / Криптография

    The 15000 the prime number is 160000 and something so we can find all the prime numbers up to 200000 and save them and then process the input. The fast way of finding the prime numbers from 1 to N is the sieve of Eratostenes which works for O(NlogN) time. You can find info about the sieve of Eratostenes here.


       FULL SOURCE CODE

No comments:

Post a Comment