Cod sursa(job #1952295)
Utilizator | Data | 4 aprilie 2017 00:40:54 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.44 kb |
#include <fstream>
#include <map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n;
map<int, bool> m;
int main()
{
fin>>n;
for(int i=0;i<n;++i)
{
int op, x;
fin>>op>>x;
if(op==1)
m[x]=true;
else if(op==2)
m.erase(x);
else if(op==3)
fout<<((m.find(x)!=m.end())?1:0)<<'\n';
}
return 0;
}