PE-CN / pe-cn-comments

2 stars 0 forks source link

Problem 137 | Project Euler | #139

Open sx349 opened 4 years ago

sx349 commented 4 years ago

https://pe-cn.github.io/137/

Problem 137 Fibonacci golden nuggets Consider the infinite polynomial series AF(x) = xF1 + x2F2 + x3F3 + …, where Fk is the kth term in the Fibonacci sequence: 1, 1, 2, 3, 5, 8, … ; that is, Fk = Fk−

shangkelingxiang commented 2 years ago

不会正解,写了个找规律

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,k) for(int i=j;i<=(k);i++)
signed main(){
  vector<long long>f={0,1};
  rep(i,2,40)f.push_back(f[i-2]+f[i-1]);
  cout<<f[30]*f[31];
}