Cod sursa(job #2702690)
Utilizator | Gozner Mate MateGM | Data | 5 februarie 2021 15:23:35 |
---|---|---|---|
Problema | Hashuri | Scor | 60 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.49 kb |
#include <fstream>
#include <map>
using namespace std;
int main()
{
ifstream be("hashuri.in");
ofstream ki("hashuri.out");
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;
}