結果

問題 No.844 split game
ユーザー convexineqconvexineq
提出日時 2019-06-28 23:25:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 425 bytes
コンパイル時間 414 ms
コンパイル使用メモリ 10,820 KB
実行使用メモリ 45,000 KB
最終ジャッジ日時 2023-09-14 22:43:47
合計ジャッジ時間 17,096 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 283 ms
22,292 KB
testcase_01 AC 312 ms
29,936 KB
testcase_02 AC 588 ms
34,096 KB
testcase_03 AC 479 ms
33,916 KB
testcase_04 AC 233 ms
20,344 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 783 ms
45,000 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 768 ms
44,820 KB
testcase_19 AC 788 ms
44,952 KB
testcase_20 AC 751 ms
44,928 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 32 ms
9,400 KB
testcase_27 WA -
testcase_28 AC 31 ms
9,648 KB
testcase_29 AC 61 ms
11,088 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 30 ms
9,556 KB
testcase_33 AC 65 ms
9,876 KB
testcase_34 AC 44 ms
9,112 KB
testcase_35 AC 77 ms
10,248 KB
testcase_36 AC 50 ms
9,356 KB
testcase_37 AC 108 ms
11,144 KB
testcase_38 AC 219 ms
16,880 KB
testcase_39 AC 453 ms
26,328 KB
testcase_40 AC 202 ms
20,628 KB
testcase_41 AC 16 ms
7,764 KB
testcase_42 AC 16 ms
7,916 KB
testcase_43 AC 16 ms
7,848 KB
testcase_44 AC 16 ms
7,780 KB
testcase_45 AC 17 ms
7,780 KB
testcase_46 AC 16 ms
7,808 KB
testcase_47 AC 16 ms
7,916 KB
testcase_48 WA -
testcase_49 AC 15 ms
7,796 KB
testcase_50 AC 15 ms
7,792 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 16 ms
7,764 KB
testcase_54 AC 16 ms
7,804 KB
testcase_55 AC 17 ms
7,748 KB
testcase_56 AC 16 ms
7,916 KB
testcase_57 AC 16 ms
7,852 KB
testcase_58 AC 17 ms
7,792 KB
testcase_59 AC 16 ms
7,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 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)] + [[1,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:
    l-=1
    r-=1
    if r != n-1:
        dp[r+1] = max(dp[r+1], dp[l]+p-a)
    else:
        dp[r+1] = max(dp[r+1], dp[l]+p)
        
#print(dp)

print(max(dp))
0