# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1107149 | toast12 | Savrsen (COCI17_savrsen) | C++14 | 523 ms | 78708 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;
int main() {
int a, b;
cin >> a >> b;
vector<long long> sum(b+1);
for (int i = 2; i <= b; i++) {
for (int j = i+i; j <= b; j += i) sum[j] += i;
sum[i]++;
}
long long ans = 0;
for (int i = a; i <= b; i++) ans += abs(i-sum[i]);
cout << ans << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |