結果
| 問題 | No.273 回文分解 |
| コンテスト | |
| ユーザー |
rocoder
|
| 提出日時 | 2017-07-05 01:48:51 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 425 bytes |
| 記録 | |
| コンパイル時間 | 521 ms |
| コンパイル使用メモリ | 20,716 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2026-04-21 02:59:55 |
| 合計ジャッジ時間 | 7,765 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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