文章

61

粉丝

98

获赞

17

访问

15.1k

头像
二叉树 题解:
P1233 北京大学机考题
发布于2024年3月25日 18:55
阅读数 92

#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;
    }
    return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发