Pagini recente » Cod sursa (job #509121) | Cod sursa (job #3289350) | Cod sursa (job #3255683) | Cod sursa (job #284185) | Cod sursa (job #1813957)
#include <bits/stdc++.h>
using namespace std;
int MOD=666013;
int n,x,y;
bool found;
vector <int> h[666017];
int main(){
ifstream in("hashuri.in");
ofstream out("hashuri.out");
in >> n;
for(int i=1;i<=n;i++){
in >> x >> y;
if(x==1){
h[y%MOD].push_back(y);
}
if(x==2){
for(auto it=h[y%MOD].begin();it!=h[y%MOD].end();it++){
if(*it==y) h[y%MOD].erase(it);
if(it==h[y%MOD].end()) break;
}
}
if(x==3){
found=false;
for(auto it=h[y%MOD].begin();it!=h[y%MOD].end();it++){
if(*it==y) found=true;
}
out << found << '\n';
}
}
}