Pagini recente » Cod sursa (job #2395233) | Cod sursa (job #959589) | Cod sursa (job #2161449) | Cod sursa (job #278413) | Cod sursa (job #2200503)
#include <bits/stdc++.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
typedef __gnu_pbds::cc_hash_table<int, __gnu_pbds::null_type> UnorderedSet;
int in;
struct _io{
char*s;
_io():s((char*)mmap(0,1<<28,PROT_READ,MAP_PRIVATE,fileno(stdin),0)){}
operator int(){
int x=0;
while(*s<48)s++;
while(*s>32)x=x*10+*s++-48;
return x;
}
}it;
int main() {
#ifdef INFOARENA
in = open("hashuri.in", O_RDONLY);
freopen("hashuri.out", "w", stdout);
#else
in = open("input.txt", O_RDONLY);
#endif
UnorderedSet s;
int num_queries = it;
while (num_queries--) {
int query_type = it, el = it;
if (query_type == 1) {
s.insert(el);
} else if (query_type == 2) {
s.erase(el);
} else {
putchar((s.find(el) != s.end()) + '0');
putchar('\n');
}
}
return 0;
}