Pagini recente » Cod sursa (job #2069764) | Cod sursa (job #183418) | Monitorul de evaluare | Cod sursa (job #984544) | Cod sursa (job #1876352)
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
const int h=103;
vector<int> s[h];
int n,x,y,c;
int main()
{
f>>n;
for(; n; n--)
{
f>>c>>x;
y=x%h;
vector<int>::iterator it;
for(it=s[y].begin(); it!=s[y].end(); it++)
if(*it==x)
break;
if(c==1)
if(it==s[y].end())
s[y].push_back(x);
if(c==2)
if(it!=s[y].end())
{
*it=s[y].back();
s[y].pop_back();
}
if(c==3)
g<<(it!=s[y].end())<<'\n';
}
return 0;
}