Cod sursa(job #2513755)
| Utilizator | Data | 23 decembrie 2019 18:35:32 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.69 kb |
#include <bits/stdc++.h>
#define dim 100005
using namespace std;
string numeproblema="hashuri";
ifstream fin(numeproblema+".in");
ofstream fout(numeproblema+".out");
int n,tip,i;
unordered_map <int,int> m;
int x;
int main()
{
fin>>n;
for(i=1; i<=n; i++)
{
fin>>tip;
if(tip==1)
{
fin>>x;
m[x]=1;
}
else if(tip==2)
{
fin>>x;
auto it=m.find(x);
if(it!=m.end())
m.erase(it);
}
else
{
fin>>x;
auto it=m.find(x);
it!=m.end()?fout<<1:fout<<0;
fout<<"\n";
}
}
}
