Logo
(追記) (追記ここまで)

34747번 - Maximal Color Rectangle 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB20141266.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.

제한

서브태스크

번호배점제한
140

1ドル \leq N \leq 10$

All color IDs $A_{ij}$ in the grid are either 0 or 1.

215

1ドル \leq N \leq 2,000円$

All color IDs $A_{ij}$ in the grid are either 0 or 1.

315

1ドル \leq N \leq 80$

415

1ドル \leq N \leq 400$

515

1ドル \leq N \leq 2,000円$

예제 입력 1

4
1 0 0 0
1 0 1 0
1 1 0 0
0 1 1 0

예제 출력 1

4

This example satisfies the conditions of Subtask 1, 2, 3, 4 and 5.

예제 입력 2

4
1 2 2 2
1 2 2 2
1 2 2 2
3 3 0 -1

예제 출력 2

9

This example satisfies the conditions of Subtask 3, 4 and 5.

예제 입력 3

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

예제 출력 3

6

This example satisfies the conditions of Subtask 3, 4 and 5.

노트

출처

University > 서강대학교 > CSE4152 문제해결프로그래밍실습 > 2025-2학기 중간고사 코딩 테스트 4번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /