Pagini recente » Cod sursa (job #193427) | Cod sursa (job #1348691) | Cod sursa (job #571641) | Cod sursa (job #2359625) | Cod sursa (job #1076298)
#include <iostream>
#include<fstream>
using namespace std;
int hash[1000001];
ifstream f("hashuri.in");
ofstream g("hashuri.out");
void op1(int x)
{
if(hash[x]==0)
hash[x]=1;
}
void op2(int x)
{
if(hash[x]==1)
hash[x]=0;
}
int op3(int x)
{
if(hash[x]==1)
return 1;
}
int main()
{
int nr,i,x,op;
f>>nr;
for(i=1;i<=nr;i++)
{
f>>op>>x;
if(op==1)
op1(x);
else if(op==2)
op2(x);
else if(op==3)
g<<op3(x)<<endl;
}
return 0;
}