Pagini recente » Cod sursa (job #1812980) | Cod sursa (job #99396) | Cod sursa (job #1642943) | Cod sursa (job #137048) | Cod sursa (job #2108469)
#include<bits/stdc++.h>
using namespace std;
#define default_modulo 666013
ifstream f("hashuri.in");
ofstream g("hashuri.out");
map <int, int>dict[default_modulo + 2];
int q, x;
int main(){
int n;
f>>n;
int q,x;
while(n>0){
f>>q>>x;
if(q==1) dict[x%default_modulo][x]=1;
else if(q==2){
if(dict[x%default_modulo].count(x))
dict[x%default_modulo].erase(x);
}
else if(q==3){
if (dict[x%default_modulo].count(x))
g<<"1\n";
else
g<<"0\n";
}
--n;
}
}