# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
884448 | ElenaBM | Savrsen (COCI17_savrsen) | C++17 | 766 ms | 78936 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;
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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |