Pagini recente » Cod sursa (job #1335818) | Cod sursa (job #1385938) | Cod sursa (job #1507130) | Cod sursa (job #2169641) | Cod sursa (job #2222045)
#include <fstream>
#include <set>
using namespace std;
const int mod = 666013;
set<int> sir[666666];
int n, x, cer;
bool cnt;
int main()
{
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
fin >> n;
for (int i = 1; i <= n; ++i)
{
fin >> cer >> x;
if (cer == 1)
sir[x % mod].insert(x);
else if (cer == 2)
{
for (auto y: sir[x % mod])
if (x == y)
{
sir[x % mod].erase(y);
break;
}
}
else
{
cnt = 0;
for (auto y: sir[x % mod])
if (x == y)
{
cnt = 1;
break;
}
fout << cnt << '\n';
}
}
fin.close();
fout.close();
return 0;
}