Pagini recente » Cod sursa (job #2215227) | Cod sursa (job #1171224) | Cod sursa (job #1164045) | Cod sursa (job #817813) | Cod sursa (job #1502148)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_map < int, int > Map;
int main(){
int n, type, x;
fin >> n;
unordered_map < int, int > ::const_iterator res;
for(int i = 1; i <= n; i++){
fin >> type >> x;
if(type == 1){
Map.insert(make_pair(x, 0));
}
if(type == 2){
res = Map.find(x);
if(res != Map.end()) Map.erase(Map.find(x));
}
if(type == 3){
res = Map.find(x);
if(res == Map.end()){
fout << 0 << "\n";
} else {
fout << 1 << "\n";
}
}
}
return 0;
}