# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
494309 | Christopher_ | Savrsen (COCI17_savrsen) | C++17 | 3084 ms | 304 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int long long
int div(int x) {
if (x == 1) return 0;
int res = 0;
for (int i = 2; i <= sqrt(x); ++i) {
if (x % i == 0) {
res += i;
if (x / i != i) {
res += x / i;
}
}
}
//cout << x << ' ' << res << '\n';
return res + 1;
}
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
int a, b;
cin >> a >> b;
int ans = 0;
for (int i = a; i <= b; ++i) {
ans += abs(i - div(i));
}
cout << ans << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |