题目链接:http://codeforces.com/contest/805/problem/C
思路: 头尾相加就等于n+1,花费最少的遍历顺序就是1->n->2->(n-1)->3->(n-2)…… 可以发现结果就是 (n-1)/2
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int n;
scanf(
"%d",&n);
int ans=(n-
1)/
2;
printf(
"%d\n",ans);
return 0;
}