# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
784087 | rainboy | Journey (NOI18_journey) | C11 | 44 ms | 17580 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#define N 10000
#define M 400
#define INF 500000001
int min(int a, int b) { return a < b ? a : b; }
int main() {
static int dp[N][M];
int n, m, k, h, i, j, s, t;
scanf("%d%d%d", &n, &m, &k);
for (i = 0; i < n; i++) {
if (i == 0)
dp[i][0] = 1;
else
for (s = 1; s < m; s++)
dp[i][s] = min(dp[i][s] + dp[i][s - 1], INF);
if (i + 1 < n) {
for (h = 0; h < k; h++) {
scanf("%d%d", &j, &t);
for (s = 0; s + t < m; s++)
if (i < j)
dp[j][s + t] = min(dp[j][s + t] + dp[i][s], INF);
}
} else {
for (s = 0; s < m; s++)
printf("%d ", dp[i][s]);
printf("\n");
}
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |