Cod sursa(job #1922084)
Utilizator | Data | 10 martie 2017 15:57:38 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.45 kb |
#include <fstream>
#include <map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n, nr=0;
map <int, int> m;
int main()
{
int i, op, x;
fin>>n;
for(i=1; i<=n; i++)
{
fin>>op>>x;
if(op==1 && m.find(x)==m.end())
m[x]=++nr;
else if(op==2)
m.erase(x);
else if(op==3)
fout<<(m.find(x)!=m.end())<<'\n';
}
return 0;
}