Cod sursa(job #1198156)
| Utilizator | Data | 14 iunie 2014 19:06:30 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.43 kb |
#include<fstream>
#include<algorithm>
#include<map>
using namespace std;
int n,tip,x,nr;
map <int,int> a;
int main()
{
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
cin>>n;
while(n--)
{
cin>>tip>>x;
if(tip==1 && a.find(x)==a.end()) a[x]=++nr;
if(tip==2) a.erase(x);
if(tip==3) if(a.find(x)!=a.end()) cout<<"1"<<'\n'; else cout<<"0"<<'\n';
}
return 0;
}
