結果

問題 No.2195 AND Set
ユーザー Ekiben542Ekiben542
提出日時 2024-03-14 21:57:54
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 412 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 265,764 KB
最終ジャッジ日時 2024-03-14 21:58:03
合計ジャッジ時間 8,735 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 TLE -
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 #

Q = int(input().strip())
S = set()
for _ in range(Q):
    query = list(map(int, input().strip().split()))
    if query[0] == 1:
        S.add(query[1])
    elif query[0] == 2:
        S.discard(query[1])
    elif query[0] == 3:
        if len(S) == 0:
            print(-1)
        else:
            result = list(S)[0]
            for num in list(S)[1:]:
                result &= num
            print(result)
0