hihoCoder Challenge 32 register

Ended

Participants:282

Verdict:Accepted
Submitted:2017-12-03 19:07:55

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
24
25
26
27
28
29
30
31
#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <map>
using namespace std;
const int MAXN = 1e5+5;
int val[MAXN];
int main(){
    int n;
    int i,j,k;
    scanf("%d",&n);
    for( i=1,j=n,k=1;k<=n;++i,--j ){
        val[i] = k++;
        if( k>n ) break;
        val[j] = k++;
    }
    for( i=1;i<=n;++i ){
        if( i!=1 ) printf(" ");
        printf("%d",val[i]);
    }
    printf("\n");
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX