Cod sursa(job #654049)

Utilizator titeltitel popescu titel Data 29 decembrie 2011 14:18:57
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.47 kb
// Sursa da ** de puncte.
#include <fstream>
#include <map>
#define MOD 666013
using namespace std;
ifstream f("hashuri.in"); ofstream g("hashuri.out");
int N, NR;
map <int, int> M;
int main()
{   int op, x;
	f>>N;
    for (; N; --N)
    { 	f>>op>>x;
        if (op == 1 && M.find(x)==M.end()) M[x] = ++NR;     
        if (op == 2) {M.erase(x); continue;}
		if (op == 3) if (M.find(x) == M.end()) g<<"0\n"; else g<<"1\n";
    }
    g.close(); return 0;
}