Pagini recente » Cod sursa (job #2376663) | Cod sursa (job #1140170) | Cod sursa (job #1919674) | Cod sursa (job #112204) | Cod sursa (job #956699)
Cod sursa(job #956699)
#include <fstream>
#include <map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
map < int, int > H;
int main()
{
int n, nr=0, tip, x; f>>n;
for (int i=1; i<=n; i++)
{
f>>tip>>x;
if (tip==1 && H.find(x)==H.end()) H[x]=++nr;
if (tip==2) H.erase(x);
if (tip==3)
{
bool ok=H.find(x)!=H.end();
g<<ok<<'\n';
}
}
return 0;
}