Pagini recente » Cod sursa (job #1032533) | Cod sursa (job #78245) | Cod sursa (job #1166777) | Cod sursa (job #1045054) | Cod sursa (job #1059436)
#include <fstream>
#include <unordered_map>
using namespace std;
unordered_map <int, int> combo; // because chaos
int op,x,N,i;
int main()
{
ifstream in ("hashuri.in");
ofstream out("hashuri.out");
in>>N;
for (; i <= N; i++)
{
in>>op>>x;
if (op == 1 && combo.find(x)==combo.end() )
combo[x] = op;
if (op == 2 && combo.find(x) !=combo.end() )
combo.erase(x);
if (op == 3)
out<< (combo.find(x) != combo.end() ) <<endl ;
}
in.close();
out.close();
return 0;
}