# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1062806 | dimasnbayu | Savrsen (COCI17_savrsen) | C++14 | 592 ms | 78692 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;
#define int long long
int sum[10000005];
signed main(){
int n,m; cin>>n>>m;
for(int i=2;i<=10000000;i++){
for(int j=i+i;j<=10000000;j+=i) sum[j]+=i;
}
int ans=0;
for(int i=n;i<=m;i++){
ans+=abs(i-sum[i]-(i==1? 0:1));
// cout<<abs(i-sum[i]-(i==1? 0:1))<<endl;
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |