結果

問題 No.2195 AND Set
ユーザー tailstails
提出日時 2023-01-20 23:26:18
言語 cLay
(20240104-1)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 1,780 ms
コンパイル使用メモリ 161,212 KB
実行使用メモリ 135,856 KB
最終ジャッジ日時 2023-09-05 15:54:31
合計ジャッジ時間 4,486 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
134,452 KB
testcase_01 AC 69 ms
134,416 KB
testcase_02 AC 69 ms
135,552 KB
testcase_03 AC 70 ms
135,568 KB
testcase_04 AC 57 ms
135,684 KB
testcase_05 AC 59 ms
135,760 KB
testcase_06 AC 59 ms
135,856 KB
testcase_07 AC 56 ms
135,848 KB
testcase_08 AC 58 ms
135,752 KB
testcase_09 AC 57 ms
135,808 KB
testcase_10 AC 84 ms
135,644 KB
testcase_11 AC 85 ms
135,576 KB
testcase_12 AC 81 ms
135,572 KB
testcase_13 AC 80 ms
135,652 KB
testcase_14 AC 80 ms
135,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ull s[1<<24]{};
ll@q,a[30]{},n=0;
rep(q){
	ll@t;
	if(t==1){
		ull@x;
		if(!(s[x>>6]&1ull<<x)){
			s[x>>6]|=1ull<<x;
			rep(i,30){
				a[i]+=!(x&1);
				x>>=1;
			}
			++n;
		}
	}
	if(t==2){
		ull@x;
		if(s[x>>6]&1ull<<x){
			s[x>>6]^=1ull<<x;
			rep(i,30){
				a[i]-=!(x&1);
				x>>=1;
			}
			--n;
		}
	}
	if(t==3){
		ll z=-1;
		if(n){
			z=0;
			rrep(i,30){
				z=z*2+!a[i];
			}
		}
		wt(z);
	}
}
0