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

32674번 - Palindromic Word Search 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
6 초 (추가 시간 없음) 1024 MB29131346.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.

제한

예제 입력 1

4 5
APPLE
BOBBY
KAYAK
REBEL

예제 출력 1

15

예제 입력 2

2 6
ABCCDE
PRCDEE

예제 출력 2

4

예제 입력 3

4 6
BANANA
BERGEN
CANNOT
FELLOW

예제 출력 3

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번

  • 문제를 만든 사람: Chuck Riedesel
(追記) (追記ここまで)

출처

대학교 대회

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

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