POJ 2177 Ghost Busters(三维几何)】的更多相关文章

Description The famous Ghost Busters team has decided to upgrade their Ectomobile (aka Ecto-1) with a powerful proton gun and an advanced targeting system. Egon has designed and built all the hardware which consists of ectoplasmic scanner and a proto…
POJ 2251 题目大意: 给出一三维空间的地牢,要求求出由字符'S'到字符'E'的最短路径,移动方向可以是上,下,左,右,前,后,六个方向,每移动一次就耗费一分钟,要求输出最快的走出时间.不同L层的地图,相同RC坐标处是相连通的.(.可走,#为墙) 解题思路:从起点开始分别往6个方向进行BFS(即入队),并记录步数,直至队为空.若一直找不到,则困住. /* POJ 2251 Dungeon Master --- 三维BFS(用BFS求最短路) */ #include <cstdio> #i…
Special Tetrahedron Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 328    Accepted Submission(s): 130 Problem Description Given n points which are in three-dimensional space(without repetition)…
题目链接:http://poj.org/problem?id=2251 Dungeon Master Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 51402   Accepted: 19261 Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit…
/* 最小生成树 + 几何判断 Kruskal 球心之间的距离 - 两个球的半径 < 0 则说明是覆盖的!此时的距离按照0计算 */ #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; ]; struct ball{ double x, y, z, r; }; struct…
题目:http://poj.org/problem?id=1185 思路: d[i][j][k]表示第i行的状态为第k个状态,第i-1行的状态为第j个状态的时候 的炮的数量. 1表示放大炮, 地形状态中1表示山地. #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> using namespace std;…
题目: http://poj.org/problem?id=2251 #include <stdio.h> #include <string.h> #include <queue> using namespace std; ][][]; ][][]; ][] = {{,,}, {,,}, {,,}, {,,-}, {,-,}, {-,,}}; struct Point { int x, y, z, step; }; struct Point start; queue&l…
Pick-up sticks Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 13377   Accepted: 5039 Description Stan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to fin…
题意: 给n条线段,问有没有一条直线,是每条线段到这条直线上的投影有一个公共点. 解法: 有公共点说明有一条这条直线的垂线过所有线段,要找一条直线过所有线段,等价于从所有线段中任选两端点形成的直线存在可以穿过所有的线段的直线(可将A平移至一条线段端点,然后绕这点旋转,使A过另一条线段端点),然后O(n^2)的枚举找任意两个线段的两个端点,还要找自己这条线段的两个端点,形成一条直线 代码: #include <iostream> #include <cstdio> #include…
2318 TOYS 2398 Toy Storage 题意 : 给你n块板的坐标,m个玩具的具体坐标,2318中板是有序的,而2398无序需要自己排序,2318要求输出的是每个区间内的玩具数,而2318要求输出的是有 i 个玩具的区间有几个. 思路 : 两个题基本差不多,只不过2398排一下序,然后再找个数组标记一下就行. 这个题我一开始没想到用二分,判断了点在四边形内但是没写下去,然后看了网上的二分区间,利用叉积判断点在左边还是右边. 2318代码: #include <stdio.h> #…