# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1236665 | overwatch9 | Savrsen (COCI17_savrsen) | C++20 | 928 ms | 78692 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int a, b;
cin >> a >> b;
vector <ll> sum(b+1);
for (int i = 2; i <= b; i++) {
for (int j = i+i; j <= b; j += i)
sum[j] += i;
sum[i]++;
}
ll ans = 0;
for (int i = a; i <= b; i++)
ans += abs(i - sum[i]);
cout << ans << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |