# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
86508 | 2018-11-26T11:44:29 Z | Azamat_Murat | Savrsen (COCI17_savrsen) | C++14 | 2235 ms | 78880 KB |
#include <bits/stdc++.h> #define mp make_pair #define pb push_back #define f first #define s second #define all(x) x.begin(), x.end() #define ll long long //#define int long long using namespace std; void boost() { ios_base::sync_with_stdio(false); cin.tie(NULL); } void free() { freopen("A.in", "r", stdin); freopen("A.out", "w", stdout); } ll sum[10000001]; main() { //free(); boost(); int a, b; cin >> a >> b; sum[1] = 1; for(int i = 2; i <= 10000000; i++) for(int j = i + i; j <= 10000000; j += i) sum[j] += i; ll ans = 0; for(int i = a; i <= b; i++) ans += abs(i - sum[i] - 1); cout << ans, exit(0); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2119 ms | 78712 KB | Output is correct |
2 | Correct | 2061 ms | 78712 KB | Output is correct |
3 | Correct | 2055 ms | 78728 KB | Output is correct |
4 | Correct | 2164 ms | 78872 KB | Output is correct |
5 | Correct | 2193 ms | 78872 KB | Output is correct |
6 | Correct | 2127 ms | 78872 KB | Output is correct |
7 | Correct | 2235 ms | 78872 KB | Output is correct |
8 | Correct | 2142 ms | 78880 KB | Output is correct |