結果
| 問題 |
No.273 回文分解
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-11-29 23:55:10 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 2,000 ms |
| コード長 | 277 bytes |
| コンパイル時間 | 76 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-06-26 23:06:59 |
| 合計ジャッジ時間 | 2,108 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
S = input()
length = len(S)
ans = 0
for i in range(length - 1):
for j in range(i + 1, length + 1):
l = list(S[i:j])
l2 = l[::-1]
if l == l2:
if ans < len(l) and len(l) != length:
ans = len(l)
print(ans)