当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2804:Jetpack Sniper 3000 Fragfest Extreme

题目描述
You are a beta tester for a new online game, Jetpack Sniper 3000 Fragfest Extreme. In this game, players with jetpacks fly around major metropolitan areas and attempt to shoot each other with laser guns. The only obstacles behind which players can hide are the ever-present glass towers of cubicle farms, skyscrapers.

To assist you in playing the game, you've written a program that will tell you which players could currently shoot (or be shot) by you. These are the players who have an unobstructed view of your position.
输入解释
Input to this problem will begin with a line containing a single integer n indicating the number of cities in the input. Each city is made of 100 city blocks (10x10), each of which contains a skyscraper of an integer height from 0 to 9. A city is represented in the input as 10 lines of 10 integers, where the integers are the height values of the corresponding skyscrapers. This is followed by one line with four sets of coordinates. The first denotes your position; the other three denote the positions of players A, B, and C, respectively. Positions are given in the format (x, y, height), where x is measured from left to right on the input city grid, y is measured from top to bottom, height is measured from the ground up, and (0,0,0) is at the top left of the input city grid at ground level.

Note:
  • The coordinates of player positions may contain floating point numbers.
  • Neither you nor any of the other players will ever be inside a building or on one of its edges or sides. Your line of sight to another player will never be tangent to the side, edge, or corner of a building in such a way that it changes the outcome of the program.
输出解释
For each city in the input, output the header "Fragfest City #X" where X is 1 for the first city, 2 for the second, etc. Follow this line with one line for each of players A, B, and C and print either "Player Y is in sight" or "Player Y is hiding" depending on whether or not a building obstructs your view of that player.

Please make these two simplifying assumptions:

  1. A skyscraper is a rectangular solid with dimensions 1x1xheight;
  2. a player is the size and shape of a point;
  3. and a player does not block the view of another player.
输入样例
2
0000005000
0000005000
0000005000
0000005000
9999999999
0000000000
0000000000
0000000000
0000000000
0000000000
(0,0,0) (10, 10, 10) (5.5, 5.5, 5.5) (9, 1.0, 9)
0123456789
1000000000
2064646400
3045555600
4065005400
5045005600
6065555400
7046464600
8000000000
9123456789
(4.5, 4.5, 5.5) (7.5, 4.5, 5.5) (1.5, 4.5, 5.1) (7.5, 4.5, 6.5)

输出样例
Fragfest City #1
Player A is hiding
Player B is hiding
Player C is in sight
Fragfest City #2
Player A is in sight
Player B is hiding
Player C is in sight


该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 South Central USA 2005

源链接: POJ-2804

最后修改于 2020-10-29T06:44:47+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536