Pagini recente » Cod sursa (job #1987051) | Cod sursa (job #651485) | Cod sursa (job #2974714) | Cod sursa (job #368246) | Cod sursa (job #3230331)
#include <bits/stdc++.h>
#define mod 666013
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n,c,x,k;
unordered_map <int,int> a;
/*bool findx(int x)
{
int k=x%mod;
for (auto a:h[k] )
if ( a==x )
return 1;
return 0;
}
void insertx (int x)
{
int k=x%mod;
h[k].push_back(x);
}
void erasex (int x)
{
int k=x%mod;
vector <int> cpy;
for (auto a:h[k] )
if ( a!=x )
cpy.push_back(a);
h[k]=cpy;
}*/
int main()
{
f >> n;
for (int i=1; i<=n; i++ )
{
f >> c >> x;
if ( c==1 )
a[x]++;
else if ( c==2 && a[x] )
a[x]--;
else if ( c==3 )
g << (a[x]>0) << '\n';
}
return 0;
}