Cod sursa(job #2043971)
Utilizator | Data | 20 octombrie 2017 19:57:14 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.38 kb |
#include <fstream>
#include <map>
#define file "hashuri"
using namespace std;
ifstream fin(file".in");
ofstream fout(file".out");
int n,p,x;
map<int,bool> h;
int main()
{
fin>>n;
while(n--)
{
fin>>p>>x;
if(p == 1) h.insert(pair<int,bool>(x,1));
else if(p == 2) h.erase(x);
else fout<<h[x]<<"\n";
}
return 0;
}