求助,无法编译

P1011 [NOIP1998 提高组] 车站

数组开太大了
by zltqwq @ 2021-01-31 17:16:19


```c #include<bits/stdc++.h> using namespace std; int a,n,m,x,f[21],s[21]; int main(){ cin>>a>>n>>m>>x;f[1]=f[2]=s[1]=a; for(int i=0;i<=m;i++,s[2]=i){ for(int j=3;j<n;j++){s[j]=s[j-1]+s[j-2];f[j]=f[j-1]+s[j]-s[j-1]; } if(f[n-1]==m){cout<<f[x];return 0; } } } ``` 改成这样
by yekgg @ 2021-02-25 16:38:29


希望对你有帮助,毕竟你似乎没有通过
by yekgg @ 2021-02-25 16:39:18


@[yekgg](/user/410287) 才看到,十分感谢
by yezihao1 @ 2022-02-09 20:06:58


|