Cod sursa(job #3268659)
Utilizator | Data | 16 ianuarie 2025 17:27:34 | |
---|---|---|---|
Problema | Hashuri | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.5 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("mset.in");
ofstream fout("mset.out");
set<int> m;
int n, x, c;
int main() {
fin >> n;
for (int i = 1; i <= n; i++) {
fin >> c >> x;
if (c == 1) {
m.insert(x);
} else if (c == 2) {
m.erase(x);
} else if (c == 3) {
if (m.count(x)) {
fout << 1<<endl;
} else {
fout << 0<<endl;
}
}
}
return 0;
}