| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 6 초 (추가 시간 없음) | 1024 MB | 29 | 13 | 13 | 46.429% |
Given a rectangular grid of uppercase letters, find a rectangular region of the grid of maximum possible area such that there is a horizontal palindrome spanning some row of the rectangular region and a vertical palindrome spanning some column of the rectangular region. Recall a palindrome is a string that equals its own reversal.
Figure 1: Illustration of optimal solutions to the sample inputs. In the shaded subregions, a palindrome spanning an entire row of the region and a palindrome spanning an entire column of the region are highlighted.
The first line contains two integers $R$ and $C$ (1ドル \leq R,C \leq 500$). Then next $R$ lines describe the grid, each containing exactly $C$ uppercase letters.
Output a single integer $A$ indicating the largest area of a rectangular region of the grid such that there is a horizontal palindrome spanning some row and a vertical palindrome spanning some column of the rectangular region.
4 5 APPLE BOBBY KAYAK REBEL
15
2 6 ABCCDE PRCDEE
4
4 6 BANANA BERGEN CANNOT FELLOW
15
ICPC > Regionals > North America > North Central North America Regional > 2024 North Central NA Regional Contest I번
ICPC > Regionals > North America > Rocky Mountain Regional > 2024 Rocky Mountain Regional Contest G번
ICPC > Regionals > North America > Mid-Central Regional > 2024 Mid-Central USA Programming Contest I번