Pagini recente » Cod sursa (job #1235653) | Cod sursa (job #494972) | Cod sursa (job #889935) | Cod sursa (job #2551852) | Cod sursa (job #2536039)
#include <iostream>
#include <fstream>
#include <set>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int main()
{
int N;
set <int> multime;
f >> N;
while(N--) {
int nrOperatie, x;
f >> nrOperatie >> x;
if(nrOperatie == 1 && multime.find(x) == multime.end()) {
multime.insert(x);
} else if (nrOperatie == 2 && multime.find(x) != multime.end()) {
multime.erase(x);
} else if (nrOperatie == 3) {
if(multime.find(x) != multime.end())
g << 1 << endl;
else g << 0 << endl;
}
}
return 0;
}