Pagini recente » Cod sursa (job #3263683) | Cod sursa (job #1655640) | Cod sursa (job #1344035) | Cod sursa (job #2618536) | Cod sursa (job #2802619)
#include <bits/stdc++.h>
#define mod 40013;
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
unordered_set<int> rest[40013];
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';
}
}
}