Cod sursa(job #2702850)
Utilizator | Data | 6 februarie 2021 08:37:07 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.52 kb |
#include <fstream>
#include <map>
#include<unordered_map>
using namespace std;
int main()
{
ifstream be("hashuri.in");
ofstream ki("hashuri.out");
unordered_map<int,int>m;
int n,db=0;
be>>n;
for(int i=1;i<=n;i++)
{
int x,y;
be>>x>>y;
if(x==1 && m.find(y)==m.end()){
m[y]=db++;
}
if(x==2)m.erase(y);
if(x==3)
{
bool c=m.find(y)!=m.end();
ki<<c<<endl;
}
}
return 0;
}