結果

問題 No.2195 AND Set
ユーザー ニックネームニックネーム
提出日時 2023-01-20 21:46:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 506 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 10,796 KB
実行使用メモリ 21,080 KB
最終ジャッジ日時 2023-09-05 14:02:16
合計ジャッジ時間 22,258 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,188 KB
testcase_01 AC 16 ms
7,800 KB
testcase_02 AC 1,804 ms
9,344 KB
testcase_03 AC 1,985 ms
11,368 KB
testcase_04 AC 1,797 ms
9,232 KB
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

a = [[0,0] for _ in range(30)]; s = set()
for _ in range(int(input())):
    q = list(map(int,input().split()))
    if q[0]==1:
        x = q[1]
        if x in s: continue
        for i in range(30): a[i][x>>i&1] += 1
        s.add(x)
    if q[0]==2:
        x = q[1]
        if x not in s: continue
        for i in range(30): a[i][x>>i&1] -= 1
        s.remove(x)
    if q[0]==3:
        ans = 0
        for i,(p,q) in enumerate(a):
            if not p and q: ans |= 1<<i
        print(ans if s else -1)
0