Cod sursa(job #2765061)
Utilizator | Data | 24 iulie 2021 17:24:30 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.43 kb |
#include <fstream>
#include <iostream>
#include <map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int x, n, op;
map<int, int> M;
int main() {
fin >> n;
for (; n != 0; n--) {
fin >> op >> x;
if (op == 1)
M[x] = 1;
else if (op == 2)
M.erase(x);
else if (op == 3)
fout << (M.find(x) != M.end()) << '\n';
}
return 0;
}