結果

問題 No.273 回文分解
ユーザー c-yan
提出日時 2021-01-18 00:18:13
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 244 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-11-30 06:53:03
合計ジャッジ時間 2,272 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 28 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_palindrome(s):
    return s == s[::-1]


S = input()

result = 0
for i in range(len(S)):
    for j in range(i + 1, len(S) + 1):
        if not is_palindrome(S[i:j]):
            continue
        result = max(result, j - i)
print(result)
0