POJ1474:Video Surveillance(求多边形的核)(占位)
The first problem is to choose where to install the camera for every floor. The only requirement is that every part of the room must be visible from there. In the following figure the left floor can be completely surveyed from the position indicated by a dot, while for the right floor, there is no such position, the given position failing to see the lower left part of the floor.
Before trying to install the cameras, your friend first wants to know whether there is indeed a suitable position for them. He therefore asks you to write a program that, given a ground plan, de- termines whether there is a position from which the whole floor is visible. All floor ground plans form rectangular polygons, whose edges do not intersect each other and touch each other only at the corners.
Input
A zero value for n indicates the end of the input.
Output
Print a blank line after each test case.
Sample Input
4
0 0
0 1
1 1
1 0
8
0 0
0 2
1 2
1 1
2 1
2 2
3 2
3 0
0
Sample Output
Floor #1
Surveillance is possible. Floor #2
Surveillance is impossible.
题意:给定比较规则的多边形,问是否存在一点P,使得P到所有多边形上的点的路径都是在多边形内部,即是否存在核。
思路:反正是模板题,思路自己百度吧。
update:https://www.cnblogs.com/hua-dong/p/10670137.html
POJ1474:Video Surveillance(求多边形的核)(占位)的更多相关文章
- poj 1474 Video Surveillance - 求多边形有没有核
/* poj 1474 Video Surveillance - 求多边形有没有核 */ #include <stdio.h> #include<math.h> const d ...
- POJ 1279 Art Gallery【半平面交】(求多边形的核)(模板题)
<题目链接> 题目大意: 按顺时针顺序给出一个N边形,求N边形的核的面积. (多边形的核:它是平面简单多边形的核是该多边形内部的一个点集该点集中任意一点与多边形边界上一点的连线都处于这个多 ...
- poj1474 Video Surveillance
题意:求多边形的内核,即:在多边形内部找到某个点,使得从这个点能不受阻碍地看到多边形的所有位置. 只要能看到所有的边,就能看到所有的位置.那么如果我们能够在多边形的内部的点x看到某条边AB,这个点x一 ...
- POJ1474 Video Surveillance(半平面交)
求多边形核的存在性,过了这题但是过不了另一题的,不知道是模板的问题还是什么,但是这个模板还是可以过绝大部分的题的... #pragma warning(disable:4996) #include & ...
- POJ 3130 How I Mathematician Wonder What You Are!(半平面交求多边形的核)
题目链接 题意 : 给你一个多边形,问你该多边形中是否存在一个点使得该点与该多边形任意一点的连线都在多边形之内. 思路 : 与3335一样,不过要注意方向变化一下. #include <stdi ...
- How I Mathematician Wonder What You Are! - POJ 3130(求多边形的核)
题目大意:判断多多边形是否存在内核. 代码如下: #include<iostream> #include<string.h> #include<stdio.h> # ...
- poj 1474 Video Surveillance 【半平面交】
半平面交求多边形的核,注意边是顺时针给出的 //卡精致死于是换(?)了一种求半平面交的方法-- #include<iostream> #include<cstdio> #inc ...
- POJ 1279 Art Gallery 半平面交 多边形的核
题意:求多边形的核的面积 套模板即可 #include <iostream> #include <cstdio> #include <cmath> #define ...
- POJ - 1474 :Video Surveillance (半平面交-求核)
pro:顺时针给定多边形,问是否可以放一个监控,可以监控到所有地方,即问是否存在多边形的核. 此题如果两点在同一边界上(且没有被隔段),也可以相互看到. sol:求多边形是否有核.先给直线按角度排序, ...
随机推荐
- BZOJ 3675 [Apio2014]序列分割 (斜率优化DP)
题目链接 BZOJ 3675 首先最后的答案和分割的顺序是无关的, 那么就可以考虑DP了. 设$f[i][j]$为做了$i$次分割,考虑前$j$个数之后的最优答案. 那么$f[i][j] = max( ...
- 大话Spark(3)-一图深入理解WordCount程序在Spark中的执行过程
本文以WordCount为例, 画图说明spark程序的执行过程 WordCount就是统计一段数据中每个单词出现的次数, 例如hello spark hello you 这段文本中hello出现2次 ...
- idea抛异常方式
选中需要抛异常的行,按alt+enter或者ctrl+alt+t,然后上下键选择自己抛异常的方式即可,如下图:
- go语言学习之路 二:变量
说道变量,首先应该提一提关键字,因为不能把关键字当做变量来声明. 关键字: 下面列出GO语言的关键字或保留字: break default func interface select case def ...
- systemtap notes
systemtap notes -- 10 June 2014 1 Systemtap systemtap是红帽开发的一款分析工具,如果你需要使用的话,最好在redhat的系统上,在 Ubuntu上兼 ...
- 汉澳sinox通过ndis执行windows驱动程序
汉澳sinox不仅能通过wine执行windows应用程序.还能通过ndis执行windows驱动程序 汉澳sinox使用 Windows NDIS 驱动程序 详细实现方法是用ndisgen把wind ...
- 最小公倍数(Least Common Multiple)
最小公倍数=两个数的乘积/两个数的最大公约数. 接上篇求最大公约数方法,最小公倍数的代码例如以下: public class LCM { //最小公倍数=两数乘积/最大公约数 public stati ...
- sql之浅谈视图的作用
[数据库]☆★sql之浅谈视图的作用 在一个项目的实际开发过程中牵涉到复杂业务的时候,我们不可避免的须要使用中间表来进行数据连接,有的同学就说了,我能够採用Hibernate进行主外键进行关联啊?多对 ...
- fill函数和fill_n函数
fill_n函数的作用是:给你一个起始点,然后再给你一个数值count和val.把从起始点开始依次赋予count个元素val的值. 注意: 不能在没有元素的空容器上调用fill_n函数 列子: ...
- HashMap源代码学习笔记
HashMap的底层主要是基于数组和链表来实现的,它之所以有相当快的查询速度主要是由于它是通过计算散列码来决定存储的位置. HashMap中主要是通过key的hashCode来计算hash值的 ...