# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
82757 | heon | Savrsen (COCI17_savrsen) | C++11 | 1590 ms | 39728 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>
using namespace std;
const int MAXN = 1e7 + 5;
int v[MAXN];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int a,b;
cin >> a >> b;
for(int i = 1; i <= b; i++){
for(int j = i + i; j <= b; j += i){
v[j] += i;
}
}
long long sum = 0;
for(int i = a; i <= b; i++){
sum += abs(i - v[i]);
//cout << abs(i - v[i]) << " ";
}
cout << sum;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |