CE!!求助!!本蒟蒻太难了!!555
查看原帖
CE!!求助!!本蒟蒻太难了!!555
1370412
qaz12345678_楼主2024/7/21 17:20
#include <bits/stdc++.h>
using namespace std;
int n;
struct T
{
	int v,w;
	double x;
}a[1005];
bool cmp(T x,T y)
{
	return x.x > y.x;
}
int main()
{
	cin >> n;
	for (int i = 1;i <= 3;i++)
	{
		cin >> a[i].v >> a[i].w;
		a[i].x = a[i].w / a[i].v / 1.0;
	}
	sort(a + 1,a + n + 1,cmp);
	long long sum = 0,cnt = 0;
	while (sum >= n)
	{
		sum += a[1];
		cnt++;
	}
	cout << a[1].w * cnt;
}
2024/7/21 17:20
加载中...