Cod sursa(job #1412821)
| Utilizator | Data | 1 aprilie 2015 16:16:16 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.49 kb |
#include <fstream>
#include <unordered_set>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_set <int> h;
int main( ) {
int n;
fin >> n;
for ( int i = 1; i <= n; ++ i ) {
int x, y;
fin >> x >> y;
if ( x == 1 ) {
h.insert(y);
} else if ( x== 2 ) {
h.erase(y);
} else {
fout << (h.find(y)!=h.end()) << "\n";
}
}
return 0;
}
