Pagini recente » Cod sursa (job #2208000) | Cod sursa (job #580393) | Cod sursa (job #3248180) | Cod sursa (job #1077011) | Cod sursa (job #3268660)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.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;
}