Pagini recente » Cod sursa (job #1340467) | Cod sursa (job #1867466) | Cod sursa (job #2358061) | Cod sursa (job #1250936) | Cod sursa (job #2541814)
#include <bits/stdc++.h>
using namespace std;
#define p 700027
ifstream in("hashuri.in");
ofstream out("hashuri.out");
vector < int > h;
vector<int>::iterator tip3 (int x)
{
int k=x%p;
for (vector<int>::iterator it = h.begin() ; it != h.end(); ++it)
if(*it == x)return it;
return h.end();
}
void tip1(int x)
{
int k=x%p;
if(tip3(x)==h.end())h.push_back(x);
}
void tip2(int x)
{
int k=x%p;
vector<int>::iterator it = tip3(x);
if(tip3(x)!=h.end())h.erase(it);
}
int main()
{
long long n;
in>>n;
for(int x,y,i=1;i<=n;i++)
{
in>>x;
if(x==1){in>>y;tip1(y);}
if(x==2){in>>y;tip2(y);}
if(x==3){in>>y;out<<(tip3(y)!=h.end())<<'\n';}
}
in.close();
out.close();
return 0;
}