結果

問題 No.631 Noelちゃんと電車旅行
ユーザー tailstails
提出日時 2021-12-22 21:31:33
言語 cLay
(20240104-1)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 3,092 ms
コンパイル使用メモリ 176,072 KB
実行使用メモリ 11,016 KB
最終ジャッジ日時 2024-04-10 08:08:09
合計ジャッジ時間 5,380 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
6,812 KB
testcase_01 AC 30 ms
9,164 KB
testcase_02 AC 29 ms
9,040 KB
testcase_03 AC 30 ms
10,492 KB
testcase_04 AC 28 ms
9,036 KB
testcase_05 AC 29 ms
9,164 KB
testcase_06 AC 13 ms
8,776 KB
testcase_07 AC 8 ms
7,500 KB
testcase_08 AC 23 ms
8,652 KB
testcase_09 AC 29 ms
7,296 KB
testcase_10 AC 20 ms
9,036 KB
testcase_11 AC 18 ms
7,488 KB
testcase_12 AC 23 ms
11,016 KB
testcase_13 AC 21 ms
6,944 KB
testcase_14 AC 9 ms
6,940 KB
testcase_15 AC 17 ms
6,940 KB
testcase_16 AC 2 ms
6,940 KB
testcase_17 AC 1 ms
6,944 KB
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 1 ms
6,940 KB
testcase_20 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

struct segt{
	ll a,b;
};

segtree_ph<segt>t;

inline segt segtree_ph_func(segt a,segt b){
	return {max(a.a,a.b+b.a),a.b+b.b};
}

{
	ll@n;
	t.walloc(n,1);
	rep(i,n-1){
		ll@u;
		t[i+1]=segt{u-3*i,0};
	}
	t.build();
	ll@m;
	rep(m){
		ll@l,@r,@d;
		--l;
		t.change(l,{t[l].a,t[l].b+d});
		t.change(r,{t[r].a,t[r].b-d});
		wt(t.val[1].a+(n-1)*3);
	}
}
0