| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 142740 | 冼俊烨 | Blah数集 | C++ | Accepted | 100 | 0 MS | 504 KB | 430 | 2024-04-09 13:37:59 |
#include<bits/stdc++.h> using namespace std; const int N=100010; long long q[N]; int a,n; void work(int a,int n) { int rear = 2; q[1]=a; int two=1,three=1; while(rear<=n) { long long t1 = q[two]*2+1,t2=q[three]*3+1; int t = min(t1,t2); if(t1<t2) two++; else three ++; if(t==q[rear-1]) continue; q[rear++]=t; } cout<<q[n]<<"\n"; } int main() { while(cin>>a>>n) work(a,n); return 0; }//G