Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
47346 | 奚晨瑞 | 斐波那契数列_记忆化递归 | C++ | Wrong Answer | 0 MS | 248 KB | 221 | 2024-05-17 15:13:57 |
#include<iostream> using namespace std; int f(int n){ if(n==1){ return 0; } else if(n==2){ return 1; } else{ return f(n-1)+f(n-2); } } int main() { int n; cin>>n; cout<<f(n); return 0; }