# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
494309 | Christopher_ | Savrsen (COCI17_savrsen) | C++17 | 3084 ms | 304 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
int div(int x) {
if (x == 1) return 0;
int res = 0;
for (int i = 2; i <= sqrt(x); ++i) {
if (x % i == 0) {
res += i;
if (x / i != i) {
res += x / i;
}
}
}
//cout << x << ' ' << res << '\n';
return res + 1;
}
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
int a, b;
cin >> a >> b;
int ans = 0;
for (int i = a; i <= b; ++i) {
ans += abs(i - div(i));
}
cout << ans << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |