Accepted
Code
#include<bits/stdc++.h>
using namespace std;
const long long MXM=1000005;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
vector<long long> bk(MXM,0);
for(long long i=1;i<MXM;i++){
for(long long j=2*i;j<MXM;j+=i){
bk[j]++;
}
}
for(long long i=2;i<MXM;i++){
bk[i]+=bk[i-1];
}
long long t;
cin >> t;
while(t>0){
t--;
long long n;
cin >> n;
cout << bk[n] << "\n";
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1206 D1. GCD equal Absolute Value (Easy Version)
- Contest
- Educational Round 1
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-07-14 15:48:37
- Judged At
- 2025-07-14 15:48:37
- Judged By
- Score
- 100
- Total Time
- 91ms
- Peak Memory
- 9.02 MiB