結果
問題 |
No.273 回文分解
|
ユーザー |
![]() |
提出日時 | 2021-01-18 00:20:27 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 2,000 ms |
コード長 | 300 bytes |
コンパイル時間 | 196 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-11-30 06:56:47 |
合計ジャッジ時間 | 2,279 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
def is_palindrome(s): return s == s[::-1] S = input() result = 0 for i in range(len(S)): for j in range(i + 1, len(S) + 1): if i == 0 and j == len(S): continue if not is_palindrome(S[i:j]): continue result = max(result, j - i) print(result)