# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
97091 | karlopuh | Savrsen (COCI17_savrsen) | C++14 | 2842 ms | 78712 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;
int a,b;
long long int sum[10000008];
long long int ans;
int main(){
cin>>a>>b;
for(int i=1;i<=b;i++){
for(int j=i;j<=b;j+=i){
sum[j]+=i;
}
}
for(int i=a;i<=b;i++){
ans=ans+abs(i+i-sum[i]);
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |