結果
| 問題 | No.45 回転寿司 |
| ユーザー |
koyopro
|
| 提出日時 | 2015-09-20 21:34:47 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 271 bytes |
| 記録 | |
| コンパイル時間 | 286 ms |
| コンパイル使用メモリ | 77,728 KB |
| 最終ジャッジ日時 | 2025-12-03 17:10:41 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 4 |
| other | TLE * 1 -- * 29 |
ソースコード
# -*- coding: utf-8 -*-
N, = map(int, raw_input().split())
V = map(int, raw_input().split())
# 動的計画法
# i番目以降で一番高いポイントを返す
def maxv(i):
if i >= len(V): return 0
return max(V[i] + maxv(i + 2), maxv(i + 1))
print maxv(0)
koyopro