Pagini recente » Cod sursa (job #2102023) | Cod sursa (job #3174543) | Cod sursa (job #1335543) | Cod sursa (job #1650444) | Cod sursa (job #2563540)
#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) {
if (h.find(x)==h.end())
h[x]=1;
} else if (test==2) {
h.erase(x);
} else {
if(h.find(x)!=h.end()) {
fout<<1;
} else
fout<<0;
fout<<"\n";
}
}
return 0;
}