Cod sursa(job #2726378)
Utilizator | Data | 20 martie 2021 20:13:29 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.42 kb |
#include <unordered_set>
#include <fstream>
using namespace std;
int main() {
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n, op, x;
unordered_set<int> s;
fin >> n;
while(n--) {
fin >> op >> x;
if(op == 1)
s.insert(x);
else if(op == 2)
s.erase(x);
else
fout << (s.find(x) != s.end()) << '\n';
}
}