Pagini recente » Cod sursa (job #2406870) | Cod sursa (job #716091) | Cod sursa (job #2216408) | Profil Duwumi | Cod sursa (job #1795795)
#include <bits/stdc++.h>
using namespace std;
#define BUF_SIZE 1<<17
char buf[BUF_SIZE];
int pos = BUF_SIZE;
FILE *fin, *fout;
inline char nextch(){
if(pos==BUF_SIZE) fread(buf, BUF_SIZE, 1, fin), pos=0;
return buf[pos++];
}
inline int read(){
int x=0;
char ch=nextch();
while(!isdigit(ch)) ch=nextch();
while(isdigit(ch)){
x=10*x+ch-'0';
ch=nextch();
}
return x;
}
unordered_map<int,int>hash1;
void desch() {
fin = fopen("hashuri.in", "r");
fout = fopen("hashuri.out", "w");
}
void inch() {
fclose(fin);
fclose(fout);
}
int main() {
desch();
int n;
n = read();
int i;
for(i = 0;i < n;i++) {
int op, x;
op = read();
x = read();
if(op == 1) {
hash1[x] = 1;
}
if(op == 2) {
hash1[x] = 0;
}
if(op == 3) {
fprintf(fout, "%d\n", hash1[x]);
}
}
inch();
return 0;
}