# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
884449 | gutzzy | Savrsen (COCI17_savrsen) | C++14 | 3084 ms | 39516 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;
int main(){
int a,b;
cin >> a >> b;
long long ans = 0;
vector<int> d(b-1);
for(int i=0;i<b-1;i++){
d[i] = a%(i+1);
}
long long curr = 0;
for(int i=a;i<=b;i++){
curr = i;
if(i!=1){
for(int j=0;j<i-1;j++){
if(d[j]==0) curr -= j+1;
}
}
ans += abs(curr);
for(int k=0;k<b-1;k++){
d[k] = (d[k]+1)%(k+1);
}
}
cout << ans << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |