sameThingButYouLikeKofar's blog

By sameThingButYouLikeKofar, 11 years ago, In English

as title says , i'm talking about http://mirror.codeforces.com/problemset/problem/327/B problem

that judged as TLE. my submission was only trying to print prime numbers

what are other sequences that aren't prime and aren't divisible terms ?

»
11 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

what method did you use to print the prime numbers? (there is one in NlogN, N being the range of the numbers) and the PNT guarantees that there exist about 10^5 < 10^7/ln(10^7) prime number <10^7, so why not prime numbers?

»
11 years ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Use sieve of Erathosphene. AC

»
11 years ago, hide # |
 
Vote: I like it +16 Vote: I do not like it
actually it has a simple nice solution :D
print(100000..100000+n);