Submission #494309

#TimeUsernameProblemLanguageResultExecution timeMemory
494309Christopher_Savrsen (COCI17_savrsen)C++17
60 / 120
3084 ms304 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int div(int x) { if (x == 1) return 0; int res = 0; for (int i = 2; i <= sqrt(x); ++i) { if (x % i == 0) { res += i; if (x / i != i) { res += x / i; } } } //cout << x << ' ' << res << '\n'; return res + 1; } int32_t main() { ios::sync_with_stdio(false); cin.tie(0); int a, b; cin >> a >> b; int ans = 0; for (int i = a; i <= b; ++i) { ans += abs(i - div(i)); } cout << ans << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...