hihoCoder Challenge 32 register

Ended

Participants:282

Verdict:Accepted
Submitted:2017-12-03 19:19:09

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<bits/stdc++.h>
#define DEBUG {freopen("test.in","r",stdin);freopen("test.out","w",stdout);}
#define INPUT {cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);}
#define mst(a,X) memset(a,X,sizeof(a))
#define INF 0x3f3f3f3f
#define PI acos(-1.0)
using namespace std;
const int maxn = 1e5 + 20;
int ary[maxn];
int main() {
    int n;
    cin >> n;
    for(int i = 1, k = 1; i <= n; ++i) {
        ary[k] = i;
        if(k != n-k+1) ary[n-k+1] = ++i;
        k++;
    }
    for(int i = 1; i < n; ++i)
        cout << ary[i] << ' ';
    cout << ary[n] << endl;
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX