結果
| 問題 |
No.273 回文分解
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-05-02 01:02:57 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 47 ms / 2,000 ms |
| コード長 | 267 bytes |
| コンパイル時間 | 548 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 60,160 KB |
| 最終ジャッジ日時 | 2025-05-02 01:03:01 |
| 合計ジャッジ時間 | 3,385 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
from itertools import combinations
S=list(map(str, input()))
N=len(S)
L=[i for i in range(N+1)]
ans=0
for i in combinations(L,2):
l, r = i[0],i[1]
if l == 0 and r == N:
continue
if S[l:r] == S[l:r][::-1]:
ans = max(ans, r-l)
print(ans)