跟身在国外的Marathon-fan一起打的比赛,虽然最后没出F但还是涨分了。

 

C - pushpush

题意:n次操作,每次往一个序列后面塞数,然后把整个序列翻转。

#include<cstdio>
#include<algorithm>
#define MN 510000
using namespace std;
 
int n,a[MN],r,l=r=250000;
int main(){
    scanf("%d",&n);r--;
    for (int i=1;i<=n;i++)
    if ((i&1)^(n&1)) scanf("%d",&a[++r]);else scanf("%d",&a[--l]);
    for (int i=l;i<=r;i++) printf("%d ",a[i]);
}
View Code

相关文章:

  • 2022-02-07
  • 2021-06-24
  • 2021-05-19
  • 2022-01-02
  • 2021-12-03
  • 2021-10-16
  • 2021-06-17
  • 2021-06-11
猜你喜欢
  • 2022-03-02
  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2022-02-07
  • 2021-09-17
相关资源
相似解决方案