Cod sursa(job #1051631)
Utilizator | Data | 10 decembrie 2013 12:45:48 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.47 kb |
#include<fstream>
#include<unordered_map>
using namespace std;
ifstream f ("hashuri.in");
ofstream g("hashuri.out");
unordered_map <int,int> map;
int n,i,x,t;
int main ()
{
f >> n;
for (i = 1; i <= n; i++)
{
f >> t >> x;
if (t == 1 && map.find(x) == map.end())
map[x] = 1;
if (t == 2 && map.find(x) != map.end())
map.erase (x);
if (t == 3)
g << (map.find(x) != map.end()) << "\n";
}
f.close();
g.close();
return 0;
}