Cod sursa(job #1191518)
Utilizator | Data | 27 mai 2014 21:58:57 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.36 kb |
#include <fstream>
#include <tr1/unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
tr1::unordered_map<int,int>lista;
int main()
{int t,op;
long val;
f>>t;
while (t)
{f>>op>>val;
if (op==1)
lista[val]=1;
if (op==2)
lista.erase(val);
if (op==3)
g<<lista[val]<<'\n';
t--;
}
return 0;
}