| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 5981 | 吴泽宇 | 上楼梯 | C++ | Accepted | 100 | 0 MS | 256 KB | 350 | 2020-08-22 22:36:59 |
#include<bits/stdc++.h> using namespace std; int k[100000]={0}; int upstair1(int stairs1){ if(stairs1<=1)return 1; if(k[stairs1]!=0)return k[stairs1]; k[stairs1]=upstair1(stairs1-1)+upstair1(stairs1-2); return k[stairs1]; } int main(){ int n; cin>>n; while(n--){ int a; cin>>a; cout<<upstair1(a)<<endl; } return 0; }