結果

問題 No.844 split game
ユーザー totori_nyaatotori_nyaa
提出日時 2019-08-06 16:17:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 648 bytes
コンパイル時間 1,702 ms
コンパイル使用メモリ 170,536 KB
実行使用メモリ 8,724 KB
最終ジャッジ日時 2023-09-25 17:53:25
合計ジャッジ時間 8,071 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
6,644 KB
testcase_01 AC 16 ms
7,108 KB
testcase_02 AC 37 ms
7,372 KB
testcase_03 AC 29 ms
7,520 KB
testcase_04 AC 16 ms
6,476 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 46 ms
8,724 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 47 ms
8,492 KB
testcase_19 AC 46 ms
8,540 KB
testcase_20 AC 45 ms
8,404 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 5 ms
5,640 KB
testcase_27 WA -
testcase_28 AC 4 ms
5,640 KB
testcase_29 AC 5 ms
5,952 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 4 ms
5,736 KB
testcase_33 AC 6 ms
5,928 KB
testcase_34 AC 4 ms
5,892 KB
testcase_35 AC 7 ms
6,056 KB
testcase_36 AC 6 ms
5,664 KB
testcase_37 AC 9 ms
6,052 KB
testcase_38 AC 14 ms
6,628 KB
testcase_39 AC 28 ms
7,384 KB
testcase_40 AC 11 ms
6,440 KB
testcase_41 AC 3 ms
5,616 KB
testcase_42 AC 4 ms
5,564 KB
testcase_43 AC 4 ms
5,560 KB
testcase_44 AC 4 ms
5,616 KB
testcase_45 AC 3 ms
5,556 KB
testcase_46 AC 4 ms
5,736 KB
testcase_47 AC 4 ms
5,560 KB
testcase_48 WA -
testcase_49 AC 3 ms
5,592 KB
testcase_50 AC 4 ms
5,564 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 3 ms
5,664 KB
testcase_54 AC 3 ms
5,692 KB
testcase_55 AC 4 ms
5,652 KB
testcase_56 AC 2 ms
5,496 KB
testcase_57 AC 4 ms
5,832 KB
testcase_58 AC 3 ms
5,620 KB
testcase_59 AC 4 ms
5,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

 
signed main(){
    //cout << setprecision(12) ;
    ios::sync_with_stdio(false);
	cin.tie(0);

    int n,m,a;
    cin>>n>>m>>a;
    vector<vector<pair<int,int>>> v(111111);
    for(int i=0;i<m;i++){
        int l,r,c;
        cin>>l>>r>>c;
        l--;
        v[r].push_back(make_pair(l,c));
    }
    vector<ll> dp(n+1,-a);
    dp[0]=0,dp[n]=0;
    ll ans=0;
    for(int i=0;i<=n;i++){
        ll ret=0;
        for(auto j:v[i]){
            ret = max(ret,dp[j.first]+j.second);
        }
        dp[i] += ret;
        ans = max(ans,dp[i]);
    }
    cout<<ans<<endl;


    
}
0