# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
884450 | lalig777 | Savrsen (COCI17_savrsen) | C++14 | 773 ms | 78928 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 <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;
int main(){
int a, b;
cin>>a>>b;
const int N=1e7+1;
long long int sum=0;
if (a==1) sum++;
vector<long long int>sum_mult(N, 1);
for (int i=2; i<=b; ++i) {
for (int j=2*i; j<N; j+=i) sum_mult[j]+=i;
if (a<=i) sum+=abs(i-sum_mult[i]);
}cout<<sum<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |