結果
| 問題 | No.45 回転寿司 |
| ユーザー |
mkawa2
|
| 提出日時 | 2019-04-18 16:11:52 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 232 bytes |
| 記録 | |
| コンパイル時間 | 149 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 937,136 KB |
| 最終ジャッジ日時 | 2024-09-22 09:18:46 |
| 合計ジャッジ時間 | 16,861 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 4 |
| other | MLE * 2 -- * 28 |
ソースコード
def f(i,k):
if i>n:
return k
t=(i,k)
if t in memo:
return memo[t]
re=max(f(i+1,k),f(i+2,k+v[i]))
memo[t]=re
return re
memo={}
n=int(input())
v=[0]+list(map(int,input().split()))
print(f(1,0))
mkawa2