Cod sursa(job #3132016)
| Utilizator | Data | 21 mai 2023 22:43:18 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.65 kb |
#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;
}
