結果
問題 |
No.45 回転寿司
|
ユーザー |
![]() |
提出日時 | 2018-05-02 22:28:28 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 297 bytes |
コンパイル時間 | 163 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 50,228 KB |
最終ジャッジ日時 | 2024-06-28 00:23:46 |
合計ジャッジ時間 | 12,603 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | TLE * 1 -- * 29 |
ソースコード
# coding : utf-8 import numpy as np N = int(input()) K = [int(i) for i in input().split()] #DP = [[0 for i in range(N)] for j in range(N)] def bfs(lt,cost): if lt == N: return cost + K[lt-1] if lt > N: return cost return max(bfs(lt+1,cost),bfs(lt+2,cost+K[lt-1])) print(bfs(1,0))