You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
616 B

#include<bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, m, n;
cin >> m >> n;
cin >> a >> b >> c;
if (a + b >= 2 * c)//判断颜色配对,分数更多
{
cout << m * a + b * n;
return 0;
} else//判断颜色不配对,分数更多
{
// 这里要注意判断一下,蓝盒子与红盒子的数量要分类讨论,否则会出错
if (m >= n) {
cout << 2 * n * c + a * (m - n);
return 0;
} else {
cout << 2 * m * c + b * (n - m);
return 0;
}
}
}