Cod sursa(job #2262664)
Utilizator | Data | 17 octombrie 2018 18:05:37 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.34 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
unordered_set<int> M;
int q,o,x;
int main()
{
f>>q;
for(;q;q--)
{
f>>o>>x;
if(o==1)M.insert(x);
else if(o==2)M.erase(x);
else {M.find(x)==M.end()?g<<"0\n":g<<"1\n";}
}
return 0;
}