Pagini recente » Cod sursa (job #531427) | Cod sursa (job #3292054) | Cod sursa (job #2385850) | Cod sursa (job #2514738) | Cod sursa (job #2850426)
#include <bits/stdc++.h>
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
typedef long long ll;
/*struct custom_hash
{
static ll splitmix64(ll x)
{
// http://xorshift.di.unimi.it/splitmix64.c
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31);
}
size_t operator()(ll x) const
{
static const ll FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
return splitmix64(x + FIXED_RANDOM);
}
};
unordered_set<ll,custom_hash> s;*/
unordered_set<int> s;
ll q,t,x;
int main()
{
in>>q;
while(q--)
{
in>>t>>x;
if(t==1) s.insert(x);
else if(t==2)
{
if(s.count(x))
s.erase(s.find(x));
}
else
{
if(s.count(x))
out<<1<<'\n';
else out<<0<<'\n';
}
}
return 0;
}