Pagini recente » Cod sursa (job #2885431) | Cod sursa (job #3129601) | Cod sursa (job #3039173) | Cod sursa (job #406307) | Cod sursa (job #2027779)
#include <bits/stdc++.h>
using namespace std;
int modulo = 666013;
map <int, int> cheie[666014];
int main(int argc, char const *argv[])
{
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
int n;
fin >> n;
for (int i = 1; i<=n; ++i)
{
int type, x;
fin >> type >> x;
int y = x%modulo;
if (type == 1)
{
cheie[y][x]++;
}
if (type == 2)
{
if (cheie[y].count(x) == 0) continue;
cheie[y].erase(x);
}
if (type == 3)
{
if (cheie[y].count(x) == 0)
fout << 0 << '\n';
else fout << 1 << '\n';
}
}
return 0;
}