# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1162059 | nguyenkhangninh99 | Savrsen (COCI17_savrsen) | C++20 | 1027 ms | 78712 KiB |
#include "bits/stdc++.h"
using namespace std;
using i64 = long long;
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
const int N = 1e7 + 7;
i64 f[N];
int main() {
cin.tie(0)->sync_with_stdio(0);
int a, b;
cin >> a >> b;
for (int i = 1; i <= b; i++) {
for (int j = i; j <= b; j += i) {
f[j] += i;
}
f[i] = abs(i - (f[i] - i)) + f[i - 1];
}
cout << f[b] - f[a - 1];
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |