Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
8371 | 王循 | 小明的烦恼 | C++ | Wrong Answer | 0 | 0 MS | 248 KB | 269 | 2020-10-31 19:49:33 |
#include <bits/stdc++.h> using namespace std; int f[10000]; int main() { int n,s=1; cin>>n; f[1]=1; f[2]=3; f[3]=5; if(n<=3) { cout<<f[n]; return 0; } for(int i=4;i<=n;i++) { f[i]=(f[i-1]+f[i-2])*2; } cout<<f[n]<<endl; return 0; }