原题目:
解题思路:
代码:
void solve() {ll i, j,k,x,y,z,p,q,u,v;N = 1000000, NN = 1024;//N = 20;double a, b, c,d;M.NT.get_prime_Euler(2000000);for (i = 2; i < N; i++) {x = (i-1)%9+1;for (j = 2; j<=sqrt(i); j++) {if (i % j == 0) {x = max(x, A[j] + A[i / j]);}}A[i] = x;ans1 = ans1 + x;if (i % 10000 == 0) {printf("%lld\n", i);}}printf("%lld\n",ans1);
}