結果

問題 No.2220 Range Insert & Point Mex
ユーザー tailstails
提出日時 2023-02-20 18:26:40
言語 cLay
(20240104-1)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 6,186 ms
コンパイル使用メモリ 211,944 KB
実行使用メモリ 16,700 KB
最終ジャッジ日時 2023-09-28 18:22:32
合計ジャッジ時間 9,910 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 50 ms
16,336 KB
testcase_14 AC 50 ms
16,388 KB
testcase_15 AC 48 ms
16,460 KB
testcase_16 AC 48 ms
16,340 KB
testcase_17 AC 48 ms
16,320 KB
testcase_18 AC 48 ms
16,300 KB
testcase_19 AC 48 ms
16,404 KB
testcase_20 AC 41 ms
12,432 KB
testcase_21 AC 41 ms
12,432 KB
testcase_22 AC 41 ms
12,548 KB
testcase_23 AC 75 ms
16,692 KB
testcase_24 AC 68 ms
15,848 KB
testcase_25 AC 39 ms
13,056 KB
testcase_26 AC 73 ms
16,700 KB
testcase_27 AC 64 ms
14,492 KB
testcase_28 AC 10 ms
6,528 KB
testcase_29 AC 6 ms
6,176 KB
testcase_30 AC 6 ms
6,128 KB
testcase_31 AC 44 ms
16,212 KB
testcase_32 AC 38 ms
13,924 KB
testcase_33 AC 37 ms
13,836 KB
testcase_34 AC 55 ms
15,928 KB
testcase_35 AC 55 ms
15,740 KB
testcase_36 AC 54 ms
15,704 KB
testcase_37 AC 54 ms
15,788 KB
testcase_38 AC 63 ms
16,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

set<ll>s;
ll@n,e[3d5],c[n]{},j=0;
rep(n){
	ll@l,@r,@a;
	if(a<n){
		e[j++]=l<<32|0ll<<30|a;
		e[j++]=r<<32|2ll<<30|a;
	}
}
ll@q,r[q];
rep(i,q){
	ll@x;
	e[j++]=x<<32|1ll<<30|i;
}
sortA(j,e);
s.insert(0..n);
rep[e](x,j){
	ll t=x>>30&3;
	ll a=x&(1<<30)-1;
	if(t==0){
		if(!c[a]++){
			s.erase(a);
		}
	}
	if(t==1){
		r[a]=*s.begin();
	}
	if(t==2){
		if(!--c[a]){
			s.insert(a);
		}
	}
}
wtLn(r(q));
0