Cod sursa(job #1590329)

Utilizator rosuflaRosu Flaviu rosufla Data 4 februarie 2016 21:42:04
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.62 kb
// Problema-hashuri.cpp : Defines the entry point for the console application.
//

#include <iostream>
#include <set>
#include <fstream>
#include <iterator>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int nr;
set<int> date;
int main()
{	
	int numar,data,contor;
	
	f >> contor;
	for (int i = 0; i < contor;++i){
		f >> numar >> data;
		if (numar == 1 && date.find(numar) == date.end())
			date.insert(data);
		if (numar == 2)
			date.erase(data);
		if (numar == 3) {
			if (date.find(data) == date.end())
			g << "0\n";
			else
			g << "1\n";
		}
	}
    return 0;
}