Pagini recente » Cod sursa (job #1041014) | Cod sursa (job #1681384) | Cod sursa (job #262207) | Cod sursa (job #2815025) | Cod sursa (job #1342394)
// hashuri
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n;
unordered_map<int, bool> mp;
void read() {
f>>n;
for (int i=1;i<=n;i++) {
int type; f>>type;
int x; f>>x;
if (type == 1) {
mp[x] = 1;
} else if (type == 2) {
mp.erase(x);
} else if (type == 3) {
g<<(mp.find(x) != mp.end())<<'\n';
}
}
}
int main() {
read();
f.close(); g.close();
return 0;
}