結果

問題 No.844 split game
ユーザー convexineqconvexineq
提出日時 2019-06-28 23:51:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 459 bytes
コンパイル時間 832 ms
コンパイル使用メモリ 10,752 KB
実行使用メモリ 58,976 KB
最終ジャッジ日時 2023-09-14 22:47:33
合計ジャッジ時間 20,347 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 331 ms
27,056 KB
testcase_01 AC 455 ms
42,496 KB
testcase_02 AC 647 ms
38,692 KB
testcase_03 AC 630 ms
44,660 KB
testcase_04 AC 292 ms
24,820 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 931 ms
58,864 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 934 ms
58,812 KB
testcase_19 AC 897 ms
58,804 KB
testcase_20 AC 924 ms
58,804 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 38 ms
10,012 KB
testcase_27 WA -
testcase_28 AC 41 ms
10,584 KB
testcase_29 AC 71 ms
12,372 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 38 ms
10,428 KB
testcase_33 AC 65 ms
9,888 KB
testcase_34 AC 43 ms
9,296 KB
testcase_35 AC 76 ms
10,328 KB
testcase_36 AC 50 ms
9,392 KB
testcase_37 AC 108 ms
11,356 KB
testcase_38 AC 235 ms
17,564 KB
testcase_39 AC 500 ms
27,928 KB
testcase_40 AC 272 ms
27,744 KB
testcase_41 AC 16 ms
7,776 KB
testcase_42 AC 16 ms
7,768 KB
testcase_43 AC 16 ms
7,852 KB
testcase_44 AC 17 ms
7,768 KB
testcase_45 AC 16 ms
7,868 KB
testcase_46 AC 16 ms
7,792 KB
testcase_47 AC 17 ms
7,916 KB
testcase_48 WA -
testcase_49 AC 16 ms
7,792 KB
testcase_50 AC 16 ms
7,920 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 16 ms
7,792 KB
testcase_54 AC 16 ms
7,816 KB
testcase_55 AC 17 ms
7,960 KB
testcase_56 AC 16 ms
7,712 KB
testcase_57 AC 16 ms
7,944 KB
testcase_58 AC 16 ms
7,848 KB
testcase_59 AC 17 ms
7,776 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)] + [[i,n,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