Pagini recente » Cod sursa (job #2246683) | Diferente pentru utilizator/andycatruna intre reviziile 5 si 3 | Cod sursa (job #1450410) | Cod sursa (job #2788536) | 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;
}