题目描述
承压计算 - 蓝桥云课 (lanqiao.cn)
题目分析
将重量存入a中,每一层从上到下进行计算,用d进行计算列的重量,当前d的重量应为正上数组和右上数组的个半和并加上自身的重量
计算到30层记录最大最小值,进行比例运算即可
#include<bits/stdc++.h>
using namespace std;
const int N = 2e3 + 10;
double a[N][N], d[N][N];
int main()
{
/*for(int i = 1; i <= 29; i ++){for(int j = 1; j <= i; j ++){cin >> a[i][j];d[i][j] = d[i - 1][j] / 2 + d[i - 1][j - 1] / 2 + a[i][j];}}double maxx = 0, minn = 2e5 + 10;for(int i = 1; i <= 30; i ++){d[30][i] = d[29][i] / 2 + d[29][i - 1] / 2;if(d[30][i] > maxx)maxx = d[30][i];if(d[30][i] < minn)minn = d[30][i];}printf("%lf", 2086458231 / minn * maxx);
*/cout << 72665192664; return 0;
}