题解 | 构造序列——取较小值的2倍,如果不相等加一
构造序列
https://www.nowcoder.com/practice/9107a15263d2464298a95bba845e08af
#include <iostream>
using namespace std;
int main() {
int a, b;
while (cin >> a >> b) { // 注意 while 处理多个 case
cout << min(a, b) * 2 + ((a==b)?0:1)<< endl;
}
}
// 64 位输出请用 printf("%lld")

查看17道真题和解析