AC

赵冉杰 · 发布于 2022-05-03 · 浏览 605 回复 0

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;

}

全部回复 共 0 条

还没有人回复。往下写第一条。

发表回复