Cod sursa(job #1901519)
| Utilizator | Data | 4 martie 2017 00:24:18 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.47 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int N;
unordered_set <int> hashed;
int main() {
fin >> N;
while (N--) {
int type, number;
fin >> type >> number;
if (type == 1) hashed.insert(number);
if (type == 2) hashed.erase(number);
if (type == 3) fout << (hashed.count(number)) << '\n';
}
fin.close();
fout.close();
return 0;
}
