結果
| 問題 |
No.974 最後の日までに
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2021-05-05 01:57:05 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 279 bytes |
| コンパイル時間 | 432 ms |
| コンパイル使用メモリ | 82,360 KB |
| 実行使用メモリ | 97,004 KB |
| 最終ジャッジ日時 | 2024-07-23 21:29:03 |
| 合計ジャッジ時間 | 7,246 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | TLE * 1 -- * 48 |
ソースコード
def dfs(t,m,v):
global ans
if t==w:
if m >= 0: ans = max(ans,v)
return
dfs(t+1,m+abc[t][0],v)
if t+1 < w: dfs(t+2,m-abc[t+1][2],v+abc[t+1][1])
w = int(input())
abc = [list(map(int,input().split())) for _ in range(w)]
ans = 0
dfs(0,0,0)
print(ans)
convexineq