結果

問題 No.2195 AND Set
ユーザー yansi819yansi819
提出日時 2024-04-11 13:32:04
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 550 bytes
コンパイル時間 5,067 ms
コンパイル使用メモリ 259,968 KB
実行使用メモリ 14,016 KB
最終ジャッジ日時 2024-04-11 13:32:17
合計ジャッジ時間 12,065 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
11,684 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 1,846 ms
6,940 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 -- -
権限があれば一括ダウンロードができます

ソースコード

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;
  set<int> st;
  while (Q--) {
    int t; cin >> t;
    if (t == 1) {
      int x; cin >> x;
      st.insert(x);
    } else if (t == 2) {
      int x; cin >> x;
      st.erase(x);
    } else {
      uint ans = 0xFFFFFFFF;
      for (auto x: st) {
        ans &= x;
      }
      cout << (ans == 0xFFFFFFFF ? (int)-1: (int)ans) << endl;
    }
  }
}
0