Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
77576 梁敖铭 火车上的人数 C++ Compile Error 0 MS 0 KB 362 2024-06-12 20:59:26

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int a,n,m,b,d[16]= {0},x[16]= {0},s[16]= {0}; cin>>a>>n>>m>>b; d[1]=d[2]=a; s[1]=a; for (int i=0; i<m; i++) { x[2]=s[2]=i; for (int j=3; j<=n-1; j++) { s[j]=s[j-1]+s[j-2]; x[j]=s[j-1]; d[j]=d[j-1]+s[j]-x[j]; } if (d[n-1]==m) { cout<<d[b]; return 0; } }


Run Info:

Main.cc: In function 'int main()':
Main.cc:19:1: error: expected '}' at end of input
 } 
 ^