Problem C: 汉夫曼编码

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:171 Solved:81

Description

有一些字符和其出现的频率{a : 3 ,b : 22,c : 44,ef : 22,sp : 44}
求其哈夫曼编码

Input

Output

输出a,b,c,ef,sp的哈夫曼编码,把计算的哈夫曼编码填到下面代码中,并提交。
#include<bits/stdc++.h>
using namespace std;
int main(){

     cout << "a:汉夫曼编码" << endl;
     cout << "b:汉夫曼编码" << endl;
     cout << "c:汉夫曼编码" << endl;
     cout << "ef:汉夫曼编码" << endl;
     cout << "sp:汉夫曼编码" << endl;
     return 0;
}

Sample Input Copy

Sample Output Copy