Pagini recente » Cod sursa (job #263632) | Cod sursa (job #931075) | Cod sursa (job #3131518) | Lot 2017 | Cod sursa (job #397093)
Cod sursa(job #397093)
#include<fstream>
# include<map>
using namespace std;
int n,nr;
map <int, int> M;
int main()
{ ifstream f ("hasuri.in");
ofstream g ("hasuri.out");
int i,tip,x;
f>>n;
for(i=1;i<=n;i++)
{
f>>tip>>x;
if ((tip == 1) && M.find(x)==M.end()) M[x]= nr ++;
if (tip == 2) M.erase(x);
if (tip == 3) g<<(M.find(x) !=M.end())<<"\n";
g.close();
f.close();
}
return 0;
}