Cod sursa(job #1798547)
Utilizator | Data | 5 noiembrie 2016 11:55:47 | |
---|---|---|---|
Problema | Hashuri | Scor | 60 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.53 kb |
#include <fstream>
using namespace std;
#include <set>
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<<endl;
else
fout<<1<<endl;
}
}
return 0;
}