Cod sursa(job #1273484)
Utilizator | Data | 22 noiembrie 2014 15:28:39 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.36 kb |
#include <fstream>
#include <unordered_set>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int N;
unordered_set<int> hs;
int main() {
fin >> N;
while (N--) {
int op, x;
fin >> op >> x;
if (op == 1)
hs.insert(x);
else if (op == 2)
hs.erase(x);
else
fout << hs.count(x) << "\n";
}
return 0;
}