# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
463806 | 2021-08-11T19:14:17 Z | rainboy | Savrsen (COCI17_savrsen) | C | 1472 ms | 78540 KB |
#include <stdio.h> #define A 10000000 int abs_(int a) { return a > 0 ? a : -a; } long long dp[A + 1]; void init() { int a, b; for (a = 1; a <= A; a++) { for (b = a + a; b <= A; b += a) dp[b] += a; dp[a] = dp[a - 1] + abs_(a - dp[a]); } } int main() { int a, b; init(); scanf("%d%d", &a, &b); printf("%lld\n", dp[b] - dp[a - 1]); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1412 ms | 78540 KB | Output is correct |
2 | Correct | 1429 ms | 78528 KB | Output is correct |
3 | Correct | 1433 ms | 78520 KB | Output is correct |
4 | Correct | 1452 ms | 78524 KB | Output is correct |
5 | Correct | 1472 ms | 78524 KB | Output is correct |
6 | Correct | 1441 ms | 78528 KB | Output is correct |
7 | Correct | 1462 ms | 78528 KB | Output is correct |
8 | Correct | 1423 ms | 78532 KB | Output is correct |