Pagini recente » Cod sursa (job #124263) | Cod sursa (job #406150) | Cod sursa (job #940049) | Cod sursa (job #2107572) | Cod sursa (job #2563536)
#include <fstream>
#include <map>
using namespace std;
int n, test, x, i;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
map <int,int> h;
int main () {
fin>>n;
for (i=1;i<=n;i++) {
fin>>test>>x;
if (test==1) {
h[x]=1;
} else if (test==2) {
if(h.find(x)!=h.end())
h.erase(x);
} else {
if(h.find(x)!=h.end()) {
fout<<1;
} else
fout<<0;
fout<<"\n";
}
}
return 0;
}