Pagini recente » Cod sursa (job #167512) | Cod sursa (job #791186) | Cod sursa (job #2627820) | Cod sursa (job #1094877) | Cod sursa (job #1059821)
#include <fstream>
#include <map>
using namespace std;
map <int, int> combo;
int op,x,N;
int main()
{
ifstream in ("hashuri.in");
ofstream out("hashuri.out");
in>>N;
for (int i=1;i<= N; i++)
{
in>>op>>x;
if (op == 1 && combo.find(x)==combo.end() )
combo[x] = 1;
if (op == 2 && combo.find(x) !=combo.end() )
combo.erase(x);
if (op == 3)
out<< (combo.find(x) != combo.end() ) <<"\n" ;
}
in.close();
out.close();
return 0;
}