Cod sursa(job #2946061)
| Utilizator | Data | 24 noiembrie 2022 15:26:19 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.38 kb |
// https://www.infoarena.ro/problema/hashuri
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main() {
int n;
fin>>n;
unordered_set<int> s{};
for (int i=0; i<n; ++i) {
int c, x;
fin>>c>>x;
if (c==1) s.insert(x);
else if (c==2) s.erase(x);
else fout<<(s.find(x)!=s.end())<<endl;
}
}