結果
| 問題 | No.45 回転寿司 |
| ユーザー |
|
| 提出日時 | 2018-11-02 13:15:33 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 164 ms / 5,000 ms |
| コード長 | 183 bytes |
| 記録 | |
| コンパイル時間 | 646 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-06-02 06:27:21 |
| 合計ジャッジ時間 | 9,011 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
N = int(input())
sushi = list(map(int,input().split()))
res = [0] * (N + 1)
res[1] = sushi[0]
for i in range(2,N+1):
res[i] = max(res[i-2]+sushi[i-1], res[i-1])
print(res[-1])