Pagini recente » Cod sursa (job #305690) | Cod sursa (job #2509951) | Cod sursa (job #3242250) | simulare-oji-23-02-2024-clasaxi | Cod sursa (job #1863373)
#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[c].insert(x);
else if (q==2)
hsh[c].erase(x);
else g<< (hsh[c].find(x)!=hsh[c].end()) <<'\n';
}
return 0;
}