Time Exceeded
Code
#include <bits/stdc++.h>
using namespace std;
void solve() {
int n; cin >> n;
int ans = 0;
for (int i = 1; i <= n; i++)
ans += n/i - 1;
cout << ans << "\n";
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t; cin >> t; while (t--)
solve();
}
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:18:09
- Judged At
- 2025-07-14 17:18:09
- Judged By
- Score
- 0
- Total Time
- ≥1100ms
- Peak Memory
- ≥560.0 KiB