| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 138691 | 李朋秦 | 火车上的人数 | C++ | Wrong Answer | 1 MS | 268 KB | 444 | 2025-11-29 14:31:58 |
#include<bits/stdc++.h> using namespace std; int m,c[16]={0}; int main() { int a,n,x,up[16]={0},down[16]={0}; cin>>a>>n>>m>>x; up[0]=a;c[0]=a;c[1]=a; for(int i=0;i<m;i++){//人数 up[1]=i;down[1]=i; for(int j=2;j<n-1;j++){ up[j]=up[j-1]+up[j-2]; down[j]=up[j-1]; c[j]=up[j]-down[j]+c[j-1]; } if(c[n-2]==m){ cout<<c[x-1]; return 0; } } cout<<0; return 0; }
------Input------
1 8 75 6
------Answer-----
No answer.
------Your output-----
0