Cod sursa(job #2173928)
Utilizator | Data | 16 martie 2018 09:43:38 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.55 kb |
#include <fstream>
#include <unordered_set>
using namespace std;
unordered_set < int > s;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n,i,y,x;
int main()
{
fin>>n;
for(i=0;i<n;i++)
{
fin>>x>>y;
if(x==1)
s.insert(y);
else
{
if(x==2)
s.erase(y);
else
if(s.find(y)==s.end())
fout<<0<<'\n';
else
fout<<1<<'\n';
}
}
return 0;
}