当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1898:Entropy

Special Judge 特殊评判
题目描述
In 1948 Claude E. Shannon in "The Mathematical Theory of Communication"' has introduced his famous formula for the entropy of a discrete set of probabilities p1, ... , pn:
H=-∑pilog2pi

We will apply this formula to an arbitrary text string by letting pi be the relative frequencies of occurrence of characters in the string. For example, the entropy of the string "Northeastern European Regional Contest" with the length of 38 characters (including 3 spaces) is 3.883 with 3 digits after decimal point. The following table shows relative frequencies and the corresponding summands for the entropy of this string.

Your task is to find a string with the given entropy.
输入解释
The input consists of a single real number H (0.00 <= H <= 6.00) with 2 digits after decimal point.
输出解释
Write to the output file a line with a single string of at least one and up to 1000 characters '0'-'9', 'a'-'z', 'A'-'Z', '.' (dot), and spaces. This string must have the entropy within 0.005 of H.
输入样例
3.88
输出样例
Northeastern European Regional Contest

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-1898

最后修改于 2020-10-29T06:17:05+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 30000