結果
| 問題 |
No.45 回転寿司
|
| ユーザー |
|
| 提出日時 | 2022-12-04 10:05:20 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 285 bytes |
| コンパイル時間 | 696 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-10-11 09:54:16 |
| 合計ジャッジ時間 | 3,691 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 WA * 17 |
ソースコード
N = int(input())
V = [int(i) for i in input().split()]
if N == 1:
print(V[0])
exit(0)
if N == 2:
print(max(V[0], V[1]))
exit(0)
S = [V[0], V[1], V[2]]
for i in range(3, N):
tmp = max(S[i - 2], S[i - 3])
S.append(tmp + V[i])
print(max(S[N - 1], S[N - 2]))