結果
| 問題 |
No.273 回文分解
|
| コンテスト | |
| ユーザー |
HIROPON87069639
|
| 提出日時 | 2016-02-18 21:30:13 |
| 言語 | Python2 (2.7.18) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 367 bytes |
| コンパイル時間 | 60 ms |
| コンパイル使用メモリ | 7,040 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-23 13:14:55 |
| 合計ジャッジ時間 | 1,577 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 WA * 4 |
ソースコード
# -*- coding: utf-8 -*-
def ch(S):
N = len(S)
SR = S[:]
SR.reverse()
if S == SR:
return N
else:
return 0
S = list(raw_input())
N = len(S)
cntmax = 0
if len(S) == 2:
print 1
exit()
for i in range(0, N-1):
for j in range(i+1, N+1):
tmp = ch(S[i:j])
if cntmax < tmp:
cntmax = tmp
print cntmax
HIROPON87069639