hdu 4617 Weapon(叉积)】的更多相关文章

链接: http://acm.hdu.edu.cn/showproblem.php?pid=4617 Weapon Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 224    Accepted Submission(s): 178 Problem Description Doctor D. are researching for a…
大一学弟表示刚学过高数,轻松无压力. 我等学长情何以堪= = 求空间无限延伸的两个圆柱体是否相交,其实就是叉积搞一搞 详细点就是求两圆心的向量在两直线(圆心所在的直线)叉积上的投影 代码略挫,看他的吧http://blog.csdn.net/liuledidai/article/details/9494363…
http://acm.hdu.edu.cn/showproblem.php?pid=4617 三维几何简单题 多谢高尚博学长留下的模板 代码: #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> using namespace std; typedef long long ll; typedef pair<…
Problem Description Doctor D. are researching for a horrific weapon. The muzzle of the weapon is a circle. When it fires, rays form a cylinder that runs through the circle verticality in both side. If one cylinder of rays touch another, there will be…
题意:给你一些无限长的圆柱,知道圆柱轴心直线(根据他给的三个点确定的平面求法向量即可)与半径,判断是否有圆柱相交.如果没有,输出柱面最小距离. 一共只有30个圆柱,直接暴力一下就行. 判相交/相切:空间直线距离是否小于等于两圆柱半径和若无相交,求最小:空间直线距离-两圆柱半径和 #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <c…
Weapon Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 22    Accepted Submission(s): 18 Problem Description Doctor D. are researching for a horrific weapon. The muzzle of the weapon is a circle.…
题目多读几次就明白了.主要是求异面直线的距离,然后用距离和两圆半径之和作比较. 空间直线的距离d=|AB*n| / |n| (AB表示异面直线任意2点的连线,n表示法向量,法向量为两条异面直线方向向量的叉积,|n|表示模. #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> using namespace st…
HDU 4611 Balls Rearrangement 令lcm=LCM(a,b),gcd=GCD(a,b).cal(n,a,b)表示sum(abs(i%a-i%b)),0<=i<n. 显然,答案就是cal(lcm,a,b)*(n/lcm)+cal(n%lcm,a,b). cal(n,a,b)可以通过暴力得到,即对i%a和i%b的值分段,连续的一段(遇到0终止)可以直接得到值. 因此,每段的长度将直接影响到时间复杂度. 当lcm较小时,cal中的n不会很大,即使每段长度很小也无所谓. 当lc…
爆头 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1447    Accepted Submission(s): 601 Problem Description gameboy是一个CS高手,他最喜欢的就是扮演警察,手持M4爆土匪的头.也许这里有人没玩过CS,有必要介绍一下“爆头”这个术语:所谓爆头,就是子弹直接命中对方的头部,以秒杀…
Herding Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1125    Accepted Submission(s): 325 Problem Description Little John is herding his father's cattles. As a lazy boy, he cannot tolerate cha…