結果
問題 | No.2195 AND Set |
ユーザー | Ekiben542 |
提出日時 | 2024-03-14 22:19:23 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 429 bytes |
コンパイル時間 | 288 ms |
コンパイル使用メモリ | 81,572 KB |
実行使用メモリ | 87,336 KB |
最終ジャッジ日時 | 2024-03-14 22:19:30 |
合計ジャッジ時間 | 6,592 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 36 ms
62,400 KB |
testcase_01 | AC | 35 ms
55,596 KB |
testcase_02 | AC | 1,434 ms
79,596 KB |
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 | -- | - |
ソースコード
from functools import reduce import operator 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: if query[1] in S: S.remove(query[1]) elif query[0] == 3: if not S: print(-1) else: result = reduce(operator.and_, S) print(result)