# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
42368 | milmillin | Savrsen (COCI17_savrsen) | C++14 | 2137 ms | 78876 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>
using namespace std;
long long tbl[10000100];
int main () {
for (int i=1;i<10000100;i++) {
tbl[i]=i;
}
for (int i=1;i<10000100;i++) {
for (int j=i+i;j<10000100;j+=i) {
tbl[j]-=i;
}
}
int a,b;
scanf("%d%d",&a,&b);
long long sum=0;
for (int i=a;i<=b;i++) {
if (tbl[i]<0) tbl[i]=-tbl[i];
sum+=tbl[i];
}
printf("%lld\n",sum);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |