結果

問題 No.588 空白と回文
ユーザー GrayCoderGrayCoder
提出日時 2018-06-17 21:23:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 402 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,556 KB
実行使用メモリ 8,496 KB
最終ジャッジ日時 2023-09-13 06:26:12
合計ジャッジ時間 2,465 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,432 KB
testcase_01 AC 19 ms
8,356 KB
testcase_02 AC 20 ms
8,432 KB
testcase_03 AC 115 ms
8,464 KB
testcase_04 AC 19 ms
8,380 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 19 ms
8,432 KB
testcase_08 AC 19 ms
8,368 KB
testcase_09 AC 18 ms
8,492 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 18 ms
8,404 KB
testcase_15 WA -
testcase_16 AC 18 ms
8,364 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 19 ms
8,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
from sys import stdin, stdout
input = lambda: stdin.readline().rstrip()
println = stdout.write

def main():
    s1 = input()

    s2 = deque(s1[::-1])
    l = len(s1)
    ans = 0
    for _ in range(l):
        cnt = 0
        for i in range(l):
            if s1[i] == s2[i]:
                cnt += 1
        ans = max(ans, cnt)
        s2.rotate()
    print(ans)

main()
0