Accepted
Code
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 1e6+7;
ll divisor[N];
signed main() {
ios_base::sync_with_stdio(0); cin.tie(0);
int tc; cin >> tc;
for (ll i = 1; i < N; i++) {
for (ll j = i; j < N; j += i) divisor[j]++;
}
for (ll i = 1; i < N; i++) divisor[i] += divisor[i-1];
test:
while (tc--) {
ll n; cin >> n;
cout << divisor[n]-n << "\n";
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1206 D1. GCD equal Absolute Value (Easy Version)
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-07-15 11:46:47
- Judged At
- 2025-07-15 11:46:47
- Judged By
- Score
- 100
- Total Time
- 85ms
- Peak Memory
- 9.043 MiB