Time Exceeded
Code
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
signed main() {
ios_base::sync_with_stdio(0); cin.tie(0);
int tc; cin >> tc;
test:
while (tc--) {
ll n; cin >> n;
ll totalNod = 0;
for (ll left = 1, right = 0; left <= n; left = right+1) {
ll temp = n/left;
right = n/temp;
ll aa = ((right-left+1) * temp);
totalNod = (totalNod + aa);
}
cout << totalNod-n << "\n";
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1207 D2. GCD equal Absolute Value (Hard Version)
- Language
- C++11 (G++ 13.2.0)
- Submit At
- 2025-07-31 06:32:32
- Judged At
- 2025-07-31 06:32:32
- Judged By
- Score
- 5
- Total Time
- ≥1100ms
- Peak Memory
- ≥764.0 KiB