ZOJ 3827 Information Entropy
来源:互联网 发布:java 语音聊天 编辑:程序博客网 时间:2024/06/05 09:24
题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3827
题意:求题目中给的式子。注意,lim 0log0 =0 (由洛必达法则)
AC代码:
#include<stdio.h>#include<math.h>#include<string.h>#define e exp(1)int main(){ int T,i,n; double t,s,p; char str[10]; scanf("%d",&T); while(T--) { s=0; scanf("%d%s",&n,str); if(str[0]=='b') t=2; else if(str[0]=='n') t=e; else if(str[0]=='d') t=10; for(i=0;i<n;i++) { scanf("%lf",&p); if(p==0) continue; p=p/100; s+=p*log10(p); } s=-s/log10(t); printf("%.12lf\n",s); } return 0;}
0 0
- ZOJ 3827 Information Entropy
- ZOJ-3827-Information Entropy
- ZOJ 3827 Information Entropy
- ZOJ-3827-Information Entropy
- zoj 3827 Information Entropy(水题)
- ZOJ 3827 Information Entropy 水
- zoj 3827 Information Entropy 【水题】
- ZOJ ——3827 Information Entropy
- ZOJ Problem Set - 3827Information Entropy
- 解题报告 之 ZOJ 3827 Information Entropy
- ZOJ 3827 Information Entropy【水题、简单相加】
- ZOJ 3827 Information Entropy (2014牡丹江区域赛)
- ZOJ 3827 Information Entropy(数学题 牡丹江现场赛)
- zoj 3827 Information Entropy(2014牡丹江区域赛I题)
- 2014ACM/ICPC亚洲区域赛牡丹江站现场赛-I ( ZOJ 3827 ) Information Entropy
- 信息熵 information Entropy
- Calculate Information Entropy
- 信息熵(Information Entropy)
- 删除dedecms友情链接中<li>标签的方法
- HDoj-1163- Digital Roots
- gdb一些简单命令的使用
- 列表&字典解析式
- 做揍坠作注昨族渍砖抓资卓仔遵走籽兹佐
- ZOJ 3827 Information Entropy
- 作组奏装柞赚追装坠桌赚壮酌自抓座足奏
- 通过IRPhook实现键盘记录
- 新东方好东西核弹头的人性的风格的消化道中发现
- 作兹滋最浊转宗状撰座灼昨赘壮座租咨嘴
- 1
- Php Fatal error: Allowed memory size of xxx bytes exhausted 的解决办法
- 谆醉谆字祝篆赘滋壮准遵酌琢渍撰醉嘴足
- 2