Pagini recente » Istoria paginii utilizator/magistraladoi | Cod sursa (job #1091353) | Profil antracods | Rating Tudor Moldovan (kraykot) | Cod sursa (job #2990943)
#include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
string s;
string s2;
vector<int> pi(100000);
set<int> mp;
int main() {
ios_base::sync_with_stdio(false);
fin.tie(NULL);
int n;
fin >> n;
int nr = 0;
for (int i = 1; i <= n; i++) {
int cer;
fin >> cer;
if (cer == 1) {
int x;
fin >> x;
mp.insert(x);
//nr++;
}
if (cer == 2) {
int x;
fin >> x;
mp.erase(x);
}
if (cer == 3) {
int x;
fin >> x;
if (mp.find(x) != mp.end()) {
fout << 1<<'\n';
}
else {
fout << 0 << '\n';
}
}
}
fin.close();
fout.close();
}