Pagini recente » Cod sursa (job #183505) | Cod sursa (job #3288875) | Cod sursa (job #1625655) | Cod sursa (job #1862205) | Cod sursa (job #2793200)
/* [A][M][C][B][N] / [K][R][I][P][6][8] */
#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
typedef long long ll;
const char sp = ' ', nl = '\n';
const int MOD = 9973;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_map<int, int> hashMap;
vector<bool> f;
void createMap() {
ifstream gin("hashuri.in");
int n, x, y, sz = 0;
gin >> n;
while (n--) {
gin >> x >> y;
if (hashMap.find(y) == hashMap.end())
hashMap[y] = sz++;
}
f.resize(sz);
gin.close();
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
createMap();
int n;
fin >> n;
while (n--) {
int p, x;
fin >> p >> x;
if (p == 1) f[hashMap[x]] = 1;
if (p == 2) f[hashMap[x]] = 0;
if (p == 3) fout << f[hashMap[x]] << nl;
}
}