結果

問題 No.273 回文分解
ユーザー matsu7874
提出日時 2015-08-28 22:42:14
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 304 bytes
コンパイル時間 480 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2024-12-23 11:49:28
合計ジャッジ時間 2,837 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 27 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_palindrome(s):
    n = len(s)
    if s == s[::-1]:
        return True
    else:
        return False

S = input()
N = len(S)

max_lenght = 0
for lenght in range(N - 1, 0, -1):
    for i in range(N - lenght):
        if is_palindrome(S[i:i + lenght]):
            print(lenght)
            exit()
0