标签:cti title AC string sizeof using ems bsp i++
https://vjudge.net/problem/LightOJ-1030
#include<iostream>
#include<stdio.h>
#include<cstring>
using namespace std;
int main()
{
int t;
cin>>t;
int a[110];
double dp[110];
for(int i=1;i<=t;i++)
{
memset(a,0,sizeof(a));
memset(dp,0,sizeof(dp));
dp[1]=1;
int n,h;
double ans=0;
cin>>n;
for(int j=1;j<=n;j++)
cin>>a[j];
for(int j=1;j<=n;j++){
if(n-j<6)
h=n-j;
else
h=6;
for(int k=1;k<=h;k++)
{
dp[j+k]+=dp[j]*1.0*1/h;
}
ans+=1.0*a[j]*dp[j];
}
printf("Case %d: %lf\n",i,ans);
}
return 0;
}
https://vjudge.net/problem/LightOJ-1027
标签:cti title AC string sizeof using ems bsp i++
原文地址:https://www.cnblogs.com/caijiaming/p/8907365.html