f_up是上车人数,f_cup是净上车人数,f_down是下车人数
by Crab_time @ 2021-07-29 19:26:14
目前第三点错了
by Crab_time @ 2021-07-29 19:46:15
顶
by Crab_time @ 2021-07-29 20:04:09
~~那么多注释,有点看不懂~~
上代码
```cpp
#include <bits/stdc++.h>
using namespace std;
int f[25],u[25];
int main(){
int a,n,m,x;
cin>>a>>n>>m>>x;
f[1]=f[2]=u[1]=a;
for(int i=0;i<=m&&f[n-1]!=m;++i){
u[2]=i;
for(int j=3;j<n;++j){
u[j]=u[j-1]+u[j-2];
f[j]=f[j-1]+u[j-2];
}
}
cout<<f[x]<<endl;
return 0;
}
```
by Blood_red @ 2021-08-15 17:46:18