入门题求助WA 80pts #2#8
  • 板块P2705 小球
  • 楼主GoodLuckCat
  • 当前回复1
  • 已保存回复1
  • 发布时间2023/11/27 17:02
  • 上次更新2023/11/27 19:51:10
查看原帖
入门题求助WA 80pts #2#8
916579
GoodLuckCat楼主2023/11/27 17:02

Code:

#include<bits/stdc++.h>
using namespace std;
int c,d,e,r,b,m=-1;
int main()
{
    cin>>r>>b>>c>>d>>e;
    m=max(m,r*c+b*d);
    if(r>b)
    {
        swap(r,b);
        swap(c,d);
    }
    m=max(m,r*e*2+(b-r)*d);
    cout<<m;
}

WA on #2 and #8,找不出问题,求助

是不是 m=max(m,r*e*2+(b-r)*d); 这个语句有问题?

2023/11/27 17:02
加载中...