結果
| 問題 | No.45 回転寿司 |
| ユーザー |
|
| 提出日時 | 2015-02-11 23:58:47 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 241 bytes |
| 記録 | |
| コンパイル時間 | 117 ms |
| コンパイル使用メモリ | 77,512 KB |
| 最終ジャッジ日時 | 2025-12-03 13:49:33 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 RE * 1 |
| other | AC * 30 |
ソースコード
N = int(raw_input())
if N == 0: print int(raw_input())
else:
V = map(int,raw_input().split())
dp = [0]*N
dp[0] = V[0]
dp[1] = max(V[0],V[1])
for i in range(2,N):
dp[i] = max(dp[i-1],dp[i-2]+V[i])
print dp[N-1]