Pagini recente » Cod sursa (job #2187436) | Cod sursa (job #858995) | Cod sursa (job #2230857) | Cod sursa (job #702839) | Cod sursa (job #403524)
Cod sursa(job #403524)
#include <cstdio>
#include <tr1/unordered_set>
#define dim 8192
char ax[dim];
int pz;
inline void cit (int &x)
{
x = 0;
while (ax[pz] < '0' || ax[pz] > '9')
if (++pz == dim)
fread (ax, 1, dim, stdin),pz = 0;
while (ax[pz] >= '0' && ax[pz] <= '9')
{
x = x * 10 + ax[pz] - '0';
if (++pz == dim)
fread (ax,1, dim, stdin),pz = 0;
}
}
using namespace std;
int main()
{
tr1::unordered_set<int> H;
int n, p, q;
freopen ("hashuri.in", "r", stdin);
freopen ("hashuri.out", "w", stdout);
cit (n);
while (n--)
{
cit (p); cit (q);
if (p == 1)
H.insert (q);
if (p == 2)
H.erase (q);
if (p == 3)
printf ("%d\n", H.find(q) == H.end() ? 0 : 1);
}
return 0;
}