Cod sursa(job #1828941)
Utilizator | Data | 14 decembrie 2016 08:46:34 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.43 kb |
#include <bits/stdc++.h>
using namespace std;
unordered_set<int> 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.insert(y);
else if(x==2) M.erase(y);
else
{
if(M.find(y)!=M.end()) fout<<1<<'\n';
else fout<<0<<'\n';
}
}
return 0;
}