Pagini recente » Cod sursa (job #639162) | Cod sursa (job #223189) | Istoria paginii runda/huehuhue | Cod sursa (job #437106) | Cod sursa (job #1863372)
#include <fstream>
#include <set>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
const int mod = 666013;
set<int> hsh[mod];
int n, x,q,c;
int main() {
f >> n;
while (n--) {
f >> q >> x; c = x%mod;
if (q == 1 && hsh[c].find(x)==hsh[c].end()) {
hsh[x%mod].insert(x);
}
else if (q==2)
hsh[x%mod].erase(x);
else g<< (hsh[x%mod].find(x)!=hsh[x%mod].end()) <<'\n';
}
return 0;
}