Pagini recente » Cod sursa (job #2766475) | Cod sursa (job #1627463) | Cod sursa (job #1333687) | Cod sursa (job #1511454) | Cod sursa (job #2802614)
#include <bits/stdc++.h>
#define mod 999983;
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
set<int> rest[999984];
int main(){
int n,m,c,x,r,i;
in>>n;
for(i=1;i<=n;++i){
in>>c>>x;
r=x%mod;
if(c==1)
{
if(rest[r].find(x) == rest[r].end())
rest[r].insert(x);
}
else
if(c==2)
{
if(rest[r].find(x) != rest[r].end())
rest[r].erase(x);
}
else
{
if(rest[r].find(x) == rest[r].end())
out<<0<<'\n';
else
out<<1<<'\n';
}
}
}