hihoCoder Challenge 32 register

Ended

Participants:282

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

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 <bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
typedef long long ll;
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define PI pair<int,int>
const double pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3fll;
const ll mod = (ll)(1e9 + 7);
const int N = 1000010;
int n;
int data[N];
int main() {    
    while (cin >> n) {
        int tp1 = 1, tp2 = n;
        for (int i = 1; i <= n; ++i) {
            if (i & 1) {
                data[tp1++] = i;
            } else {
                data[tp2--] = i;
            }
        }
        /*
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX