結果

問題 No.2195 AND Set
ユーザー yansi819yansi819
提出日時 2024-04-11 13:35:21
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 524 bytes
コンパイル時間 4,991 ms
コンパイル使用メモリ 259,212 KB
実行使用メモリ 8,320 KB
最終ジャッジ日時 2024-04-11 13:35:33
合計ジャッジ時間 11,559 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
using mint = modint998244353;

int main() {
  int Q; cin >> Q;
  uint ans = 0xFFFFFFFF;
  set<int> st;
  while (Q--) {
    int t; cin >> t;
    if (t == 1) {
      int x; cin >> x;
      st.insert(x);
      ans &= x;
    } else if (t == 2) {
      int x; cin >> x;
      st.erase(x);
      ans ^= x;
    } else {
      cout << (st.size() == 0 ? (int)-1: (int)ans) << endl;
    }
  }
}
0