Pagini recente » Cod sursa (job #369491) | Cod sursa (job #933292) | Cod sursa (job #3276560) | Cod sursa (job #668286) | Cod sursa (job #2802618)
#include <bits/stdc++.h>
#define mod 2048;
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
unordered_set<int> rest[2048];
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';
}
}
}