hdu 1496 QQpet exploratory park 水概率dp
来源:互联网 发布:网络维护这个工作好吗 编辑:程序博客网 时间:2024/06/08 04:57
题目
犯了个语言的错误:
C语言中”%%”会输出一个”%”
,我在本地用1个”%”还是输出了”%”。
代码:
#include<cstdio>#include<string>#include<cstring>#include<iostream>#include<cmath>#include<algorithm>#include<vector>using namespace std;#define all(x) (x).begin(), (x).end()#define for0(a, n) for (int (a) = 0; (a) < (n); (a)++)#define for1(a, n) for (int (a) = 1; (a) <= (n); (a)++)#define mes(a,x,s) memset(a,x,(s)*sizeof a[0])#define mem(a,x) memset(a,x,sizeof a)#define ysk(x) (1<<(x))typedef long long ll;typedef pair<int, int> pii;const int INF =0x3f3f3f3f;const int maxn= 61 ;double p[10];double dp[maxn+3][12];int T;int pos[]={ 5, 12, 22, 29, 33, 38, 42, 46, 50 , 55};int main(){ std::ios::sync_with_stdio(false); cin>>T;int kase=0; while(T--) { for1(i,6) cin>>p[i]; if(kase++) puts(""); mem(dp,0); dp[0][0]=1; for0(i,maxn+1) { for0(j,10) { for1(k,6) if(i+k<=maxn) { dp[i+k][j+1]+=p[k]*dp[i][j]; } } } for0(i,10) { int x=pos[i]; for0(j,11) { dp[x][11]+=dp[x][j]; } printf("%d: %.1f%%\n",x,100*dp[x][11]); } } return 0;}
0 0
- hdu 1496 QQpet exploratory park 水概率dp
- HDU 1493 QQpet exploratory park(概率DP)
- !HDU 1493 QQpet exploratory park-dp
- Hdoj 1493 QQpet exploratory park
- hdu 4607 Park Visit(树型DP)
- HDU 3853 LOOPS 概率dp(水
- hdu football 概率DP
- hdu 3835 概率DP
- hdu 3853 概率DP
- hdu Robberies 概率DP
- hdu 4405 概率DP
- HDU 3853 概率DP
- hdu 4487 概率DP
- hdu 4089 概率dp
- HDU 3853 概率DP
- HDU 3853 概率dp
- hdu 4870(概率Dp)
- hdu 3071 ( 概率dp )
- Intellij idea下的maven web工程
- 我的Android面试之旅
- 命令行配置wifi
- Hdu-5869 Different GCD Subarray Query(区间不同值离线算法)
- 等式变换
- hdu 1496 QQpet exploratory park 水概率dp
- appium的几点总结
- Fiddler 抓包软件的安装和使用
- 浅析Socket
- background:url(../images/list01.png) no-repeat 0 center;详解
- C++ 获取时间
- 电路设计_电源纹波过大问题
- 搭建Centos-vpn-pptp服务器
- Mac下libconv动态库与静态库的编译