Cod sursa(job #2683693)
Utilizator | Data | 11 decembrie 2020 23:10:00 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.44 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
unordered_set < int > s;
int n;
int op,x;
int main()
{
f >> n;
for (int i=1;i<=n;i++) {
f >> op >> x;
if (op==1) {
s.insert(x);
}
else if (op==2) {
s.erase(x);
}
else {
g << s.count(x) << '\n';
}
}
return 0;
}