Pagini recente » Cod sursa (job #2485556) | Cod sursa (job #1374176) | Cod sursa (job #35525) | Istoria paginii runda/alexei_lr1 | Cod sursa (job #2173591)
#include <bits/stdc++.h>
#define BUFSIZE 262144
using namespace std;
FILE *F=fopen("hashuri.in", "r"), *G=fopen("hashuri.out", "w");
int n, q, x, ok;
unordered_map<int, int>m;
char buf[262155];
int pos=BUFSIZE;
inline char nxt(){
if(pos==BUFSIZE){
fread(buf, BUFSIZE, 1, F);
pos=0;
}
else pos++;
return buf[pos];
}
inline int read(){
int nr=0;
char ch=nxt();
while(!isdigit(ch)) ch=nxt();
while(isdigit(ch)) nr=nr*10+ch-'0', ch=nxt();
return nr;
}
int main()
{
n=read();
while(n--){
q=read();
x=read();
if(q==1){
m[x]=1;
}
else{
if(q==2){
if(m[x]) m[x]=0;
}
else fprintf(G, "%d\n", m[x]);
}
}
return 0;
}