Pagini recente » Cod sursa (job #2538186) | Cod sursa (job #2504916) | Cod sursa (job #1598996) | Diferente pentru problema/blas intre reviziile 12 si 15 | Cod sursa (job #1795792)
#include <bits/stdc++.h>
using namespace std;
unordered_map<int,int>hash1;
FILE *fin, *fout;
void desch() {
fin = fopen("hashuri.in", "r");
fout = fopen("hashuri.out", "w");
}
void inch() {
fclose(fin);
fclose(fout);
}
int main() {
desch();
int n;
fscanf(fin, "%d", &n);
int i;
for(i = 0;i < n;i++) {
int op, x;
fscanf(fin, "%d%d", &op, &x);
if(op == 1) {
hash1[x] = 1;
}
if(op == 2) {
hash1[x] = 0;
}
if(op == 3) {
fprintf(fout, "%d\n", hash1[x]);
}
}
inch();
return 0;
}