Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
626 | 关清声 | 火车上的人数 | C++ | Wrong Answer | 0 MS | 264 KB | 322 | 2023-01-01 10:51:22 |
#include<iostream> using namespace std; int main() { int a[10001]; int n,m,x; cin>>a[0]>>n>>m>>x; a[1]=a[0]; for(int i=2;i<n;i++) { a[i]+=a[i-2]; a[i]+=a[i-1]; //cout<<a[i]<<" "; if(i==x-1) { //cout<<endl; cout<<a[i]; return 0; } } cout<<"No answer."<<endl; return 0; }
------Input------
1 6 7 4
------Answer-----
4
------Your output-----
3