题解:P15040 [UOI 2022 II Stage] 竞赛
这道题非常的水,但是**写了20分钟,我也不知道为什么
进入正题
这道题的意思就是说,有
那么我们就可以先用一个
但…………
这么做只能得到80分。
因为有一种可能是,来的人很少,时间却很长,这样一来,答案就会大于来的人,所以最后输出答案的时候需要取答案和
代码
#include <bits/stdc++.h>
using namespace std;
int main(){
int n, m, w, t, cnt = 0;
cin >> n >> m >> w >> t;
int n1 = n;
while ( t >= 0 ){
n -= m; t -= w;
cnt ++;
}
cout << min(cnt * m, n1);
return 0;
}