The tenth day of intensive training at Nanjing Foreign Language School.
今天打比赛
第一二题水题
第三题的判断条件有误
导致卡90分
#include <bits/stdc++.h>
using namespace std;
int ans;
struct Err {
int c, m;
} o, x;
int main() {
cin >> o.c >> x.c >> o.m >> x.m;
if ((o.c == 0 && x.c == 0) || (o.m == 0 && x.m == 0)) {
cout << "0";
exit(0);
}
if (x.c < o.c) {
swap(x, o);
}
if ((o.c + 1) * x.m > x.c) {
ans = x.c + o.c;
} else {
ans = (o.c + 1) * x.m + o.c;
}
cout << ans;
return 0;
}
第四题死活过不去