# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
299737 | dolijan | Savrsen (COCI17_savrsen) | C++14 | 1740 ms | 78636 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>
typedef long long ll;
using namespace std;
int main()
{
ll a,b;
cin>>a>>b;
ll zbirdelilaca[b+1];
for(ll i=a;i<=b;i++) zbirdelilaca[i]=0;
for(ll i=1;i<=b;i++)
{
ll sta=2*i;
while(sta<a) sta+=i;
while(sta<=b)
{
zbirdelilaca[sta]+=i;
sta+=i;
}
}
ll kolko=0;
for(ll i=a;i<=b;i++) kolko+=abs(i-zbirdelilaca[i]);
cout<<kolko<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |