Pagini recente » Cod sursa (job #3256331) | Cod sursa (job #2016901) | Borderou de evaluare (job #2755603) | Borderou de evaluare (job #2224139) | Cod sursa (job #3132016)
#include <iostream>
#include <fstream>
#include <vector>
#include <unordered_set>
using namespace std;
int main() {
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n, x, y;
vector<unordered_set<int>> valori(666041);
fin >> n;
while (n--) {
fin >> x >> y;
int aux = y % 666041;
if (x == 1) {
valori[aux].insert(y);
} else if (x == 2) {
valori[aux].erase(y);
} else if (x == 3) {
bool rez = (valori[aux].count(y) != 0);
fout << rez << '\n';
}
}
fin.close();
fout.close();
return 0;
}