結果

問題 No.273 回文分解
ユーザー ああいいああいい
提出日時 2022-02-23 22:56:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 1,645 ms
コンパイル使用メモリ 86,752 KB
実行使用メモリ 75,920 KB
最終ジャッジ日時 2023-09-14 16:12:48
合計ジャッジ時間 4,880 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,188 KB
testcase_01 AC 70 ms
71,240 KB
testcase_02 AC 70 ms
71,204 KB
testcase_03 AC 70 ms
71,060 KB
testcase_04 AC 70 ms
71,264 KB
testcase_05 AC 70 ms
70,976 KB
testcase_06 AC 70 ms
71,272 KB
testcase_07 AC 70 ms
71,092 KB
testcase_08 AC 70 ms
71,260 KB
testcase_09 AC 70 ms
71,084 KB
testcase_10 AC 71 ms
71,228 KB
testcase_11 AC 69 ms
71,204 KB
testcase_12 AC 69 ms
70,976 KB
testcase_13 AC 70 ms
71,292 KB
testcase_14 AC 78 ms
75,788 KB
testcase_15 AC 72 ms
70,932 KB
testcase_16 AC 73 ms
71,008 KB
testcase_17 AC 73 ms
71,296 KB
testcase_18 AC 72 ms
70,940 KB
testcase_19 AC 74 ms
71,112 KB
testcase_20 AC 73 ms
71,384 KB
testcase_21 AC 70 ms
71,292 KB
testcase_22 AC 75 ms
75,844 KB
testcase_23 AC 74 ms
75,760 KB
testcase_24 AC 75 ms
75,624 KB
testcase_25 AC 73 ms
75,632 KB
testcase_26 AC 75 ms
75,628 KB
testcase_27 AC 74 ms
75,920 KB
testcase_28 AC 74 ms
75,464 KB
testcase_29 AC 72 ms
71,328 KB
testcase_30 AC 73 ms
75,636 KB
testcase_31 AC 70 ms
71,248 KB
testcase_32 AC 70 ms
71,316 KB
testcase_33 AC 70 ms
71,444 KB
testcase_34 AC 69 ms
70,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
ans = 0

def check(T):
    return T == T[::-1]
for i in range(len(S)):
    for j in range(i,len(S)):
        if check(S[i:j+1]):
            if j - i + 1 < len(S) and j - i + 1 > ans:
                ans = j - i + 1
print(ans)
0