/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 64ms 8.02 MiB
#2 Accepted 91ms 8.77 MiB
#3 Accepted 82ms 8.84 MiB
#4 Accepted 88ms 8.789 MiB
#5 Accepted 87ms 8.941 MiB

Code

#include <bits/stdc++.h>

using namespace std;

int32_t main() {
  cin.tie(0) -> sync_with_stdio(0);
  const int N = 1e6 + 1;
  int64_t ans[N] {};
  for (int i = 1; i < N; i++) {
    for (int j = i * 2; j < N; j += i) {
      ans[j] += 1;
    }
    ans[i] += ans[i - 1];
  }
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    cout << ans[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 17:24:51
Judged At
2025-07-14 17:24:51
Judged By
Score
100
Total Time
91ms
Peak Memory
8.941 MiB