编程介的小学生 2019-12-30 17:56 采纳率: 20.5%
浏览 59

Heroes Arrangement 的程序设计

Problem Description
There are N heroes in the Kingdom of Heroes, each hero has a special range of activity, this “range” is a delta-shaped region (triangle region including the boundary; it is guaranteed that all triangles will neither degenerate into a segment nor a point on the King’s angle of view), and heroes can appear in any point in his activity range. The king, standing at the Origin (0, 0, 0), is observing the heroes. No range of activity will contain the king’s position.

You may assume that no hero could meet others, that means these “range” have no common point. Your task is to find number K, indicating that the king can choose at most K heroes such that no pairs of chosen heroes cause one may block the king’s view line to observe another. In other words, no hero can appear on the segment between another hero and the King.

Input
There are multiple test cases, the number of them, T, is given in the very first line of the input, followed by T cases.

For each test case:
First line contains an integer N, the number of heroes, 1≤N≤40. Then N lines follow, each line contains nine integers x1 y1 z1 x2 y2 z2 x3 y3 z3, denoting the coordinates of the delta-shaped regions’ vertex respectively, -100≤x1, y1, z1, x2, y2, z2, x3, y3, z3≤100.

Output
Output a single line with a number K with case number, the maximum number of heroes that king can choose.

Sample Input
2
2
0 0 1 1 2 1 -1 2 1
0 0 2 1 -2 2 -1 -2 2
2
0 0 1 1 2 1 -1 2 1
0 0 -1 1 -2 -1 -1 -2 -1

Sample Output
Case #1: 1
Case #2: 2

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
    • ¥15 关于#hadoop#的问题
    • ¥15 (标签-Python|关键词-socket)