摘要:
题目意思很好懂,就是问最少出来多少个是的队中的每一个人都能够看到最左边或者是最右边。我们通过枚举没一点作为最高点来求解这个问题,有个要注意的地方就是最高点其实允许有两个,即一个往左看,一个往右看。所以我们就只能够去枚举到左边的最高点,通过搜索去找右边的最高点(这个最高点只要满足高度小于等于我们枚举的点即可)。代码如下:#include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>#include <algorithm>#include <cmath 阅读全文
posted @ 2012-09-14 21:18
沐阳
阅读(272)
评论(0)
推荐(0)