| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 1024 MB | 20 | 14 | 12 | 66.667% |
You are given an $N \times N$ grid $A$ where each cell contains an integer color ID $A_{ij}$. Your task is to find the largest axis-aligned rectangle whose cells all have the same color, and report its area.
In this figure, the maximal area satisfying the problem’s conditions is 6ドル$. Note that rectangle must be axis-aligned and contiguous in rows and columns.
The first line contains a single integer $N,ドル representing the size of the grid $A$. $(1 \leq N \leq 2,000円)$
The next $N$ lines each contain $N$ integers, integer denotes the color ID $A_{ij}$. $(-1,000円,000円 \leq A_{ij} \leq 1,000円,000円)$
Print a single integer: the maximal area satisfying the problem’s conditions.
| 번호 | 배점 | 제한 |
|---|---|---|
| 1 | 40 | 1ドル \leq N \leq 10$ All color IDs $A_{ij}$ in the grid are either 0 or 1. |
| 2 | 15 | 1ドル \leq N \leq 2,000円$ All color IDs $A_{ij}$ in the grid are either 0 or 1. |
| 3 | 15 | 1ドル \leq N \leq 80$ |
| 4 | 15 | 1ドル \leq N \leq 400$ |
| 5 | 15 | 1ドル \leq N \leq 2,000円$ |
4 1 0 0 0 1 0 1 0 1 1 0 0 0 1 1 0
4
This example satisfies the conditions of Subtask 1, 2, 3, 4 and 5.
4 1 2 2 2 1 2 2 2 1 2 2 2 3 3 0 -1
9
This example satisfies the conditions of Subtask 3, 4 and 5.
6 1 1 2 2 2 4 1 1 1 2 2 4 3 1 1 2 2 2 3 3 3 3 3 2 4 4 4 4 4 5 5 5 5 5 1 1
6
This example satisfies the conditions of Subtask 3, 4 and 5.
University > 서강대학교 > CSE4152 문제해결프로그래밍실습 > 2025-2학기 중간고사 코딩 테스트 4번