# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
480569 | varungoyalbits | Savrsen (COCI17_savrsen) | C++17 | 1230 ms | 39428 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.
/*
https://oj.uz/problem/view/COCI17_savrsen
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
vector<int> vec(b+1,0);
for(int i=1;i<=b;i++)
{
for(int j=i;j<=b;j+=i)
{
vec[j]+=i;
}
}
long long ans=0;
for(int i=a;i<=b;i++)
{
ans+=(llabs(i-(vec[i]-i)));
}
cout<<ans<<"\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |