poj 3335 Rotating Scoreboard
来源:互联网 发布:创意摆件 知乎 编辑:程序博客网 时间:2024/05/18 02:17
Description
This year, ACM/ICPC World finals will be held in a hall in formof a simple polygon. The coaches and spectators are seated alongthe edges of the polygon. We want to place a rotating scoreboardsomewhere in the hall such that a spectator sitting anywhere on theboundary of the hall can view the scoreboard (i.e., his line ofsight is not blocked by a wall). Note that if the line of sight ofa spectator is tangent to the polygon boundary (either in a vertexor in an edge), he can still view the scoreboard. You may viewspectator's seats as points along the boundary of the simplepolygon, and consider the scoreboard as a point as well. Yourprogram is given the corners of the hall (the vertices of thepolygon), and must check if there is a location for the scoreboard(a point inside the polygon) such that the scoreboard can be viewedfrom any point on the edges of the polygon.
Input
The first number in the input line, T is the number oftest cases. Each test case is specified on a single line of inputin the form n x1 y1x2 y2 ... xnyn where n (3 ≤ n ≤ 100) is thenumber of vertices in the polygon, and the pair of integersxi yi sequence specify thevertices of the polygon sorted in order.
Output
The output contains T lines, each corresponding to aninput test case in that order. The output line contains either YESor NO depending on whether the scoreboard can be placed inside thehall conforming to the problem conditions.
SampleInput
24 0 0 0 1 1 1 1 08 0 0 0 2 1 2 1 1 2 1 2 2 3 2 3 0
SampleOutput
YESNO
Source
programpku_3335;
consteps=1e-8;
typedotsty=record
varline:array[1..100] of linesty;
//============================================================================
procedureswap(x,y:longint);
vartt:linesty;
begin
end;
//============================================================================
procedureqsort(l,r:longint);
vark:double;
begin
end;
//============================================================================
procedureinit;
vari,j:longint;
begin
end;
//============================================================================
functionleft(x,y:double; l:linesty):extended;
begin
end;
//============================================================================
functioncross(l1,l2:linesty):dotsty;
vars1,s2,ss,k,dx,dy:double;
begin
end;
//============================================================================
functionhalf_plane:double;
vartmp:dotsty;
begin
end;
//============================================================================
procedurework;
vars:double;
begin
end;
//============================================================================
begin
end.
- poj 3335 Rotating Scoreboard
- poj 3335 Rotating Scoreboard
- poj 3335 Rotating Scoreboard
- POJ 3335 Rotating Scoreboard
- poj 3335 Rotating Scoreboard
- POJ 3335 Rotating Scoreboard
- POJ 3335 Rotating Scoreboard
- poj 3335 Rotating Scoreboard
- POJ 3335 Rotating Scoreboard
- poj 3335 Rotating Scoreboard
- 490 - Rotating Sentences
- poj 2488
- POJ 2485 Highways
- POJ 3299
- poj 1905
- Poj 3335 Rotating Scoreboard (多边形求核)
- poj 3335 Rotating Scoreboard - 半平面交
- POJ 3335 Rotating Scoreboard (半平面交)
- bzoj 2657 [Zjoi2012]旅游(journey…
- bzoj 1861 [Zjoi2006]Book 书架
- poj 1741 Tree
- bzoj 2338 [HNOI2011]数矩形
- poj 1279 Art Gallery
- poj 3335 Rotating Scoreboard
- poj 1474 Video Surveillance
- 半平面交
- bzoj 1770 [Usaco2009 Nov]lights …
- bzoj 1070 [SCOI2007]修车
- 最后一更了。
- poj 2187 Beauty Contest
- 物理-刚体运动
- C++ 构造函数和运算符重载