Pagini recente » Cod sursa (job #2878631) | Cod sursa (job #2304253) | Autentificare | Cod sursa (job #2159390) | Cod sursa (job #1021263)
#include<iostream>
#include<fstream>
using namespace std;
#define MAX_N 1000001
bool hash[MAX_N];
int n;
int main(){
ifstream fin("hashuri.in");
ofstream fout ("hashuri.out");
fin >> n;
int cmd, x;
for(int i=1; i<=n; i++){
fin >> cmd >> x;
if(cmd == 1){
hash[x] = true;
}else if(cmd == 2){
hash[x] = false;
}else{
if(hash[x]) fout << 1 << '\n';
else fout << 0 << '\n';
}
}
return 0;
}