原题目:
题目大意:
解题思路:
代码:
void serch(ll I,ll sum,ll used) {
ll i, j, l, x,y;
for (i = 1; i < I; i++) {
if (sum * D[i] > N)break;
x = sum * D[i];
y = N / x;
if (used % 2 == 0) {
ans1 = ans1 - y;
}
else {
ans1 = ans1 + y;
}
serch(i, x, used + 1);
}
}
void solve() {
ll i, j,k,x,y,z,p,q,u,v;
N = (( (ll)1 )<<50), NN = 4;
//N = 20;
double a, b, c,d;
M.NT.get_prime_Euler(100000000);
for (i = 1; i <= M.NT.pcnt; i++) {
x = M.NT.prime[i];
if (x * x > N)break;
}
ll len = i - 1;
for (i = 1; i <= len; i++) {
D[i] = M.NT.prime[i] * M.NT.prime[i];
ans1 = ans1 + N / D[i];
}
for (i = len; i >= 1; i--) {
serch(i, D[i], 2);
}
printf("%lld\n",N-ans1);
}