結果

問題 No.273 回文分解
ユーザー gorugo30gorugo30
提出日時 2021-03-18 09:52:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 254 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 61,848 KB
最終ジャッジ日時 2024-04-28 01:00:57
合計ジャッジ時間 2,423 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,580 KB
testcase_01 AC 34 ms
52,612 KB
testcase_02 AC 34 ms
53,576 KB
testcase_03 AC 34 ms
52,972 KB
testcase_04 AC 33 ms
53,508 KB
testcase_05 AC 33 ms
53,024 KB
testcase_06 AC 33 ms
53,356 KB
testcase_07 AC 32 ms
52,360 KB
testcase_08 AC 32 ms
53,252 KB
testcase_09 AC 37 ms
52,352 KB
testcase_10 AC 39 ms
53,688 KB
testcase_11 AC 35 ms
52,540 KB
testcase_12 AC 33 ms
52,504 KB
testcase_13 AC 34 ms
52,364 KB
testcase_14 AC 38 ms
60,532 KB
testcase_15 AC 33 ms
53,432 KB
testcase_16 AC 34 ms
53,232 KB
testcase_17 AC 33 ms
53,756 KB
testcase_18 AC 36 ms
52,944 KB
testcase_19 AC 35 ms
52,976 KB
testcase_20 AC 33 ms
52,208 KB
testcase_21 AC 33 ms
52,216 KB
testcase_22 AC 36 ms
60,752 KB
testcase_23 AC 37 ms
61,416 KB
testcase_24 AC 37 ms
61,152 KB
testcase_25 AC 40 ms
61,084 KB
testcase_26 AC 39 ms
61,080 KB
testcase_27 AC 38 ms
61,144 KB
testcase_28 AC 38 ms
61,848 KB
testcase_29 AC 36 ms
54,444 KB
testcase_30 AC 38 ms
61,640 KB
testcase_31 AC 35 ms
52,492 KB
testcase_32 AC 33 ms
52,204 KB
testcase_33 AC 35 ms
52,504 KB
testcase_34 AC 33 ms
53,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
N = len(S)

ans = 0
for i in range(1, N):
    if S[:i] == S[:i][::-1]:
        ans = max(ans, i)
for st in range(1, N):
    for i in range(1, N - st + 1):
        if S[st:st + i] == S[st:st + i][::-1]:
            ans = max(ans, i)
print(ans)
0