結果

問題 No.588 空白と回文
コンテスト
ユーザー ymgckyo
提出日時 2017-11-04 00:19:34
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 584 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 56 ms
コンパイル使用メモリ 14,976 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2026-09-28 16:30:25
合計ジャッジ時間 3,514 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

inputed_list = list(input())

res = 1
tmp_list = []
for i in range(len(inputed_list)):
    tmp_list.clear()
    for e in inputed_list:
        tmp_list.append(e)
    j = 1
    length = 1

    while True:
        if i - j < 0 or i + j >= len(inputed_list):
            break
        b = tmp_list[i - j]
        f = tmp_list[i + j]
        if b == f:
            length += 1
            res = max(res, length)
            j += 1
        else:
            tmp_list[i - j] = ' '
            tmp_list[i + j] = ' '
            j += 1

if res == 1:
    print(0)
else:
    print(res * 2 - 1)
0