# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
147589 | Ruxandra985 | Savrsen (COCI17_savrsen) | C++14 | 2008 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 <cstdio>
#include <iostream>
#define MAXI 10000010
using namespace std;
long long perf[MAXI];
int main()
{
//freopen ("a.in" , "r" , stdin);
//freopen ("a.out" , "w" , stdout);
int a, b , i , j;
long long sol;
scanf ("%d%d",&a,&b);
for (i=1;i<=MAXI/2;i++){
for (j = 2 * i ; j<=MAXI ; j+=i)
perf[j]+=i;
}
sol = 0;
for (i=a;i<=b;i++)
sol = sol + max ((long long)i - perf[i] , perf[i] - (long long)i);
printf ("%lld",sol);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |