姹紫嫣红
查看原帖
姹紫嫣红
726965
timmy2012楼主2024/7/30 13:56

#include<bits/stdc++.h>
using namespace std;
const int N=100+5;
double my[N],mk[N];
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
    int n;
	cin>>n;
	cin>>mk[1];
	my[1]=100;
    for(int i=2;i<=n;i++)
	{
        int q;
		cin>>q;
        my[i]=max(my[i-1],mk[i-1]*100.0/q);
        mk[i]=max(mk[i-1],my[i-1]/100.0*q);
    }
    cout<<fixed<<setprecision(2)<<my[n]<<"\n";
	return 0;
}
2024/7/30 13:56
加载中...