Pagini recente » Cod sursa (job #2060055) | Cod sursa (job #2155150) | Cod sursa (job #1255513) | Cod sursa (job #3288994) | Cod sursa (job #2487626)
#include <bits/stdc++.h>
#define dim 100005
#define modulo 65453
using namespace std;
string numeproblema="hashuri";
ifstream fin(numeproblema+".in");
ofstream fout(numeproblema+".out");
int n,i,tip,x,rest;
vector <int> s[modulo];
vector<int>::iterator it;
int main()
{
fin>>n;
for(i=1; i<=n; i++)
{
fin>>tip>>x;
rest=x%modulo;
if(tip==1)
{
for(it=s[rest].begin();it!=s[rest].end();it++){
if((*it)==x){
break;
}
}
if(it==s[rest].end()){
s[rest].push_back(x);
}
}
else if(tip==2)
{
for(it=s[rest].begin();it!=s[rest].end();it++){
if((*it)==x){
break;
}
}
if(it!=s[rest].end()){
s[rest].erase(it);
}
}
else
{
for(it=s[rest].begin();it!=s[rest].end();it++){
if((*it)==x){
break;
}
}
if(it!=s[rest].end())
fout<<1<<"\n";
else
fout<<0<<"\n";
}
}
}