Pagini recente » Cod sursa (job #1465360) | Cod sursa (job #2951237) | PAGINA LUI VI$$U | Cod sursa (job #657348) | Cod sursa (job #1574430)
#include <iostream>
#include <fstream>
#include <unordered_set>
using namespace std;
int main(){
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n;
unordered_set<int> H;
f >> n;
for (int i = 0; i < n; ++i){
int x, y;
f >> x >> y;
if (x == 1)
H.insert(y);
if (x == 2)
H.erase(y);
if (x == 3)
if (H.find(y) != H.end())
g << 1 << "\n";
else
g << 0 << "\n";
}
f.close();
g.close();
return 0;
}