Cod sursa(job #673905)

Utilizator nutipasa16Macovei Claudiu nutipasa16 Data 5 februarie 2012 10:10:05
Problema Hashuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.45 kb
#include <fstream>
#include <set>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n,c;
long long x;
set < int > h;
set < int >::iterator it;
int main()
	{f>>n;
	for(register int i=1;i<=n;i++)
		{f>>c;
		if(c==1){f>>x;
				h.insert(x);
				}
		else if(c==2){f>>x;
					  h.erase(x);
					  }
			 else {f>>x;
				   it=h.find(x);
			       if(*it)g<<"1\n";
				   else g<<"0\n";
				   }
		}
	return 0;
	}