# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
86375 | dimash241 | Savrsen (COCI17_savrsen) | C++17 | 1717 ms | 39780 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 <iostream>
using namespace std;
int f[10000001];
int a, b;
int main () {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> a >> b;
for (int i = 1; i <= b / 2; ++i) {
int j = i + i;
while (j <= b) {
f[j] += i;
j += i;
}
}
long long ans = 0;
for (int i = a; i <= b; ++i)
ans += abs(f[i] - i);
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |