Pagini recente » Statistici Cozma Laura (cozmalaura23) | Cod sursa (job #1459681) | Cod sursa (job #883726) | Cod sursa (job #2543897) | Cod sursa (job #2894642)
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
vector<int> h;
int main()
{
int n;
f>>n;
for(int i=1;i<=n;i++)
{
int o,x;
f>>o>>x;
if(o==1) h.push_back(x);
else if(o==2 && find(h.begin(), h.end(), x) != h.end()) h.erase(find(h.begin(), h.end(), x));
else if(o==3)find(h.begin(), h.end(), x) == h.end()?g<<"0\n":g<<"1\n";
}
}