France '98
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=30506#problem/H
#include<map>
#include<set>
#include<list>
#include<cmath>
#include<ctime>
#include<deque>
#include<stack>
#include<bitset>
#include<cstdio>
#include<vector>
#include<cstdlib>
#include<cstring>
#include<iomanip>
#include<numeric>
#include<sstream>
#include<utility>
#include<iostream>
#include<algorithm>
#include<functional> using namespace std ;
char str[ 20 ][ 50 ] ;
double val[ 20 ][ 20 ] ;
double dp[ 20 ][ 5 ] ; int main()
{
for( int i = 0 ; i < 16 ; ++i )
{
scanf( "%s" , str[ i ] ) ;
}
for( int i = 0 ; i < 16 ; ++i )
{
for( int j = 0 ; j < 16 ; ++j )
{
scanf( "%lf" , &val[ i ][ j ] ) ;
val[ i ][ j ] /= 100 ;
}
}
memset( dp , 0 , sizeof( dp ) ) ;
for( int i = 0 ; i < 16 ; ++i )
{
dp[ i ][ 0 ] = 1 ;
}
int len = 1 ;
for( int i = 1 ; i <= 4 ; ++i )
{ for( int j = 0 ; j < 16 ; ++j )
{
int st ;
if( ( j / len ) & 1 )
{
st = ( j / len - 1 ) * len ;
}
else
{
st = ( j / len + 1 ) * len ;
} for( int k = st ; k < st + len ; ++k )
{
dp[ j ][ i ] += dp[ j ][ i - 1 ] * dp[ k ][ i - 1 ] * val[ j ][ k ] ;
}
}
len = len * 2 ;
}
for( int i = 0 ; i < 16 ; ++i )
{
printf( "%-11sp=%.2lf%%\n" , str[ i ] , dp[ i ][ 4 ]* 100 ) ;
}
//system( "pause" ) ;
return 0;
}
France '98的更多相关文章
- uva 542 - France '98(概率)
题目链接:uva 542 - France '98 题目大意:有16支球队比赛,给出16支球队的名称,然后给出16*16的表格,g[i][j] 表示i队胜j队的概率,问说16支球队获得总冠军的概率. ...
- France \'98(概率)
题目描述 Today the first round of the Soccer World Championship in France is coming to an end. 16 countr ...
- 杭电ACM分类
杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze ...
- HOJ题目分类
各种杂题,水题,模拟,包括简单数论. 1001 A+B 1002 A+B+C 1009 Fat Cat 1010 The Angle 1011 Unix ls 1012 Decoding Task 1 ...
- poj 3071 Football(概率dp)
id=3071">http://poj.org/problem? id=3071 大致题意:有2^n个足球队分成n组打比赛.给出一个矩阵a[][],a[i][j]表示i队赢得j队的概率 ...
- 转载:hdu 题目分类 (侵删)
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...
- 修改nignx报错Nginx [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
Nginx [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use) 这个错误是修改了nginx的配置时出现,表名80端口被程 ...
- nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 错误解决
今天在做LNMP的时候,启动nginx服务,无法开启,导致网页打不开.把服务从起一下发现提示错误如下: Starting nginx: nginx: [emerg] bind() to 0.0.0.0 ...
- http://www.cnblogs.com/zhaoguihua/tag/%E9%AB%98%E6%80%A7%E8%83%BD%E7%BD%91%E7%AB%99/
http://www.cnblogs.com/zhaoguihua/tag/%E9%AB%98%E6%80%A7%E8%83%BD%E7%BD%91%E7%AB%99/
随机推荐
- poj 1430 第二类斯特林数
1 #include <iostream> #include <cmath> #include <algorithm> using namespace std; i ...
- 使用Jquery后去div个数
<div id="tree1" class="tree-folder-content"> <div class="tree-fold ...
- Physiological Processes of Speech Production--Reading Notes (8)
Upper Jaw The upper jaw, or the maxilla with the upper teeth, is the structure fixed to the skull, f ...
- css基础(二)
一.元素内容的字体属性 1.font-family 字体名称,例如:宋体,新罗马字体等 注意:1.不能使用偏僻的字体,要使用安全字体,如:arial;verdana;times new roman ...
- switch语句:适用于一个条件有多个分支的情况---分支语句
例1: 客服选择功能,然后按按键 Console.WriteLine("查花费请按1,查余额请按2,查流量请按3,办理业务请按4,宽带请按5,人工服务请按6,集团业务请按7"); ...
- C# lazy<T>的用法
.NET 4.0中加入了lazy<T>(懒对象),其实叫懒对象感觉不对,更应该叫延迟对象加载. 正如我们所知,对象的加载是需要消耗时间的,特别是对于大对象来说消耗的时间更多.lazy可以实 ...
- 数据库迁移(SQL SERVER导入数据到MySql)
地址:http://blog.csdn.net/jiaohougenyang/article/details/44937801 背景:项目最开始时使用的是SQL Server数据库,业务需求现要将数据 ...
- 【QT相关】对话框相关
为行编辑器限制规则: QRegExp regExp("[A-Za-z][1-9][0-9]{0,2}"); lineEdit->setValidator(new QRegEx ...
- svn笔记
安装部署 1.yum install subversion 2.创建svn版本库目录 mkdir -p /svn 3.创建版本库 svnadmin create /svn/fengchao/ ...
- CentOS6.5下VNC Server远程桌面配置详解
参考文献: (总结)CentOS Linux下VNC Server远程桌面配置详解 远程桌面连接工具VNC——license Key 我的下载地址为 太平洋下载 VNC连接黑屏的问题 centos 6 ...