結果

問題 No.2195 AND Set
ユーザー ShirotsumeShirotsume
提出日時 2022-11-25 12:43:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 464 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 126,848 KB
最終ジャッジ日時 2024-04-15 20:21:18
合計ジャッジ時間 5,776 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
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 = []
    for v in qu:
        if v[0] == 1:
            s.add(v[1])
        if v[0] == 2:
            s.discard(v[1])
        if v[0] == 3:
            ans = 0
            for v in s:
                ans |= v
                if ans == (2 ** 30 - 1):
                    break
            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