给定一个人两场比赛的排名和比赛人数,总排名按照两场比赛的排名和进行,问这个人的排名(即小于等于它的包括他自己的人数)

Solution

大力猜结论(见代码)

#include <bits/stdc++.h>
using namespace std;

int t,n,x,y;

signed main() {
    ios::sync_with_stdio(false);
    cin>>t;
    while(t--) {
        cin>>n>>x>>y;
        cout<<max(1,min(n,n-(n-x)-(n-y)+1))<<" "<<min(n,x+y-1)<<endl;
    }
}

相关文章:

  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
猜你喜欢
  • 2021-06-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2022-01-28
  • 2021-07-18
相关资源
相似解决方案