Cod sursa(job #2563539)
Utilizator | Data | 1 martie 2020 12:22:13 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.52 kb |
#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) {
h.erase(x);
} else {
if(h.find(x)!=h.end()) {
fout<<1;
} else
fout<<0;
fout<<"\n";
}
}
return 0;
}