結果
問題 |
No.45 回転寿司
|
ユーザー |
![]() |
提出日時 | 2018-05-02 22:29:04 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 298 bytes |
コンパイル時間 | 222 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 17,564 KB |
最終ジャッジ日時 | 2024-06-28 00:23:59 |
合計ジャッジ時間 | 12,730 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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))