Pagini recente » simulare_nu_shimulare | Clasament emag10_sim1 | Cod sursa (job #1175562) | Cod sursa (job #1138571) | Cod sursa (job #2214546)
#include <fstream>
#include <map>
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
const int MOD = 666013;
const int MAXN = 1e6;
map <int, int>dict[MOD + 2];
int n;
int main() {
in >> n;
while (n --) {
int q, nr;
in >> q >> nr;
if (q == 1) {
dict[nr % MOD][nr] = 1;
}
if (q == 2) {
if (dict[nr % MOD].count(nr))
dict[nr % MOD].erase(nr);
}
if (q == 3) {
if (dict[nr % MOD].count(nr))
out << 1 << '\n';
else
out << 0 << '\n';
}
}
return 0;
}