http://acm.hdu.edu.cn/showproblem.php?pid=1273
乱搞题,n-1减去起点,把剩下的点分成尽可能相等的两部分1、2(为了得到尽可能大的答案),对于1内部来讲,显然总能保证“新鲜”,在新鲜1后,不难看出2的每个点都对应着一个“新鲜”
说的乱七八糟,大概就这样吧。。。
View Code
#include <iostream> #include <queue> #include <stack> #include <vector> using namespace std; int main() { int n; while(scanf("%d",&n),n) printf("%d\n",(n-1)>>1); return 0; }