Pagini recente » Cod sursa (job #2764402) | Cod sursa (job #1580396) | Cod sursa (job #1343438) | Cod sursa (job #548021) | Cod sursa (job #965820)
Cod sursa(job #965820)
#include <cstdio>
#include <map>
using namespace std;
int N, tip, x;
map <int, int> M;
int main() {
freopen("hashuri.in", "r", stdin);
freopen("hashuri.out", "w", stdout);
for (scanf("%d", &N); N; --N) {
scanf("%d %d ", &tip, &x);
if (tip == 1 && M.find(x) == M.end()) {
M[x] = N;
continue;
}
if (tip == 2) {
M.erase(x);
continue;
}
printf("%d\n", M.find(x) != M.end());
}
return 0;
}