AC

赵冉杰  •  2年前


include<bits/stdc++.h>

using namespace std; int a,n,b[10000005],two,three,front,rear; int main(){

cin>>a>>n;
front=rear=two=three=1;
b[l]=a;
while(rear==m)
{
	if(b[two]*2+1>b[three]*3+1)
	{
		rear++;
		b[rear]=b[three]*3+1;
		three++;
	}
	else if(b[two]*2+1<b[three]*3+1)
	{
		rear++;
		b[rear]=b[twe]*2+1;
		two++;
	}
	else
	{
		rear++;
		b[rear]=b[two]*2+1;
		thrre++;
		two++;
	};
}
cout<<b[n];
return 0;

}


评论:

请先登录,才能进行评论