Cod sursa(job #1258617)
| Utilizator | Data | 9 noiembrie 2014 01:39:35 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.44 kb |
# include <iostream>
# include <unordered_map>
# include <fstream>
using namespace std;
int main()
{
unordered_map <int,int> myHash;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int t, op, val;
f>>t;
while (t)
{
f>>op;
f>>val;
t--;
if (op == 1)
myHash[val] = val;
else if (op == 2)
myHash.erase(val);
else
if (myHash.find(val) != myHash.end())
g<<1<<"\n";
else
g<<0<<"\n";
}
g.close();
return 0;
}