Pagini recente » Cod sursa (job #3256136) | Cod sursa (job #1012) | Cod sursa (job #3244633) | Cod sursa (job #2830603) | Cod sursa (job #1058240)
#include <fstream>
#include <map>
std::ifstream fin ("hashuri.in");
std::ofstream fout ("hashuri.out");
int n, ind;
std::map <int, int> H;
int main(){
fin >> n;
int op, val;
for(int i = 0; i < n; i++){
fin >> op >> val;
if(op == 1){
if(H.find(val) == H.end()) H[val] = i;
}
if(op == 2){
H.erase(val);
}
if(op == 3){
fout << (H.find(val) != H.end()) << "\n";
}
}
return 0;
}