http://codeforces.com/problemset/problem/899/C
tot为奇数时,绝对差为1;tot为偶数时,绝对差为0。
难点在于如何输出。
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#define lson l, m, rt<<1
#define rson m+1, r, rt<<1|1
#define IO ios::sync_with_stdio(false);cin.tie(0);
#define INF 0x3f3f3f3f
#define MAXN 500010
const int MOD=1e9+;
typedef long long ll;
using namespace std;
ll n;
int main()
{
while(cin >> n){
ll tot = (+n)*n/;
if(tot&){
cout << "" << endl;
cout << n/ << " ";
}
else{
cout << "" << endl;
cout << n/ << " ";
}
for(int i = n, j = ; i > ; i -= , j = !j){
cout << i-j << " " ;
}
cout << endl;
}
return ;
}