# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
512627 | Jean7 | Savrsen (COCI17_savrsen) | C++14 | 1175 ms | 78552 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 fio ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define int long long
using namespace std ;
int abso ( int x ) {
return ( x > 0 ? x : -x ) ;
}
vector <int> v ;
signed main ()
{
fio ;
int a , b , ans = 0 ;
cin >> a >> b ;
v.resize(b+1) ;
for ( int i = 1 ; i <= b ; i++ ) {
for ( int j = 2*i ; j <= b ; j += i ) {
v[j] += i ;
}
}
while ( a <= b )
{
ans += abso ( a - v[a] ) ;
a++ ;
}
cout << ans ;
return 0 ;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |