Pagini recente » Cod sursa (job #2180519) | Cod sursa (job #1491611) | Cod sursa (job #1612581) | Cod sursa (job #346016) | 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;
}