# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
147584 | KCSC | Savrsen (COCI17_savrsen) | C++14 | 1649 ms | 39564 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;
const int DIM = 10000005;
int arr[DIM];
int main(void) {
int a, b;
cin >> a >> b;
for (int i = 1; i <= b; ++i) {
arr[i] -= i;
for (int j = i + i; j <= b; j += i)
arr[j] += i;
}
long long s = 0;
for (int i = a; i <= b; ++i)
s += (arr[i] >= 0 ? arr[i] : -arr[i]);
cout << s;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |