题解:P13554 【MX-X15-T1】奶龙龙
Night_Echo · · 题解
思路:
- 如果
a 大于等于y ,就输出a \times z ,因为这时奶龙玩偶有促销,更加便宜。 - 否则就取
\min(y \times z,a \times x) ,因为y \times z 有可能是小于a \times x 的。代码:
#include<bits/stdc++.h> #define int long long using namespace std; int x,y,z,a; signed main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin>>x>>y>>z>>a; if(a>=y){ cout<<a*z; } else{ cout<<min(y*z,a*x); } return 0; }