# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
44365 | 2018-04-01T03:54:52 Z | RayaBurong25_1 | Asceticism (JOI18_asceticism) | C++17 | 54 ms | 24984 KB |
#include <stdio.h> #define MOD 1000000007LL long long DP[3005][3005]; int main() { int N, K; scanf("%d %d", &N, &K); int i, j; DP[1][0] = 1; for (i = 1; i <= N; i++) { for (j = 0; j < i && j < K; j++) { // printf("%d %d = %lld\n", i, j, DP[i][j]); DP[i + 1][j] = (DP[i + 1][j] + (j + 1)*DP[i][j])%MOD; DP[i + 1][j + 1] = (DP[i + 1][j + 1] + (i - j)*DP[i][j])%MOD; } } printf("%lld", DP[N][K - 1]); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 356 KB | Output is correct |
3 | Correct | 2 ms | 408 KB | Output is correct |
4 | Correct | 3 ms | 456 KB | Output is correct |
5 | Correct | 2 ms | 464 KB | Output is correct |
6 | Correct | 2 ms | 540 KB | Output is correct |
7 | Correct | 2 ms | 560 KB | Output is correct |
8 | Correct | 2 ms | 560 KB | Output is correct |
9 | Correct | 2 ms | 560 KB | Output is correct |
10 | Correct | 2 ms | 560 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 356 KB | Output is correct |
3 | Correct | 2 ms | 408 KB | Output is correct |
4 | Correct | 3 ms | 456 KB | Output is correct |
5 | Correct | 2 ms | 464 KB | Output is correct |
6 | Correct | 2 ms | 540 KB | Output is correct |
7 | Correct | 2 ms | 560 KB | Output is correct |
8 | Correct | 2 ms | 560 KB | Output is correct |
9 | Correct | 2 ms | 560 KB | Output is correct |
10 | Correct | 2 ms | 560 KB | Output is correct |
11 | Correct | 2 ms | 996 KB | Output is correct |
12 | Correct | 3 ms | 1764 KB | Output is correct |
13 | Correct | 3 ms | 1768 KB | Output is correct |
14 | Correct | 3 ms | 2024 KB | Output is correct |
15 | Correct | 3 ms | 2152 KB | Output is correct |
16 | Correct | 4 ms | 2152 KB | Output is correct |
17 | Correct | 3 ms | 2152 KB | Output is correct |
18 | Correct | 3 ms | 2152 KB | Output is correct |
19 | Correct | 3 ms | 2152 KB | Output is correct |
20 | Correct | 2 ms | 2152 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 356 KB | Output is correct |
3 | Correct | 2 ms | 408 KB | Output is correct |
4 | Correct | 3 ms | 456 KB | Output is correct |
5 | Correct | 2 ms | 464 KB | Output is correct |
6 | Correct | 2 ms | 540 KB | Output is correct |
7 | Correct | 2 ms | 560 KB | Output is correct |
8 | Correct | 2 ms | 560 KB | Output is correct |
9 | Correct | 2 ms | 560 KB | Output is correct |
10 | Correct | 2 ms | 560 KB | Output is correct |
11 | Correct | 2 ms | 996 KB | Output is correct |
12 | Correct | 3 ms | 1764 KB | Output is correct |
13 | Correct | 3 ms | 1768 KB | Output is correct |
14 | Correct | 3 ms | 2024 KB | Output is correct |
15 | Correct | 3 ms | 2152 KB | Output is correct |
16 | Correct | 4 ms | 2152 KB | Output is correct |
17 | Correct | 3 ms | 2152 KB | Output is correct |
18 | Correct | 3 ms | 2152 KB | Output is correct |
19 | Correct | 3 ms | 2152 KB | Output is correct |
20 | Correct | 2 ms | 2152 KB | Output is correct |
21 | Correct | 5 ms | 4608 KB | Output is correct |
22 | Correct | 5 ms | 4608 KB | Output is correct |
23 | Correct | 10 ms | 7296 KB | Output is correct |
24 | Correct | 10 ms | 7580 KB | Output is correct |
25 | Correct | 13 ms | 8448 KB | Output is correct |
26 | Correct | 12 ms | 8448 KB | Output is correct |
27 | Correct | 15 ms | 8456 KB | Output is correct |
28 | Correct | 7 ms | 8456 KB | Output is correct |
29 | Correct | 3 ms | 8456 KB | Output is correct |
30 | Correct | 12 ms | 8456 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 356 KB | Output is correct |
3 | Correct | 2 ms | 408 KB | Output is correct |
4 | Correct | 3 ms | 456 KB | Output is correct |
5 | Correct | 2 ms | 464 KB | Output is correct |
6 | Correct | 2 ms | 540 KB | Output is correct |
7 | Correct | 2 ms | 560 KB | Output is correct |
8 | Correct | 2 ms | 560 KB | Output is correct |
9 | Correct | 2 ms | 560 KB | Output is correct |
10 | Correct | 2 ms | 560 KB | Output is correct |
11 | Correct | 2 ms | 996 KB | Output is correct |
12 | Correct | 3 ms | 1764 KB | Output is correct |
13 | Correct | 3 ms | 1768 KB | Output is correct |
14 | Correct | 3 ms | 2024 KB | Output is correct |
15 | Correct | 3 ms | 2152 KB | Output is correct |
16 | Correct | 4 ms | 2152 KB | Output is correct |
17 | Correct | 3 ms | 2152 KB | Output is correct |
18 | Correct | 3 ms | 2152 KB | Output is correct |
19 | Correct | 3 ms | 2152 KB | Output is correct |
20 | Correct | 2 ms | 2152 KB | Output is correct |
21 | Correct | 5 ms | 4608 KB | Output is correct |
22 | Correct | 5 ms | 4608 KB | Output is correct |
23 | Correct | 10 ms | 7296 KB | Output is correct |
24 | Correct | 10 ms | 7580 KB | Output is correct |
25 | Correct | 13 ms | 8448 KB | Output is correct |
26 | Correct | 12 ms | 8448 KB | Output is correct |
27 | Correct | 15 ms | 8456 KB | Output is correct |
28 | Correct | 7 ms | 8456 KB | Output is correct |
29 | Correct | 3 ms | 8456 KB | Output is correct |
30 | Correct | 12 ms | 8456 KB | Output is correct |
31 | Runtime error | 54 ms | 24984 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
32 | Halted | 0 ms | 0 KB | - |