Pagini recente » Cod sursa (job #2833220) | Cod sursa (job #280358) | Cod sursa (job #3271875) | Cod sursa (job #1205446) | Cod sursa (job #2594258)
#include <iostream>
#include <fstream>
#include <set>
using namespace std;
const int m=100005;
set<long long> v[m];
int main()
{
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
int t;
cin>>t;
for(int i=1; i<=t; i++)
{
int x;
long long y;
cin>>x>>y;
if(x==1)
v[y%m].insert(y);
else if(x==2)
{
if(v[y%m].find(y)!=v[y%m].end())
v[y%m].erase(y);
}
else if(x==3)
{
if(v[y%m].find(y)!=v[y%m].end())
cout<<1<<"\n";
else
cout<<0<<"\n";
}
}
return 0;
}