Pagini recente » Cod sursa (job #1339010) | Cod sursa (job #2193396) | Cod sursa (job #2634628) | Cod sursa (job #1704804) | Cod sursa (job #1590329)
// 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;
}