Pagini recente » Cod sursa (job #2971853) | Cod sursa (job #1958084) | Cod sursa (job #454579) | Cod sursa (job #2124166) | Cod sursa (job #2487625)
#include <bits/stdc++.h>
#define dim 100005
#define modulo 60001
using namespace std;
string numeproblema="hashuri";
ifstream fin(numeproblema+".in");
ofstream fout(numeproblema+".out");
int n,i,tip,x,rest;
set <int> s[modulo];
int main()
{
fin>>n;
for(i=1; i<=n; i++)
{
fin>>tip>>x;
rest=x%modulo;
if(tip==1)
{
s[rest].insert(x);
}
else if(tip==2)
{
auto it=s[rest].find(x);
if(it!=s[rest].end()){
s[rest].erase(it);
}
}
else
{
auto it=s[rest].find(x);
if(it==s[rest].end()){
fout<<"0\n";
}else{
fout<<"1\n";
}
}
}
}