60分求助
查看原帖
60分求助
935074
Lichenglin120725ttz楼主2023/8/2 17:22
#include<bits/stdc++.h>
using namespace std;
int main(){
   int T;
	cin>>T;
	for(int i=1;i<=T;i++){
	    long long x,y;
	    cin>>x>>y;
	    int ops=1;
	    while (x > 0 && y > 0) {
	        if(ops==1){
  		        if (x < y){ 
  		            ++x;
  		        }else {
  		            x=x/2;
  		        }
  		        ops=2;
	        }else{
  		        if (x > y) {
  		            ++y;
  		        }else{
  		            y=y/2;
  		        }
  		        ops=1;
	        }
	    }
	    cout<<x<<" "<<y;
	}
	return 0;
}
2023/8/2 17:22
加载中...