Submission #86366

#TimeUsernameProblemLanguageResultExecution timeMemory
86366dimash241Savrsen (COCI17_savrsen)C++17
30 / 120
13 ms8660 KiB
#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; } } int ans = 0; for (int i = a; i <= b; i ++) ans += abs(f[i] - i); cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...