Cod sursa(job #2230990)
Utilizator | Data | 12 august 2018 16:25:04 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.47 kb |
#include <iostream>
#include <fstream>
#include <set>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n, op, x;
set <int> v;
int main()
{
for (f>>n; n; --n)
{
f>>op>>x;
if (op==1)
{
v.insert(x);
continue;
}
if (op==2)
{
v.erase(x);
continue;
}
g<<(v.find(x)!=v.end())<<"\n";
}
return 0;
}