Cod sursa(job #2087035)
Utilizator | Mihnea Andreescu FunnyStocky | Data | 12 decembrie 2017 20:17:07 |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.55 kb |
#include <fstream>
#include <set>
using namespace std;
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
set<int>s;
int n;
int a,x;
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a>>x;
if(a==1)
s.insert(x);
if(a==2)
s.erase(x);
if(a==3)
{
set<int>::iterator it;
it=s.find(x);
if(it==s.end())
cout<<"0\n";
else
cout<<"1\n";
}
}
return 0;
}
/**
**/