Cod sursa(job #610633)
Utilizator | Data | 28 august 2011 13:22:29 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.34 kb |
#include <cstdio>
#include <fstream>
#include <map>
using namespace std;
int n,m,x,t;
map<int,int> h;
int main ()
{
ifstream f ("hashuri.in");
freopen ("hashuri.out","w",stdout);
for(f>>n;n;--n){
f>>t>>x;
if(t==1&&h.find(x)==h.end())
h[x]=++m;
if(t==2)
h.erase(x);
if(t==3)
printf("%d\n",h.find(x)!=h.end());}
return 0;}