Pagini recente » Cod sursa (job #1027844) | Cod sursa (job #1224718) | Cod sursa (job #2629969) | Cod sursa (job #2784558) | Cod sursa (job #2738979)
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main() {
int n, x, op;
map<int, int> m;
fin >> n;
for(int i=0; i<n; ++i)
{
fin >> op >> x;
if (op == 1)
{
//if(m.count(x) == 0)
m[x] = 1;
}
else if (op == 2)
{
//if(m.count(x) != 0)
m[x] = 0;
}
else
{
fout << m[x] << "\n";
}
}
return 0;
}