Cod sursa(job #1059436)

Utilizator NCodeMihai X NCode Data 16 decembrie 2013 18:09:46
Problema Hashuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.57 kb
#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;
}