結果
問題 |
No.273 回文分解
|
ユーザー |
![]() |
提出日時 | 2020-04-30 22:13:33 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 253 bytes |
コンパイル時間 | 298 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-12-17 19:27:38 |
合計ジャッジ時間 | 2,299 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
import sys input=lambda: sys.stdin.readline().rstrip() S=input() n=len(S) ans=1 for i in range(n): for j in range(i+1,n+1): if j-i<=ans or (i==0 and j==n): continue else: SS=S[i:j] if SS==SS[::-1]: ans=j-i print(ans)