//判断是不是有限小数 boolyes(int n){ while (n%2 == 0) n /= 2; while (n%5 == 0) n /= 5; if (n == 1) returntrue; returnfalse; }
intmain() { double n, i; double e = exp(1); longlong s; cin >> n; if (n < 5) { cout << 0 <<endl; return0; } s = 0; for (i = 5; i <= n; i++) { int k = int(i/e+0.5); int x = gcd(int(i),k); k /= x; bool ok = yes(k); if(ok) s -= int(i); else s += int(i); } printf("%lld\n", s); return0; }
intmain() { ll n, x, c, m, i, j, s, k; cin >> n >> x >> c >> m; memset(a, 0, sizeof(a)); for (i = 0; i < m; i++) { scanf("%lld", &j); a[j-1]++; } s = 0; j = 0; for (i = 0; i < x-1; i++) { j += a[i]; } for (i = x-1; i < n; i++) { j += a[i]; k = i; while (j < c) { while (a[k]==1) { k--; } a[k]++; j++; s++; k--; } j -= a[i-x+1]; } cout << s << endl; return0; }