Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
141716 刘嘉柚 Blah数集 C++ 通过 100 0 MS 372 KB 402 2024-04-06 10:14:02

Tests(10/10):


#include<iostream> #include<cstdio> #define yc sanm using namespace std; const int N=100010; int q[N],a,n; int main() { while(cin>>a>>n){ int cur = 2; q[1]=a; int p2=1,p3=1; while(cur<=n) { int res1=q[p2]*2+1,res2=q[p3]*3+1; if(res1<res2) p2++; else p3++; if(!(min(res1,res2)==q[cur-1])) q[cur++]=min(res1,res2); } cout<<q[n]<<endl; } return 0; }


测评信息: