Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
34745 | 22fhq | 【S】T1 | C++ | 通过 | 100 | 355 MS | 8272 KB | 363 | 2024-11-14 14:28:42 |
#include<bits/stdc++.h> using namespace std; int n,a[1000005]; deque<int>q; int main(){ cin>>n; for(int i=1;i<=n;i++)cin>>a[i]; for(int i=1,flg=n%2;i<=n;i++,flg^=1){ if(flg)q.push_front(a[i]); else q.push_back(a[i]); } while(q.size()){ cout<<q.front()<<" ";; q.pop_front(); } return 0; }