# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1161367 | mnbvcxz123 | Savrsen (COCI17_savrsen) | C++20 | 767 ms | 78692 KiB |
#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... |