Cod sursa(job #2685344)
| Utilizator | Data | 16 decembrie 2020 17:55:27 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.58 kb |
#include <bits/stdc++.h>
#pragma GCC optimize ("03")
#define FILES freopen("hashuri.in" , "r" , stdin) , freopen("hashuri.out" , "w" , stdout)
#define FastIO ios_base::sync_with_stdio(false) , cin.tie(0) , cout.tie(0)
using namespace std;
int op , x , n;
unordered_set < int > s;
signed main()
{
FILES , FastIO;
cin >> n;
for(int i = 1 ; i <= n ; i++)
{
cin >> op >> x;
if(op == 1)
s.insert(x);
else if(op == 2)
s.erase(x);
else cout << s.count(x) << '\n';
}
return 0;
}
