Pagini recente » Cod sursa (job #1386335) | Cod sursa (job #1152118) | Cod sursa (job #2770516) | Statistici Ion Vladescu (ionvladescu) | Cod sursa (job #1059430)
#include <fstream>
#include <unordered_map>
using namespace std;
unordered_map <int, int> combo; // because chaos
int main()
{
ifstream in ("hashuri.in");
ofstream out("hashuri.out");
int op, x;
int N;
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() ) <<endl ;
}
in.close();
out.close();
return 0;
}