Cod sursa(job #1419135)
Utilizator | Data | 14 aprilie 2015 19:16:20 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.45 kb |
#include <cstdio>
#include <unordered_map>
using namespace std;
unordered_map<int,int> has;
int n,x,a;
int main()
{
freopen("hashuri.in","r", stdin);
freopen("hashuri.out","w", stdout);
scanf("%d", &n);
for(int i = 0; i < n; ++i)
{
scanf("%d %d ", &a,&x);
if(a==1)
has[x]=1;
if(a==2)
has[x]=0;
if(a==3)
printf("%d\n", has[x]);
}
return 0;
}