Cod sursa(job #2001951)
Utilizator | Data | 18 iulie 2017 10:53:09 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.39 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
set<int> s;
int n,c,x;
int main()
{
f>>n;
for(;n;n--)
{
f>>c>>x;
if(c==1)
s.insert(x);
else
if(c==2)
s.erase(x);
else
s.find(x)==s.end()?g<<"0\n":g<<"1\n";
}
return 0;
}