結果

問題 No.844 split game
ユーザー tamatotamato
提出日時 2020-02-25 23:08:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 467 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 90,624 KB
最終ジャッジ日時 2024-04-21 15:44:46
合計ジャッジ時間 10,550 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 163 ms
80,896 KB
testcase_01 AC 125 ms
78,336 KB
testcase_02 AC 305 ms
88,832 KB
testcase_03 AC 224 ms
83,712 KB
testcase_04 AC 131 ms
78,208 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 321 ms
87,808 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 321 ms
88,192 KB
testcase_19 AC 335 ms
88,448 KB
testcase_20 AC 324 ms
87,936 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 57 ms
64,128 KB
testcase_27 WA -
testcase_28 AC 48 ms
61,184 KB
testcase_29 AC 68 ms
68,736 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 67 ms
62,976 KB
testcase_33 AC 98 ms
73,856 KB
testcase_34 AC 88 ms
69,760 KB
testcase_35 AC 121 ms
77,440 KB
testcase_36 AC 96 ms
71,040 KB
testcase_37 AC 135 ms
77,696 KB
testcase_38 AC 114 ms
81,792 KB
testcase_39 AC 196 ms
84,224 KB
testcase_40 AC 85 ms
77,824 KB
testcase_41 AC 36 ms
51,840 KB
testcase_42 AC 36 ms
51,584 KB
testcase_43 AC 35 ms
51,968 KB
testcase_44 AC 36 ms
51,840 KB
testcase_45 AC 36 ms
51,712 KB
testcase_46 AC 35 ms
51,712 KB
testcase_47 AC 36 ms
51,968 KB
testcase_48 WA -
testcase_49 AC 36 ms
51,968 KB
testcase_50 AC 37 ms
51,584 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 36 ms
51,584 KB
testcase_54 AC 36 ms
51,840 KB
testcase_55 AC 36 ms
51,968 KB
testcase_56 AC 38 ms
51,840 KB
testcase_57 AC 41 ms
51,840 KB
testcase_58 AC 36 ms
51,712 KB
testcase_59 AC 36 ms
51,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    import sys
    input = sys.stdin.buffer.readline

    N, M, x = map(int, input().split())
    info = [None] * M
    for i in range(M):
        info[i] = tuple(map(int, input().split()))
    info.sort(key=lambda e: e[0])
    info.sort(key=lambda e: e[1])

    dp = [-x] * (N+2)
    dp[1] = 0
    for l, r, p in info:
        flg = int(r!=N)
        dp[r+1] = max(dp[r+1], dp[l] + p - x * flg)
    print(max(dp))


if __name__ == '__main__':
    main()
0