PBH的小火箭
Time Limit: 1000MS Memory Limit: 65536KB
Problem Description
PBH 有五个小火箭,他从中选择一些火箭排成一条线,并决定按照一定规则发射完所有的火箭。
首先第一轮他会发射最左端和最右端的火箭,之后每轮发射时他都会在每个非空区间(非空区间指区间 [l, r] 内的火箭均未发射,且 l-1, r+1 处的火箭均已发射的一个区间)中随机选择一个火箭发射。每两轮发射之间间隔 10 秒。
现在他想知道发射完所有火箭的期望时间是多少。
Input
输入数据有多组(数据组数不超过 400),到 EOF 结束。
每组输入一个整数 n (3 <= n <= 400),表示要发射的小火箭数量。
Output
对于每组数据,输出一个实数,表示答案,保留 10 位小数。
Example Input
3 5 4
Example Output
10.0000000000 26.6666666667 20.0000000000
Hint
Author
「SDUT Round #3 - 2017 愚人节专场」by bLue
#include<stdio.h> #include<bits/stdc++.h> #include<iostream> using namespace std; int main() { int n; while(cin>>n) { if(n==3) cout<<"10.0000000000"<<endl; else if(n==4) cout<<"20.0000000000"<<endl; else cout<<"26.6666666667"<<endl; } return 0; } /*************************************************** User name: 听说强哥不参赛 Result: Accepted Take time: 0ms Take Memory: 160KB Submit time: 2017-04-01 23:03:00 ****************************************************/