# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
371033 | FatihSolak | Savrsen (COCI17_savrsen) | C++17 | 1335 ms | 39660 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>
#define N 10000005
using namespace std;
int arr[N];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int a,b;
cin >> a >> b;
long long sum = 0;
for(int i=1;i<N;i++){
for(int j=i+i;j<N;j+=i){
arr[j] -= i;
}
arr[i]+=i;
}
for(int i=a;i<=b;i++){
sum += abs(arr[i]);
}
cout << sum;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |