Pagini recente » Cod sursa (job #2158195) | Cod sursa (job #1217881) | Cod sursa (job #812999) | Cod sursa (job #1453057) | Cod sursa (job #2734784)
#include <bits/stdc++.h>
#define mod 700001
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
vector<int> h[mod];
int n;
int main()
{
int i, j, op, x, da;
fin >> n;
for(i = 1; i <= n; i++)
{
fin >> op;
fin >> x;
if(op == 1)
h[x % mod].push_back(x);
if (op == 2)
{
for(j = 0; j < h[x % mod].size(); j++)
if(x == h[x][j])
{
h[x % mod].erase(h[x % mod].begin() + j);
break;
}
}
if(op == 3)
{
da = 0;
for(j = 0; j < h[x % mod].size(); j++)
if(x == h[x][j])
{
da = 1;
break;
}
if(da == 1)
fout << "1\n";
else
fout << "0\n";
}
}
return 0;
}