|
|
back to boardFirst, 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.^__^ your english are good) i got it. may be i got it because my solution is similar yours=) Your english good enouth to speak with Russians) |
|
|