# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
80570 | tpoppo | Savrsen (COCI17_savrsen) | C++14 | 2196 ms | 79112 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;
using ll = long long;
const ll MAXN = 1e7+1;
ll a,b,res;
ll sumDiv[MAXN];
int main(){
cin.tie(0);
ios_base::sync_with_stdio(false);
cin>>a>>b;
for(int i=1;i<=b;i++){
for(int j=i;j<=b;j+=i)
sumDiv[j]+=i;
}
for(;a<=b;a++) res += abs(2*a - sumDiv[a]);
cout<<res;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |