Cod sursa(job #2590907)
| Utilizator | Data | 29 martie 2020 12:26:44 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.45 kb |
#include <cstdio>
#include <unordered_set>
using namespace std;
int main()
{
freopen("hashuri.in", "r", stdin);
freopen("hashuri.out", "w", stdout);
int N;
scanf("%d", &N);
unordered_set<int> S;
for (int i = 0; i < N; ++i) {
int op, x;
scanf("%d%d", &op, &x);
if (op == 1 && S.count(x) == 0) S.insert(x);
if (op == 2 && S.count(x) == 1) S.erase(x);
if (op == 3) printf("%d\n", (int)(S.find(x) != S.end()));
}
return 0;
}
