| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 544445 | rainboy | Jump (BOI06_jump) | C11 | 8 ms | 4144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#define N 100
#define L 100
void add(int *aa, int *bb) {
int i;
for (i = 0; i < L; i++)
aa[i] += bb[i];
for (i = 0; i < L; i++)
if (aa[i] >= 10) {
if (i + 1 < L)
aa[i + 1] += aa[i] / 10;
aa[i] %= 10;
}
}
int main() {
static int dp[N][N][L];
int n, i, j;
scanf("%d", &n);
dp[0][0][0] = 1;
for (i = 0; i < n; i++)
for (j = 0; j < n; j++) {
int a;
scanf("%d", &a);
if (a == 0)
continue;
if (i + a < n)
add(dp[i + a][j], dp[i][j]);
if (j + a < n)
add(dp[i][j + a], dp[i][j]);
}
i = L - 1;
while (i > 0 && dp[n - 1][n - 1][i] == 0)
i--;
while (i >= 0)
printf("%d", dp[n - 1][n - 1][i--]);
printf("\n");
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
