結果

問題 No.631 Noelちゃんと電車旅行
ユーザー tailstails
提出日時 2021-12-22 21:35:16
言語 cLay
(20240104-1)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 5,652 ms
コンパイル使用メモリ 176,712 KB
実行使用メモリ 10,676 KB
最終ジャッジ日時 2024-04-10 08:08:02
合計ジャッジ時間 6,040 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
6,816 KB
testcase_01 AC 33 ms
9,168 KB
testcase_02 AC 34 ms
9,168 KB
testcase_03 AC 32 ms
10,676 KB
testcase_04 AC 31 ms
9,160 KB
testcase_05 AC 31 ms
9,168 KB
testcase_06 AC 15 ms
6,944 KB
testcase_07 AC 8 ms
7,500 KB
testcase_08 AC 24 ms
8,784 KB
testcase_09 AC 28 ms
7,168 KB
testcase_10 AC 20 ms
9,036 KB
testcase_11 AC 19 ms
8,140 KB
testcase_12 AC 23 ms
8,652 KB
testcase_13 AC 20 ms
7,108 KB
testcase_14 AC 10 ms
6,944 KB
testcase_15 AC 16 ms
6,940 KB
testcase_16 AC 1 ms
6,940 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 AC 1 ms
6,940 KB
testcase_19 AC 1 ms
6,944 KB
testcase_20 AC 1 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[0].b=(n-1)*3;
	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);
	}
}
0