/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 80ms 8.02 MiB
#2 Accepted 91ms 8.77 MiB
#3 Accepted 82ms 8.812 MiB
#4 Accepted 81ms 8.691 MiB
#5 Accepted 79ms 9.02 MiB

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