結果

問題 No.273 回文分解
ユーザー steek79steek79
提出日時 2015-10-14 18:11:08
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 385 bytes
コンパイル時間 59 ms
コンパイル使用メモリ 6,540 KB
実行使用メモリ 6,148 KB
最終ジャッジ日時 2023-08-25 00:21:45
合計ジャッジ時間 1,874 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 13 ms
5,884 KB
testcase_02 AC 13 ms
5,916 KB
testcase_03 AC 12 ms
5,872 KB
testcase_04 AC 12 ms
5,928 KB
testcase_05 AC 11 ms
6,036 KB
testcase_06 AC 11 ms
5,964 KB
testcase_07 AC 12 ms
6,000 KB
testcase_08 AC 11 ms
6,000 KB
testcase_09 AC 12 ms
5,872 KB
testcase_10 AC 12 ms
6,004 KB
testcase_11 AC 11 ms
5,924 KB
testcase_12 AC 12 ms
6,056 KB
testcase_13 AC 11 ms
5,916 KB
testcase_14 AC 12 ms
6,044 KB
testcase_15 AC 11 ms
5,924 KB
testcase_16 AC 11 ms
5,860 KB
testcase_17 AC 12 ms
5,932 KB
testcase_18 WA -
testcase_19 AC 11 ms
5,888 KB
testcase_20 AC 11 ms
5,928 KB
testcase_21 AC 12 ms
5,960 KB
testcase_22 AC 12 ms
5,960 KB
testcase_23 WA -
testcase_24 AC 12 ms
5,868 KB
testcase_25 AC 12 ms
5,888 KB
testcase_26 AC 12 ms
5,968 KB
testcase_27 AC 11 ms
5,848 KB
testcase_28 AC 12 ms
5,940 KB
testcase_29 AC 12 ms
5,852 KB
testcase_30 AC 12 ms
6,088 KB
testcase_31 WA -
testcase_32 AC 11 ms
5,860 KB
testcase_33 AC 11 ms
5,864 KB
testcase_34 AC 11 ms
5,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
# -*- coding: utf-8 -*-

inp = raw_input()
palin_max = 1

for i in range(len(inp)): #回文の起点
    for j in range(i+palin_max, len(inp)): #回文の終点
        target = inp[i:j+1]
        if target[:(j-i)/2+1] == target[:(j-i-1)/2:-1]:
            palin_max = len(target)

if palin_max == len(inp): #全部同じ文字
    palin_max -= 1

print palin_max    
0