题解 | #二叉树#
二叉树
https://www.nowcoder.com/practice/5b80ab166efa4551844657603227caeb
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
int a, b;
while (scanf("%d %d",&a,&b)!=EOF) { // 注意 while 处理多个 case
while(a!=b){
if(a>b){
a=a/2;
}else{
b=b/2;
}
}
printf("%d\n",a);
}
return 0;
}
// 64 位输出请用 printf("%lld")
查看10道真题和解析
