Cod sursa(job #2702852)
Utilizator | Data | 6 februarie 2021 08:42:26 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.56 kb |
#include <fstream>
#include <cstdio>
#include<unordered_map>
using namespace std;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
unordered_map<int,int>m;
int n,db=0;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
int x,y;
scanf("%d %d",&x,&y);
if(x==1 && m.find(y)==m.end()){
m[y]=db++;
}
if(x==2)m.erase(y);
if(x==3)
{
bool c=m.find(y)!=m.end();
printf("%d\n",c);
}
}
return 0;
}