# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
23099 | model_code | Savrsen (COCI17_savrsen) | C++11 | 1266 ms | 41084 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>
#include <vector>
using namespace std;
int abs(int x) { return x > 0 ? x : -x; }
int main() {
int a, b;
cin >> a >> b;
int M = b + 1;
vector<int> v(M);
for (int d = 1; d < M; ++d) {
int dd = d + d;
while (dd < M) {
v[dd] += d;
dd += d;
}
}
long long s = 0;
for (int i = a; i <= b; ++i)
s += abs(v[i] - i);
cout << s << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |