hihoCoder Challenge 32 register

Ended

Participants:282

Verdict:Accepted
Submitted:2017-12-03 19:04:31

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>
#include <cstdio>
using namespace std;
int a[4];
int b[100005];
int main()
{
    int n;
    cin>>n;
    int now=1;
    for(int i=0;i<n/2;i++)
    {
        b[i]=now;
        b[n-i-1]=now+1;
        now+=2;
    }
    if(n%2) b[n/2]=n;
    for(int i=0;i<n;i++) printf("%d%c",b[i],i==n-1?'\n':' ');
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX