結果

問題 No.844 split game
ユーザー totori_nyaatotori_nyaa
提出日時 2019-08-06 16:18:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 642 bytes
コンパイル時間 2,765 ms
コンパイル使用メモリ 171,788 KB
実行使用メモリ 9,164 KB
最終ジャッジ日時 2023-09-25 17:53:32
合計ジャッジ時間 5,072 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
6,964 KB
testcase_01 AC 16 ms
7,304 KB
testcase_02 AC 37 ms
8,288 KB
testcase_03 AC 30 ms
8,008 KB
testcase_04 AC 15 ms
6,608 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,940 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 48 ms
9,148 KB
testcase_19 AC 48 ms
9,164 KB
testcase_20 AC 48 ms
9,136 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 4 ms
5,848 KB
testcase_27 WA -
testcase_28 AC 4 ms
5,572 KB
testcase_29 AC 6 ms
6,016 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 4 ms
5,716 KB
testcase_33 AC 7 ms
6,044 KB
testcase_34 AC 5 ms
6,048 KB
testcase_35 AC 7 ms
6,160 KB
testcase_36 AC 5 ms
6,024 KB
testcase_37 AC 9 ms
6,332 KB
testcase_38 AC 15 ms
7,164 KB
testcase_39 AC 31 ms
8,132 KB
testcase_40 AC 11 ms
6,784 KB
testcase_41 AC 4 ms
5,768 KB
testcase_42 AC 4 ms
5,628 KB
testcase_43 AC 4 ms
5,672 KB
testcase_44 AC 3 ms
5,776 KB
testcase_45 AC 3 ms
5,692 KB
testcase_46 AC 3 ms
5,728 KB
testcase_47 AC 4 ms
5,636 KB
testcase_48 WA -
testcase_49 AC 3 ms
5,752 KB
testcase_50 AC 4 ms
5,652 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 3 ms
5,652 KB
testcase_54 AC 4 ms
5,640 KB
testcase_55 AC 4 ms
5,676 KB
testcase_56 AC 4 ms
5,624 KB
testcase_57 AC 4 ms
5,756 KB
testcase_58 AC 3 ms
5,628 KB
testcase_59 AC 3 ms
5,644 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);

    ll n,m,a;
    cin>>n>>m>>a;
    vector<vector<pair<ll,ll>>> v(111111);
    for(ll i=0;i<m;i++){
        ll 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(ll 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