Cod sursa(job #2776227)
Utilizator | Data | 18 septembrie 2021 22:24:47 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.35 kb |
#include<fstream>
#include<map>
using namespace std;
ifstream F("hashuri.in");
ofstream G("hashuri.out");
int n,r,i,t,x;
map<int,int> m;
int main()
{
F>>n;
while(n--) {
F>>t>>x;
if(t==1&&m.find(x)==m.end())
m[x]=++r;
if(t==2)
m.erase(x);
if(t==3)
G<<(m.find(x)!=m.end())<<"\n";
}
return 0;
}