結果
| 問題 |
No.45 回転寿司
|
| ユーザー |
Shin09shin
|
| 提出日時 | 2019-01-20 14:26:48 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 36 ms / 5,000 ms |
| コード長 | 202 bytes |
| コンパイル時間 | 412 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-12-27 19:54:35 |
| 合計ジャッジ時間 | 2,431 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
n = int(input())
sq = list(map(int,input().split()))
m1 = 0
m2 = 0
m3 = sq[0]
cnt = 1
while cnt < n:
m4 = max([sq[cnt]+m2, sq[cnt]+m1])
m1,m2,m3 = m2,m3,m4
cnt += 1
print(max([m1,m2,m3]))
Shin09shin