Pagini recente » Cod sursa (job #3126949) | Cod sursa (job #424070) | Cod sursa (job #1350349) | Cod sursa (job #1137372) | Cod sursa (job #694221)
Cod sursa(job #694221)
#include <fstream>
#include <map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n;
map <int, int> tabela;
int main()
{ int i, tip, x;
f>>n;
for (i=1;i<=n;i++)
{ f>>tip>>x;
if (tip==1 && tabela.find(x)==tabela.end()) tabela[x]=1;
if (tip==2) tabela.erase(x);
if (tip==3) if(tabela.find(x)!=tabela.end()) g<<"1"<<"\n";
else g<<"0\n";
}
return 0;
}