| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 882238 | rainboy | Maxcomp (info1cup18_maxcomp) | C11 | 140 ms | 17236 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#define N 1000
#define M 1000
int min(int a, int b) { return a < b ? a : b; }
int max(int a, int b) { return a > b ? a : b; }
int main() {
static int aa[N][M], bb[N][M];
int n, m, i, j, ans;
scanf("%d%d", &n, &m);
for (i = 0; i < n; i++)
for (j = 0; j < m; j++) {
scanf("%d", &aa[i][j]);
bb[i][j] = aa[i][j];
}
for (i = 0; i < n; i++) {
for (j = 1; j < m; j++)
bb[i][j] = min(bb[i][j], bb[i][j - 1] + 1);
for (j = m - 2; j >= 0; j--)
bb[i][j] = min(bb[i][j], bb[i][j + 1] + 1);
}
for (j = 0; j < m; j++) {
for (i = 1; i < n; i++)
bb[i][j] = min(bb[i][j], bb[i - 1][j] + 1);
for (i = n - 2; i >= 0; i--)
bb[i][j] = min(bb[i][j], bb[i + 1][j] + 1);
}
ans = -1;
for (i = 0; i < n; i++)
for (j = 0; j < m; j++)
ans = max(ans, aa[i][j] - bb[i][j] - 1);
printf("%d\n", ans);
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... | ||||
