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