Cod sursa(job #2759792)
Utilizator | Data | 20 iunie 2021 15:07:21 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.37 kb |
#include <bits/stdc++.h>
using namespace std;
unordered_map<string,bool> m;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
int main(){
int n;
in>>n;
for(;n;n--){
char c;
string x;
in>>c>>x;
if(c=='1')m[x]=1;
else if(c=='2')m.erase(x);
else {out<<m[x]<<'\n';if(!m[x])m.erase(x);}
}
}