結果

問題 No.588 空白と回文
ユーザー rlangevinrlangevin
提出日時 2023-01-04 22:09:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 271 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,336 KB
実行使用メモリ 76,308 KB
最終ジャッジ日時 2023-08-18 18:58:17
合計ジャッジ時間 3,488 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,284 KB
testcase_01 AC 67 ms
70,924 KB
testcase_02 AC 69 ms
71,316 KB
testcase_03 WA -
testcase_04 AC 73 ms
71,184 KB
testcase_05 AC 68 ms
71,364 KB
testcase_06 AC 71 ms
75,540 KB
testcase_07 AC 67 ms
71,200 KB
testcase_08 AC 70 ms
71,456 KB
testcase_09 AC 69 ms
71,244 KB
testcase_10 AC 68 ms
71,448 KB
testcase_11 WA -
testcase_12 AC 76 ms
76,008 KB
testcase_13 WA -
testcase_14 AC 67 ms
71,400 KB
testcase_15 WA -
testcase_16 AC 67 ms
71,152 KB
testcase_17 AC 79 ms
75,796 KB
testcase_18 AC 72 ms
70,976 KB
testcase_19 AC 73 ms
71,124 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

S = list(input())
N = len(S)
ans = 0
for i in range(N):
    val = 1
    left = i - 1
    right = i + 1
    while left >= 0 and right <= N - 1:
        if S[left] == S[right]:
            val += 2
        left -= 1
        right += 1
    ans = max(ans, val)
print(ans)    
0