CF Ping-Pong

题目链接:Ping-Pong

 

题目大意:

 

 

 

 

思路:

因为每个人都想最大化自己赢得局数,所以B的体力为y时,他可以所有球都不接,然后等A没体力时,再赢y局,但是又因为要最小化对方的赢得局数,所以在A发的最后一个球,是可以接的,这样,A少赢一局。

 

参考代码:

 1 #include <bits/stdc++.h>
 2 using namespace std;
 3 int main() {
 4     int t;
 5     cin >> t;
 6     while(t--) {
 7         int x,y;
 8         cin >> x >> y;
 9         cout << x-1 << " " << y << endl;
10     }
11     return 0;
12 }
View Code

 

posted @ 2020-12-20 20:37  不敢说的梦  阅读(88)  评论(0)    收藏  举报