結果
| 問題 |
No.2195 AND Set
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-11 13:35:21 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 524 bytes |
| コンパイル時間 | 4,452 ms |
| コンパイル使用メモリ | 254,788 KB |
| 最終ジャッジ日時 | 2025-02-20 23:52:54 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | WA * 13 |
ソースコード
#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;
}
}
}