# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100743 | dalgerok | Savrsen (COCI17_savrsen) | C++17 | 1772 ms | 39800 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>
using namespace std;
const int N = 1e7 + 1;
int dp[N];
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
for(int i = 1; i < N; i++){
for(int j = 2 * i; j < N; j += i){
dp[j] += i;
}
}
int l, r;
cin >> l >> r;
long long ans = 0;
for(int i = l; i <= r; i++){
ans += abs(i - dp[i]);
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |