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 1118. Nontrivial Numbers

Some tips (got AC using 0.031s)
Posted by Adrian 3 Oct 2010 19:35
First, triviality of 1 is 0.
Second, we can judge number i from 2 to 1000000, if i is a prime number, then prime[i] is true.
Third, we traversal i from b to a, because if j>i and prime[j]==true, prime[i]==true, we can get 1/j<1/i.
if we get prime[i]==true,just output it and break.
if we can not get such a number, calculate triviality of i and output the minimum.

Thus, we can get AC with a little time spended,but larger memory.

My English is poor, if you cannot understand me, I would say sorry for it.^__^
Re: Some tips (got AC using 0.031s)
Posted by Egor Stepanov 30 Dec 2012 03:02
your english are good)
i got it.
may be i got it because my solution is similar yours=)
Re: Some tips (got AC using 0.031s)
Posted by Egor Stepanov 30 Dec 2012 03:02
but i got AC using 0.1s
Re: Some tips (got AC using 0.031s)
Posted by Ivan Metelev 25 May 2016 14:37
Your english good enouth to speak with Russians)