文章

35

粉丝

93

获赞

51

访问

13.5k

头像
二叉树 题解:c++
P1233 北京大学机考题
发布于2024年1月17日 17:27
阅读数 457

#include <bits/stdc++.h>
using namespace std;
int main(){
	int x,y;
	while(cin>>x>>y){
		while(x!=y){
			if(x>y) x/=2;
			else y/=2;
		}
		cout<<x<<endl;
	}
}

 

登录查看完整内容


登录后发布评论

1 条评论
谢家福
2024年3月20日 22:36

天才

 

赞(0)