Cod sursa(job #1322685)
| Utilizator | Data | 20 ianuarie 2015 11:51:45 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.55 kb |
#include <fstream>
#include <unordered_set>
using namespace std;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
unordered_set <int> myHash;
int n, x, op;
int main()
{
for (int i=1; i<=n; i++)
{
fin >> op >> x;
if (op==1)
myHash.insert(x);
else if (op==2)
myHash.erase(x);
else
if (myHash.find(x)==myHash.end())
fout >> 0;
else fout >> 1;
}
fin.close();
fout.close();
return 0;
}
