# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
86368 | 2018-11-26T08:19:06 Z | dimash241 | Savrsen (COCI17_savrsen) | C++17 | 0 ms | 0 KB |
#include <iostream> using namespace std; int f[1010101]; int a, b; int main () { cin >> a >> b; for (int i = 1; i <= b; ++i) { int j = i + i; while (j <= b) { f[j] += i; j += i; } } ll ans = 0; for (int i = a; i <= b; ++i) ans += abs(f[i] - i); cout << ans; }