# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
695186 | TAhmed33 | Savrsen (COCI17_savrsen) | C++98 | 1189 ms | 78668 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
#define endl '\n'
const int MOD = 1e9 + 7;
int divs[10000001] = {};
signed main () {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
for (int i = 1; i <= 1e7; i++) {
for (int j = 2 * i; j <= 1e7; j += i) {
divs[j] += i;
}
}
int a, b;
cin >> a >> b;
int sum = 0;
for (int i = a; i <= b; i++) sum += abs(i - divs[i]);
cout << sum << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |