Cod sursa(job #1048186)
Utilizator | Data | 5 decembrie 2013 15:13:03 | |
---|---|---|---|
Problema | Hashuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.44 kb |
#include <unordered_set>
#include <fstream>
using namespace std;
int main()
{
ifstream IN("hashuri.in");
ofstream OUT("hashuri.out");
unordered_set<int> hash;
int n;IN >> n;
int t, x;
for (int i = 0 ; i < n; i++)
{
IN >> t >> x;
if (t == 1)
hash.insert(x);
else if (t == 2)
hash.erase(x);
else
if (hash.find(x) == unordered_set::end)
OUT << "0\n";
else
OUT << "1\n";
}
return 0;
}