Pagini recente » Cod sursa (job #825932) | Cod sursa (job #1939038) | Cod sursa (job #1803418) | Cod sursa (job #1637477) | Cod sursa (job #1863376)
#include <fstream>
#include <set>
#define mod 666013
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
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[c].insert(x);
else if (q==2)
hsh[c].erase(x);
else if (q==3)
g<< (hsh[c].find(x)!=hsh[c].end()) <<'\n';
}
return 0;
}