# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
884436 | ElenaBM | Savrsen (COCI17_savrsen) | C++17 | 3065 ms | 600 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define int long long
using namespace std;
int f (int n){
int ans = 1;
if (n == 1) return 0;
for (int i = 2; i <= sqrt(n); ++i){
if (i*i == n) ans += i;
else if (n%i == 0) ans += i + n/i;
}
return ans;
}
signed main()
{
int a, b;
cin>> a >> b;
int ans = 0;
for (int i = a; i <= b; ++i){
ans += abs(i- f(i));
}
cout<< ans << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |