Ra1nWarden / Online-Judges

My solutions to various online judge problems.
0 stars 0 forks source link

10680 TLE #21

Open Ra1nWarden opened 9 years ago

Ra1nWarden commented 9 years ago

Cannot think of anything else to optimize. What I have done: for each n calculates all prime p and its corresponding m{p} such that p^{m{p}} is no larger than n. Multiply all these prime powers together (take modulo 10 first) For each multiplication, check a precalculated remainder map (map[i][j] stores the remainder for ith prime of power with remainder j)