Pagini recente » Cod sursa (job #2251474) | Borderou de evaluare (job #2040282) | Cod sursa (job #2333610) | Cod sursa (job #3272329) | Cod sursa (job #3268659)
#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;
}