Pagini recente » Cod sursa (job #1579757) | Cod sursa (job #1919841) | Cod sursa (job #832035) | Cod sursa (job #1051149) | Cod sursa (job #2548642)
#include<fstream>
#include<iostream>
#include<unordered_map>
#include<cctype>
#define BUF_SIZE 1 << 18
using namespace std;
unordered_map<int, int> umap;
int pos = BUF_SIZE;
char buf[BUF_SIZE];
/*inline char getChar(FILE *fin) {
if(pos == BUF_SIZE) {
fread(buf, 1, BUF_SIZE, fin);
pos = 0;
}
return buf[pos++];
}
inline int read(FILE* fin) {
int res = 0;
char ch;
do {
ch = getChar(fin);
}while(!isdigit(ch));
do {
res = 10*res + ch - '0';
ch = getChar(fin);
}while(isdigit(ch));
return res;
}*/
int main() {
int n, op, x;
FILE* fin, *fout;
fin = fopen("hashuri.in", "r");
fout = fopen("hashuri.out", "w");
//n = read(fin);
fscanf(fin,"%d",&n);
for(int i = 1; i <= n; i++) {
/*op = read(fin);
x = read(fin);*/
fscanf(fin,"%d%d",&op,&x);
if(op == 1)
umap[x] = 1;
else if(op == 2) {
umap[x] = 0;
} else {
if(umap[x])
fprintf(fout,"1\n");
else fprintf(fout,"0\n");
}
}
fclose(fin);
fclose(fout);
return 0;
}