Pagini recente » Cod sursa (job #2643377) | Cod sursa (job #889034) | Cod sursa (job #941259) | Cod sursa (job #2109999) | Cod sursa (job #705994)
Cod sursa(job #705994)
#include<algorithm>
#include<stdio.h>
#include<vector>
using namespace std;
vector <long long> v;
vector<long long>::iterator it;
long long n,q,w;
void be()
{
it=find(v.begin(),v.end(),w);
if(it == v.end() )
v.push_back(w);
}
void torol()
{
it=find(v.begin(),v.end(),w);
if(it!=v.end())
v.erase(it);
}
void ki()
{
it=find(v.begin(),v.end(),w);
if(it != v.end())
printf("1\n");
else
printf("0\n");
}
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
scanf("%lld",&n);
for(int i=0;i<n;i++)
{
scanf("%lld%lld",&q,&w);
switch(q)
{
case 1:be();break;
case 2:torol();break;
case 3:ki();break;
default: break;
}
}
return 0;
}