結果

問題 No.273 回文分解
ユーザー nebukuro09nebukuro09
提出日時 2016-09-20 15:29:16
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 294 bytes
コンパイル時間 1,522 ms
コンパイル使用メモリ 77,440 KB
実行使用メモリ 76,580 KB
最終ジャッジ日時 2023-09-07 19:55:33
合計ジャッジ時間 5,518 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
76,340 KB
testcase_01 AC 75 ms
76,284 KB
testcase_02 AC 73 ms
76,348 KB
testcase_03 AC 74 ms
76,392 KB
testcase_04 AC 75 ms
76,300 KB
testcase_05 AC 74 ms
76,164 KB
testcase_06 AC 73 ms
76,132 KB
testcase_07 AC 75 ms
76,264 KB
testcase_08 AC 75 ms
76,420 KB
testcase_09 AC 76 ms
76,064 KB
testcase_10 AC 76 ms
76,300 KB
testcase_11 AC 75 ms
76,412 KB
testcase_12 AC 73 ms
76,080 KB
testcase_13 AC 74 ms
76,312 KB
testcase_14 AC 75 ms
76,376 KB
testcase_15 AC 75 ms
76,072 KB
testcase_16 AC 75 ms
76,304 KB
testcase_17 AC 75 ms
76,328 KB
testcase_18 AC 75 ms
76,300 KB
testcase_19 AC 75 ms
76,460 KB
testcase_20 AC 76 ms
76,404 KB
testcase_21 AC 77 ms
76,036 KB
testcase_22 AC 75 ms
76,088 KB
testcase_23 AC 75 ms
76,268 KB
testcase_24 AC 75 ms
76,296 KB
testcase_25 AC 74 ms
76,164 KB
testcase_26 AC 76 ms
76,544 KB
testcase_27 AC 76 ms
76,580 KB
testcase_28 AC 74 ms
76,352 KB
testcase_29 AC 76 ms
76,392 KB
testcase_30 AC 74 ms
76,296 KB
testcase_31 AC 74 ms
76,344 KB
testcase_32 AC 74 ms
76,496 KB
testcase_33 AC 73 ms
76,072 KB
testcase_34 AC 73 ms
76,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def kaibun(s):
    for i in xrange(len(s)/2):
        if s[i] != s[-i-1]:
            return False
    return True

S = raw_input()
N = len(S)

for keta in xrange(N-1, 0, -1):
    for i in xrange(N-keta+1):
        if kaibun(S[i:i+keta]):
            print keta
            exit()
            
0