# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151743 | hdj79 | Turnir (COCI17_turnir) | C++14 | 20 ms | 2208 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<algorithm>
using namespace std;
int zbrojevi[10000000+5];
int main(){
ios_base :: sync_with_stdio(false);
cin.tie(NULL);
int a,b;
cin>>a>>b;
for(int i=1;i<b+1;i++){
for(int j=i+i;j<b+1;j+=i){
zbrojevi[j]+=i;
}
}
long long sol=0;
for(int i=a;i<=b;i++){
sol+=abs(i-zbrojevi[i]);
}
cout<<sol;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |