結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 11 ms
5,964 KB
testcase_07 AC 11 ms
5,964 KB
testcase_08 WA -
testcase_09 AC 11 ms
5,860 KB
testcase_10 AC 11 ms
5,888 KB
testcase_11 AC 11 ms
5,992 KB
testcase_12 AC 11 ms
5,856 KB
testcase_13 AC 11 ms
5,960 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 12 ms
5,860 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

inp = raw_input()
palin_max = 1

#if len(inp) == 1 or (len(inp) == 2 and inp[0]==inp[1]): break

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)
            print target, palin_max

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

print palin_max    
0