3 solutions
-
0
Guest MOD
-
5
咱可以用递归做图省事代码:
#include <bits/stdc++.h> typedef long long ll; using namespace std; const int N=10010; int n; ll f(int n){ if(n==1||n==2){ return 1; } return f(n-1)+f(n-2); } int main() { cin.sync_with_stdio(false); ios::sync_with_stdio(0); cin>>n; cout<<f(n)<<".00"<<'\n';//起码给题目一点脸 return 0; }
- 1
Information
- ID
- 418
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 2
- Tags
- (None)
- # Submissions
- 59
- Accepted
- 37
- Uploaded By