結果

問題 No.2195 AND Set
ユーザー ShirotsumeShirotsume
提出日時 2022-11-28 10:52:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 574 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 126,720 KB
最終ジャッジ日時 2024-04-15 20:21:59
合計ジャッジ時間 6,112 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
57,344 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(q, qu):
    s = set()
    X = []
    bit = [0] * 30
    for v in qu:
        t = v[0]
        if t == 1:
            x = v[1]
            if x not in s:
                s.add(x)
        elif t == 2:
            x = v[1]
            if x in s:
                s.discard(x)
        else:
            ans = (1 << 30) - 1
            if not s:
                ans &= 0
            for v in s:
                ans &= v
            X.append(ans)
    return X

q = int(input())

qu = [list(map(int,input().split())) for _ in range(q)]

for v in solve(q, qu):
    print(v)
0