Submission #884448

#TimeUsernameProblemLanguageResultExecution timeMemory
884448ElenaBMSavrsen (COCI17_savrsen)C++17
120 / 120
766 ms78936 KiB
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int a, b; cin>> a >> b; int ans = 0; vector<int>sdiv(b+1, 1); sdiv[1] = 0; for (int i = 2; i <= b; ++i){ for (int j = 2*i; j <= b; j += i){ sdiv[j] += i; } } for (int i = a; i <= b; ++i) ans += abs(i- sdiv[i]); cout<< ans << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...