結果
問題 |
No.45 回転寿司
|
ユーザー |
|
提出日時 | 2015-02-11 23:58:47 |
言語 | Python2 (2.7.18) |
結果 |
RE
|
実行時間 | - |
コード長 | 241 bytes |
コンパイル時間 | 114 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 6,400 KB |
最終ジャッジ日時 | 2024-11-24 07:23:34 |
合計ジャッジ時間 | 1,168 ms |
ジャッジサーバー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]