首页 技术 正文
技术 2022年11月12日
0 收藏 790 点赞 4,258 浏览 912 个字

#include<bits/stdc++.h>using namespace std;int x,n,pp,ct[10000];long double f[210][(1<<8)+5][240][2],p,ans;int main(){freopen("exp.in","r",stdin);freopen("exp.out","w",stdout);scanf("%d%d%d",&x,&n,&pp);p=pp/100.0;for(int i=1;i<=2000;i++)ct[i*2]=ct[i]+1;int d=x&1,b=x&255,c=0;x>>=8;while(x&&(x&1)==d){x>>=1;c++;}f[0][b][c][d]=1.0;for(int i=0;i<n;i++)for(int j=0;j<=255;j++)for(int k=0;k<=230;k++)for(int l=0;l<=1;l++){int b,c,d;if(j==255){b=0;if(l==1){d=0;c=k;}else{d=1;c=1;}}else{b=j+1;d=l;c=k;}f[i+1][b][c][d]=f[i+1][b][c][d]+f[i][j][k][l]*(1-p);//+1if(j>127){b=(j*2)&255;int td=(j*2)&256;td>>=8;if(td!=l){c=1;d=td;}else{c=k+1;d=l;}}else{b=j*2;if(l!=0){d=0;c=1;}else{d=0;c=k+1;}}f[i+1][b][c][d]=f[i+1][b][c][d]+f[i][j][k][l]*p;//*2}for(int j=1;j<=255;j++)for(int k=0;k<=230;k++)for(int l=0;l<=1;l++)ans=ans+f[n][j][k][l]*ct[j];for(int k=0;k<=230;k++)ans=ans+f[n][0][k][1]*8+f[n][0][k][0]*(8+k);printf("%.12Lf\n",ans);}

我怎麼天天犯傻逼錯誤!

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,487
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,903
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,736
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,486
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,126
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,289