[UVA][dp][最優二叉樹] 12057 - Prefix Codes
Given an alphabet S, and a probability Prob(a) for each , a binary prefix code represents each a in S as a bit string B(a), such that B(a1) is not a prefix of B(a2) for any a1≠a2 in S.
Huffman’s algorithm constructs a binary prefix code by pairing the two least probable ...