Cod sursa(job #2745362)
| Utilizator | Data | 26 aprilie 2021 13:52:45 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.42 kb |
#include <bits/stdc++.h>
#include <ext/hash_set>
using namespace std;
using namespace __gnu_cxx;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
int x;
hash_set <int> H;
int main()
{
for(in >> x; x > 0; x--)
{
int i, nr;
in >> i >> nr;
if(i == 1) H.insert(nr);
if(i == 2) H.erase(nr);
if(i == 3) out << (H.find(nr) != H.end()) << "\n";
}
in.close();
out.close();
return 0;
}
