Pagini recente » Cod sursa (job #1503357) | Cod sursa (job #2098595) | Cod sursa (job #421148) | Cod sursa (job #2086041) | Cod sursa (job #2899070)
#include <fstream>
#include <set>
std::ifstream fin("hashuri.in");
std::ofstream fout("hashuri.out");
const int MOD = 100000;
std::set <int> h;
int main() {
int n, x;
char op;
fin >> n;
while (n) {
-- n;
fin >> op >> x;
switch (op) {
case '1': {
h.insert(x);
break;
}
case '2': {
h.erase(x);
break;
}
case '3': {
if (h.find(x) != h.end())
fout << 1 << '\n';
else
fout << 0 << '\n';
}
}
}
return 0;
}