Accepted
Code
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
int t;
cin >> t;
vector<ll> a(1000050);
for (int i = 2; i < 1000050; i++){
for (int j = i + i; j < 1000050; j += i){
a[j]++;
}
}
for (int i = 2; i < 1000050; i++){
a[i] += a[i - 1];
}
while (t--){
ll n, S = 0;
cin >> n;
cout << a[n] + n - 1 << endl;
}
}
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-14 18:23:23
- Judged At
- 2025-07-14 18:23:23
- Judged By
- Score
- 100
- Total Time
- 294ms
- Peak Memory
- 9.023 MiB