結果

問題 No.45 回転寿司
ユーザー tookunn_1213
提出日時 2015-09-19 11:29:15
言語 Python2
(2.7.18)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 220 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 17,024 KB
最終ジャッジ日時 2024-11-24 10:32:14
合計ジャッジ時間 175,595 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 2 TLE * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

def dfs(N,V,i):
	if i >= N:return 0
	ret = 0
	ret = max(ret,dfs(N,V,i + 2) + V[i])
	ret = max(ret,dfs(N,V,i + 3) + V[i])
	return ret

N = int(raw_input())
V = map(int,raw_input().split())
print max(dfs(N,V,0),dfs(N,V,1))
0