Pagini recente » Cod sursa (job #2901826) | Cod sursa (job #298424) | Cod sursa (job #1995987) | Cod sursa (job #1759136) | Cod sursa (job #2364163)
#include <bits/stdc++.h>
using namespace std;
set <int> A;
set <int> :: iterator it;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n;
void solve(int c, int val)
{
if (c == 1)
A.insert(val);
if (c == 2)
A.erase(val);
if (c == 3) {
if (A.find(val) != A.end())
g << "1\n";
else
g << "0\n";
}
}
void read()
{
f >> n;
int c, val;
for (int i = 1; i <= n; ++i) {
f >> c >> val;
solve(c, val);
}
}
int main()
{
read();
return 0;
}