Pagini recente » Cod sursa (job #236683) | Cod sursa (job #1822671) | Cod sursa (job #2162777) | Cod sursa (job #1902947) | Cod sursa (job #1697351)
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <map>
using namespace std;
int main() {
ifstream in("hashuri.in");
ofstream out("hashuri.out");
map<int, int> hashMap;
int comanda,x;
in>>comanda;
while(in>>comanda>>x){
if(comanda==1)
hashMap[x]=1;
if(comanda==2)
hashMap.erase(x);
if(comanda==3)
out << (hashMap.find(x) != hashMap.end()) << '\n';
}
return 0;
}