找规律来贪心
#include <iostream>
using namespace::std;
using std::cout;
using std::cin;
int ljxm(int n, int m)
{
int ans = 0;
while (m != n)
{
if (m < n)
{
m += 1;
}
else if (m & 1)
{
m += 1;
}
else
{
m /= 2;
}
ans += 1;
}
return ans;
}
int main()
{
int startValue,target;
cin >> startValue >> target;
std::cout << ljxm(startValue, target);
return 0;
}