結果
| 問題 |
No.844 split game
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2019-06-28 23:19:27 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 327 bytes |
| コンパイル時間 | 122 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 47,520 KB |
| 最終ジャッジ日時 | 2024-07-02 05:10:29 |
| 合計ジャッジ時間 | 18,175 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 4 |
| other | RE * 56 |
ソースコード
# coding: utf-8
# Your code here!
n,m,a = [int(i) for i in input().split()]
lrp = [[int(i) for i in input().split()] for _ in range(m)] + [[0,i,0] for i in range(1,n+1)]
lrp.sort(key = lambda x: x[1])
inf = 1e18
dp = [-inf]*(n+1)
dp[0] = 0
for l,r,p in lrp:
dp[r+1] = max(dp[r+1], dp[l]+p-a)
print(dp)
print(max(dp))
convexineq