Pagini recente » Cod sursa (job #1068427) | Cod sursa (job #2964766) | Cod sursa (job #1039805) | Cod sursa (job #2261354) | Cod sursa (job #2027778)
#include <bits/stdc++.h>
using namespace std;
int modulo = 666013;
map <int, int> cheie[666014];
int main(int argc, char const *argv[])
{
ifstream fin ("cheieuri.in");
ofstream fout ("cheieuri.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;
}