| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 72590 | 殷震轩 | 上台阶 | C++ | Time Limit Exceeded | 1000 MS | 272 KB | 345 | 2024-05-11 20:15:44 |
#include<bits/stdc++.h> using namespace std; int a(int n){ long long w; if(n==0){ return 0; } else if(n==1){ return 1; } else if(n==2){ return 2; } else if(n==3){ return 4; } if(n>3){ w=a(n-1)+a(n-2)+a(n-3); } return w; } int main(){ long long n; cin>>n; cout<<a(n); return 0; }