Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
63170 戴文博 青蛙跳台阶 C++ Accepted 2 MS 268 KB 224 2024-01-06 13:49:22

Tests(10/10):


Code:

#include<bits/stdc++.h> long long a[51]; using namespace std; int main(){ int n; cin>>n; a[1]=1; for(int i=2;i<=n;i++){ for(int j=i-1;j>=1;j--){ a[i]+=a[j]; } a[i]++; } cout<<a[n]; return 0; }