Cod sursa(job #1828931)
Utilizator | Data | 14 decembrie 2016 08:35:12 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.42 kb |
#include <bits/stdc++.h>
using namespace std;
unordered_map<int,bool> M;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n,x,y;
int main()
{
fin>>n;
for(int i=1;i<=n;i+=1)
{
fin>>x>>y;
if(x==1) M[y]=true;
else if(x==2) M[y]=false;
else
{
if(M[y]) fout<<1<<'\n';
else fout<<0<<'\n';
}
}
return 0;
}