# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1085828 | andrewp | Savrsen (COCI17_savrsen) | C++14 | 455 ms | 39576 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//Dedicated to my love, ivaziva
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using ll = int64_t;
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define dbg(x) cerr << #x << ": " << x << '\n';
int sum[10000005];
int32_t main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
cout.tie(nullptr); cerr.tie(nullptr);
int a, b;
cin >> a >> b;
for (int i = 2; i < 10000001; i++) {
for (int j = i + i; j < 10000001; j += i) {
sum[j] += i;
}
}
int ans = 0;
for (int i = a; i <= b; i++) {
if (i == 1) {
ans += abs(i - sum[i]);
} else {
ans += abs(i - sum[i] - 1);
}
}
cout << ans << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |