Cod sursa(job #633462)

Utilizator ada_sAda-Mihaela Solcan ada_s Data 13 noiembrie 2011 20:19:33
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.38 kb
#include <fstream>
#include <map>
#define p 666013
using namespace std;
int main()
{
	long n, o, x;
	map<int, int> h;
	ifstream fin("hashuri.in");
	ofstream fout("hashuri.out");
	fin>>n;
	for (long i=0; i<n; i++)
	{
		fin>>o>>x;
		if (o==1)
			if (h.find(x)==h.end())
				h[x]=x%p;
		if (o==2)
			h.erase(x);
		if (o==3)
			fout<<(h.find(x)!=h.end())<<"\n";
	}//for i
   return 0;
}//main