Repunit
Problem 129 is easy to brute force. Some observation is required to make this problem simple and easy. This problem is very closely related to problem 26.
Problem 130 is also very simple. If we do not care to use brute force, the result can be found in 20ms or so. But smq and hk extended the problem to the limit of 2500. The problem becomes extremely time costly. I tried the limit = 1000, needs 10 seconds. limit 2500 needs 79 second. I do not want to waste time to 2500 since it takes more than half an hour.
Problem 132 is quite simple if one reviewed the discussion thread of problem 129 and 130. I generated all primes up to 500K, and it just take 50ms to find the first forty prime factors. In the discussion thread, daniel.is.fischer asks the sum of prime factors below 1e9. I tried it, it is quite difficult, my code runs for near 6 minutes to get the answer. I did not figure out how they made it to 1 minute.
Problem 133 looks like quite different, but still the same thing. Solved it under 20 ms.
No comments:
Post a Comment