Cod sursa(job #1040885)
Utilizator | Data | 25 noiembrie 2013 02:16:50 | |
---|---|---|---|
Problema | Hashuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.41 kb |
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
unordered_map<int, bool> h;
int t, x, n, i;
int main()
{
cin>>n;
for(i=1; i<=n; i++)
{
cin>>t>>x;
if(t==1 && h.find(x)==h.end()) h[x]=1;
else
if(t==2 && h[x]==1) h.erase(x);
else cout<<h[x]<<'\n';
}
return 0;
}