結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 183 ms
80,896 KB
testcase_01 AC 152 ms
78,336 KB
testcase_02 AC 399 ms
88,960 KB
testcase_03 AC 282 ms
83,840 KB
testcase_04 AC 168 ms
77,952 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 427 ms
88,704 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 421 ms
88,276 KB
testcase_19 AC 426 ms
87,936 KB
testcase_20 AC 429 ms
87,992 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 70 ms
64,000 KB
testcase_27 WA -
testcase_28 AC 62 ms
61,568 KB
testcase_29 AC 83 ms
68,736 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 69 ms
63,488 KB
testcase_33 AC 110 ms
77,056 KB
testcase_34 AC 83 ms
69,376 KB
testcase_35 AC 116 ms
77,440 KB
testcase_36 AC 89 ms
70,656 KB
testcase_37 AC 127 ms
77,440 KB
testcase_38 AC 184 ms
81,408 KB
testcase_39 AC 335 ms
84,992 KB
testcase_40 AC 118 ms
78,464 KB
testcase_41 AC 47 ms
51,840 KB
testcase_42 AC 48 ms
52,096 KB
testcase_43 AC 47 ms
51,584 KB
testcase_44 AC 46 ms
51,712 KB
testcase_45 AC 47 ms
51,712 KB
testcase_46 AC 47 ms
51,968 KB
testcase_47 AC 49 ms
51,968 KB
testcase_48 WA -
testcase_49 AC 48 ms
51,968 KB
testcase_50 AC 48 ms
51,840 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 47 ms
51,712 KB
testcase_54 AC 47 ms
51,968 KB
testcase_55 AC 47 ms
52,224 KB
testcase_56 AC 48 ms
51,712 KB
testcase_57 AC 47 ms
51,584 KB
testcase_58 AC 47 ms
51,712 KB
testcase_59 AC 47 ms
51,968 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[1])
    info.sort(key=lambda e: e[0])

    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