結果
| 問題 |
No.273 回文分解
|
| コンテスト | |
| ユーザー |
rocoder
|
| 提出日時 | 2017-07-05 01:48:51 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 425 bytes |
| コンパイル時間 | 159 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-10-05 16:25:58 |
| 合計ジャッジ時間 | 2,286 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 10 WA * 22 |
ソースコード
S=input()
a=0
i=0
while i < len(S)-2:
if S[i]==S[i+2]:
j=1
c=3
while i-j>=0 and i+j<len(S)-2 and S[i-j]==S[i+2+j]:
c+=2
j+=1
if c>a:
a=c
i+=1
while i<len(S)-1:
if S[i]==S[i+1]:
j=1
c=2
while i-j>=0 and i+j<len(S)-1 and S[i-j]==S[i+1+j]:
c+=2
j+=1
if c>a:
a=c
i +=1
print(a)
rocoder