# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
494331 | Christopher_ | Savrsen (COCI17_savrsen) | C++17 | 1047 ms | 78540 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;
using ll = long long;
using ld = long double;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int a, b;
cin >> a >> b;
vector<ll> dp(b + 1);
for (int i = 1; i <= b; ++i) {
for (int j = i * 2; j <= b; j += i) {
dp[j] += i;
}
}
ll res = 0;
for (int i = a; i <= b; ++i) {
res += abs(i - dp[i]);
}
cout << res << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |