結果
問題 | No.588 空白と回文 |
ユーザー |
|
提出日時 | 2020-05-06 15:38:53 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 316 ms / 2,000 ms |
コード長 | 311 bytes |
コンパイル時間 | 75 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-06-28 16:50:12 |
合計ジャッジ時間 | 3,272 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
s=input();n=len(s);ans=0for i in range(n):c=1;j=1while 0<=i-j and i+j<n:if s[i-j]==s[i+j]:c+=2j+=1ans=max(ans,c)for i in range(n-1):c=0;j=0while 0<=i-j and i+1+j<n:if s[i-j]==s[i+1+j]:c+=2j+=1ans=max(ans,c)print(ans)