Pagini recente » Clasamentul arhivei de probleme | Cod sursa (job #604651) | Cod sursa (job #2389926) | Cod sursa (job #435492) | Cod sursa (job #2624959)
#include <fstream>
#<include <unordered_map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_map <int, int> map1;
unordered_map <int, int>::iterator map2;
int n,op,nr;
int main()
{
int n;
f>>n;
for(int i=0;i<n;i++)
{
fin>>op>>nr;
if(op==1)
map1.insert(make_pair(nr,1))
if(op==2)
{
map2=map1.find(nr);
if(map2!=map1.end());
map1.erase(nr);
}
if(op==3)
{
map2=map1.find(nr);
if(map2!=map1.end())
fout<<1<<"\n";
else
fout<<0<<"\n"
}
}
return 0;
}