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