Cod sursa(job #1650313)
Utilizator | Data | 11 martie 2016 17:38:43 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.39 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
int n,nr,a,b;
map <int, int> M;
int main()
{
in>>n;
while(n--)
{
in>>a>>b;
if(a==1&&M.find(b)==M.end())M[b]=++nr;
if(a==2)M.erase(b);
if(a==3)if(M.find(b)==M.end())out<<0<<'\n';
else out<<1<<'\n';
}
return 0;
}