Pagini recente » Cod sursa (job #104975) | Cod sursa (job #426124) | Cod sursa (job #2361037) | Cod sursa (job #1525612) | Cod sursa (job #2741848)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#ifndef LOCAL
ifstream in("hashuri.in");
ofstream out("hashuri.out");
#define cin in
#define cout out
#endif //LOCAL
int main()
{
int n; cin >> n;
gp_hash_table<int, null_type> s({}, {}, {}, {}, {1 << 20});
for(int i = 0; i < n; i++)
{
int q; cin >> q;
if(q == 1)
{
int x; cin >> x;
s.insert(x);
}
if(q == 2)
{
int x; cin >> x;
if(s.find(x) != s.end())
s.erase(x);
}
if(q == 3)
{
int x; cin >> x;
if(s.find(x) != s.end())
cout << "1\n";
else
cout << "0\n";
#ifdef LOCAL
cout.flush();
#endif //LOCAL
}
}
}