# 官方题解|欢乐赛#39
2025-01-22 17:18:15
发布于:浙江
15阅读
0回复
0点赞
T6
本题考查分类讨论,只要把小王能赢得情况全部列举出来即可,具体的看代码哦。
#include <bits/stdc++.h>
using namespace std;
void solve(){
int a, b, c, d;
cin >> a >> b >> c >> d;
//ac bd
int cnt = 0, ans = 0;
if(a >= c && b > d) cnt += 2;
else if(a > c && b >= d) cnt += 2;
if(a >= d && b > c) cnt += 2;
else if(b >= c && a > d) cnt += 2;
cout << cnt << endl;
}
int main(){
ios::sync_with_stdio(false);cin.tie(0);
int tt = 1;
cin >> tt;
while(tt -- ){
solve();
}
return 0;
}
这里空空如也
有帮助,赞一个