Pagini recente » Monitorul de evaluare | Istoria paginii utilizator/swissrhino | Profil Daria09 | Cod sursa (job #133664) | 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;
}