結果

問題 No.511 落ちゲー 〜手作業のぬくもり〜
ユーザー tailstails
提出日時 2020-09-25 12:17:31
言語 cLay
(20240104-1)
結果
AC  
実行時間 87 ms / 4,000 ms
コード長 556 bytes
コンパイル時間 2,244 ms
コンパイル使用メモリ 165,448 KB
実行使用メモリ 12,236 KB
最終ジャッジ日時 2023-08-16 03:11:07
合計ジャッジ時間 4,215 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,400 KB
testcase_01 AC 2 ms
5,468 KB
testcase_02 AC 2 ms
5,420 KB
testcase_03 AC 1 ms
5,672 KB
testcase_04 AC 2 ms
5,464 KB
testcase_05 AC 2 ms
5,408 KB
testcase_06 AC 1 ms
5,528 KB
testcase_07 AC 1 ms
5,464 KB
testcase_08 AC 2 ms
5,468 KB
testcase_09 AC 1 ms
5,540 KB
testcase_10 AC 1 ms
5,468 KB
testcase_11 AC 1 ms
5,408 KB
testcase_12 AC 2 ms
5,392 KB
testcase_13 AC 1 ms
5,468 KB
testcase_14 AC 2 ms
5,388 KB
testcase_15 AC 2 ms
5,404 KB
testcase_16 AC 2 ms
5,656 KB
testcase_17 AC 2 ms
5,468 KB
testcase_18 AC 2 ms
5,412 KB
testcase_19 AC 1 ms
5,456 KB
testcase_20 AC 2 ms
5,396 KB
testcase_21 AC 2 ms
5,476 KB
testcase_22 AC 2 ms
5,408 KB
testcase_23 AC 2 ms
5,480 KB
testcase_24 AC 2 ms
5,660 KB
testcase_25 AC 2 ms
5,568 KB
testcase_26 AC 2 ms
5,476 KB
testcase_27 AC 3 ms
5,500 KB
testcase_28 AC 2 ms
5,448 KB
testcase_29 AC 87 ms
12,236 KB
testcase_30 AC 79 ms
12,100 KB
testcase_31 AC 67 ms
12,192 KB
testcase_32 AC 56 ms
12,104 KB
testcase_33 AC 53 ms
7,416 KB
testcase_34 AC 45 ms
6,608 KB
testcase_35 AC 82 ms
12,100 KB
testcase_36 AC 82 ms
12,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

struct M{
	ll y,m,i;
};

inline void segtree_pg_func(M&r,M a,M b){
	if(a.m<a.y+b.m)
		r={a.y+b.y,a.y+b.m,b.i};
	else
		r={a.y+b.y,a.m,a.i};
}

segtree_pg<M>t;

inline void add(int i,ll v){
	M& m=t[i];
	m.y+=v;
	t.build(i+t.N);
}

ll n,w,h,a,b,o,x,z;
{
	rd(n,w,h);
	t.walloc(w+1);
	t.setN(w+1,0,0);
	rep(i,w+1)t[i]={0,0,i};
	t.build();
	rep(i,n){
		rd(a,b,x);
		add(x-1,b);
		add(x-1+a,-b);
		o=h-t.get(0,x).y;
		for(M m;m=t.get(x,x+a),m.m>=o;z+=i%2*2-1){
			add(m.i-1,-1d16);
			add(m.i,1d16);
			if(m.i==x)o+=1d16;
		}
	}
	puts(z>0?"B":z<0?"A":"DRAW");
}
0