Cod sursa(job #2594247)
| Utilizator | Data | 5 aprilie 2020 16:53:38 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.63 kb |
#include <iostream>
#include <fstream>
#include <set>
using namespace std;
set<long long> v;
int main()
{
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
int m;
cin>>m;
for(int i=1; i<=m; i++)
{
int x;
long long y;
cin>>x>>y;
if(x==1)
v.insert(y);
else if(x==2)
{
if(v.find(y)!=v.end())
v.erase(y);
}
else if(x==3)
{
if(v.find(y)!=v.end())
cout<<1<<"\n";
else
cout<<0<<"\n";
}
}
return 0;
}
