Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
5889 吴泽宇 上楼梯 C++ 编译错误 0 0 MS 0 KB 339 2020-08-16 08:50:48

Tests(0/0):


#include<bits/stdc++.h> using namespace std; int k[INT_MAX]={0}; int upstair(int stairs){ if(stairs<=1)return 1; if(k[stairs]==0)return k[stairs]; k[stairs]=upstair(stairs-1)+upstair(stairs-2); return k[stairs]; } int main(){ int n; cin>>n; while(n--){ int a; cin>>a; cout<<upstair(a)<<endl; } return 0; }


测评信息: