ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1086. Cryptography

<-- TLE? Look here! -->
Posted by Diego 12 Apr 2020 20:22
Hi everyone!

If you are getting TLE in Test #2 or maybe another, I would like to give you a little help:

-> Test #2 seems to give large numbers (like 15000), and it gives you those numbers in increasing order. Think about it.

Now, if that isn't enogh, I can give you a little more help:

-> Create an array / vector / list which will store the prime numbers you find.

-> Create an algorithm that determines whether a number is prime or not (remember to only       compare with odd numbers smaller than the square root of the number from which you are trying to figure out its primality).

-> Create a function that calculates the n-th prime number. For that create a counter which increases everytime you find a new prime number and store that prime number in your array / vector / list.

-> Finally, remember the thing I said at the beginning of this post! :D

Hope it helps. :D
Re: <-- TLE? Look here! -->
Posted by feather 27 Oct 2020 23:23
since it's recent enough, that gives some hope... honestly, i've done all of listed above, and yet it gives TLE. i'm so done with this... please help...