Why??
查看原帖
Why??
1374261
gaohongyuan楼主2025/1/12 17:21
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b;
	cin>>a>>b;
	if(a>=b)
	{
	    cout<<a-b;
	    return 0;
	}
	int t=0,x=-1;
    while(++t)
    if((a<<t)>=b&&x==-1){x=t-1;break;}
    cout<<min(t+(a<<t)-b,t-1+b-(a<<x));
    return 0;
}

90?比赛的时候调试了亿遍;

2025/1/12 17:21
加载中...