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.…
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…
链接: 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…
题意:给你一些无限长的圆柱,知道圆柱轴心直线(根据他给的三个点确定的平面求法向量即可)与半径,判断是否有圆柱相交.如果没有,输出柱面最小距离. 一共只有30个圆柱,直接暴力一下就行. 判相交/相切:空间直线距离是否小于等于两圆柱半径和若无相交,求最小:空间直线距离-两圆柱半径和 #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <c…
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<…
6373.Pinball 物理受力分析题目. 画的有点丑,通过受力分析,先求出θ角,为arctan(b/a),就是atan(b/a),然后将重力加速度分解为垂直斜面的和平行斜面的,垂直斜面的记为a1,平行斜面的记为a2. a1=g*sinθ,a2=g*cosθ,然后算出小球到斜面的侧面高度h,以及小球到斜面底部的距离l,小球走h米高度所花费的时间t2为弹一次花费的时间,然后通过ll花费的时间t1为总时间,直接算倍数就是答案. 具体的代码注释. 代码: //1012-6373-几何-物理题目 #i…
大一学弟表示刚学过高数,轻松无压力. 我等学长情何以堪= = 求空间无限延伸的两个圆柱体是否相交,其实就是叉积搞一搞 详细点就是求两圆心的向量在两直线(圆心所在的直线)叉积上的投影 代码略挫,看他的吧http://blog.csdn.net/liuledidai/article/details/9494363…
HDU 5234 题目大意:给定n,m,k,以及n*m(n行m列)个数,k为背包容量,从(1,1)开始只能往下走或往右走,求到达(m,n)时能获得的最大价值 解题思路:dp[i][j][k]表示在位置(i,j)有一个容量为k的背包所能获得的最大价值 决策:a[i][j]处的数是否选取 不选取: dp[i][j][k]= max(dp[i-1][j][k], dp[i][j-1][k]) 选取:首先要求k >=a[i][j],那么dp[i][j][k] = max(dp[i-1][j][k-w[i…
HDU 2085 核反应堆 /* HDU 2085 核反应堆 --- 简单递推 */ #include <cstdio> ; long long a[N], b[N]; //a表示高能质点数目,b表示低能质点数目 int main() { #ifdef _LOCAL freopen("D:\\input.txt", "r", stdin); #endif //质点数目初始化 a[] = ;b[] = ; ; i <= ; ++i){ a[i] =…
Least Common Multiple (HDU - 1019) [简单数论][LCM][欧几里得辗转相除法] 标签: 入门讲座题解 数论 题目描述 The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For example, the LCM of 5, 7…
七夕节 (HDU - 1215) [简单数论][找因数] 标签: 入门讲座题解 数论 题目描述 七夕节那天,月老来到数字王国,他在城门上贴了一张告示,并且和数字王国的人们说:"你们想知道你们的另一半是谁吗?那就按照告示上的方法去找吧!" 人们纷纷来到告示前,都想知道谁才是自己的另一半.告示如下: 数字N的因子就是所有比N小又能被N整除的所有正整数,如12的因子有1,2,3,4,6. 你想知道你的另一半吗? Input 输入数据的第一行是一个数字T(1<=T<=500000)…
空间异面直线的距离直接套模板. 求交点:求出两条直线的公共法向量,其中一条直线与法向量构成的平面 与 另一条直线 的交点即可.还是套模板o(╯□╰)o 1.不会有两条线平行的情况. 2.两条直线可能相交 #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <cmath> using namespace std; ; ; stru…
奇葩!这么简单的广搜居然爆内存了,而且一直爆,一直爆,Orz 而且我也优化过了的啊,尼玛还是一直爆! 先把代码贴上睡觉去了,明天再来弄 //#define LOCAL #include <iostream> #include <cstdio> #include <cstring> #include <queue> #include <cmath> using namespace std; struct Point { int x, y, z; i…
转载学习: #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <cmath> using namespace std; ; ; struct Point3 //空间点 { double x, y, z; Point3( , , ): x(x), y(y), z(z) { } Point3( const Point3&…
Save Labman No.004 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1473    Accepted Submission(s): 484 Problem Description Due to the preeminent research conducted by Dr. Kyouma, human beings ha…
给出一个三维的迷宫以及起点和终点,求能否到大终点,若果能输出最短步数 三维的问题无非就是变成了6个搜索方向 最后强调一下xyz的顺序,从输入数据来看,读入的顺序是map[z][x][y] 总之,这是很基础的一道题 //#define LOCAL #include <iostream> #include <cstdio> #include <cstring> #include <queue> #include <algorithm> using n…
Catching Fish Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 1113    Accepted Submission(s): 411 Problem Description Ignatius likes catching fish very much. He has a fishnet whose shape is a…
今天比赛的时候略坑, admin告诉我询问Q的个数不超过n^2, 赛后敲了个 O(Q*m^3)的复杂度,但这个复杂度常数比较低,可能在除以个小常数, 300ms过了,真心无语,数据应该水了吧,比赛的时候已经想到了,但怕超时没敢敲. 这次的题解好坑, 说什么是要用什么图做,真心蛋疼,搞得这么高端干什么,看懂了它的思路,代码写起来不好写,至少我是这样的. 我的做法: 先预处理出每两个station之间的中垂线. 对于每个询问,判断每条中垂线与询问的两城市之间的连线是否相交(设交点P). 当然相交也不…
pid=1253">胜利大逃亡 Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 24937    Accepted Submission(s): 9535 Problem Description Ignatius被魔王抓走了,有一天魔王出差去了,这但是Ignatius逃亡的好机会. 魔王住在一个城堡里,城堡是一个A*B*C的立方体…
题目链接:HDU - 5206 Young F found a secret record which inherited from ancient times in ancestral home by accident, which named "Four Inages Strategy". He couldn't restrain inner exciting, open the record, and read it carefully. " Place four ma…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3584 Cube Problem Description Given an N*N*N cube A, whose elements are either 0 or 1. A[i, j, k] means the number in the i-th row , j-th column and k-th layer. Initially we have A[i, j, k] = 0 (1 <= i, …
Higher Math Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2219    Accepted Submission(s): 1219 Problem Description You are building a house. You’d prefer if all the walls have a precise right…
Asteroids! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3159    Accepted Submission(s): 2106 Problem Description You're in space.You want to get home.There are asteroids.You don't want to hit…
Hyperspace Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 1023    Accepted Submission(s): 492 Problem Description The great Mr.Smith has invented a hyperspace particle generator. The device i…
题目 之前比赛的一个题, 当时是崔老师做的,今天我自己做了一下.... 还要注意用bfs的时候  有时候并不是最先到达的就是答案,比如HDU 3442 这道题是要求最小的消耗血量伤害,但是并不是最先到达目标点的路径 就是最小的伤害,因为每一个点的伤害是 不一样的, 这种情况要用优先队列优化, 对伤害优化. 题意:*开始, X出口, b, y, r, g 代表钥匙,分别可以开B, Y, R, G颜色的门, 钥匙可以多次使用.问最短的步骤. 思路:vis[][][]数组开三维,第三维记录状态 是否拿…
Special Tetrahedron 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5839 Description Given n points which are in three-dimensional space(without repetition). Please find out how many distinct Special Tetrahedron among them. A tetrahedron is called Sp…
胜利大逃亡 Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 21759    Accepted Submission(s): 8538 Problem Description Ignatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会.魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩…
吐个糟,尼玛今天被虐成狗了,一题都没搞出来,这题搞了N久居然还是搞不出来,一直TLE,最后还是参考别人代码才领悟的,思路就这么简单, 就是不会转弯,看着模板却不会改,艹,真怀疑自己是不是个笨蛋题意:求n维空间的最远哈曼顿距离.给出n和k,下面n个操作,0表示添加一个k维空间的点,然后给出该点坐标,1 x表示删除第x个操作给出的点 ,对于每个操作都输出最远哈曼顿距离,n<=60000,k<=5.分析:最远曼哈顿距离的模板是直接求D维空间n个点的,复杂度是O(n*2^D),而该题要求每次加一个点就…
题目多读几次就明白了.主要是求异面直线的距离,然后用距离和两圆半径之和作比较. 空间直线的距离d=|AB*n| / |n| (AB表示异面直线任意2点的连线,n表示法向量,法向量为两条异面直线方向向量的叉积,|n|表示模. #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> using namespace st…
CCPC网赛第八题,求立体几何数量,题解见注释 //立体几何-求满足要求的四面体个数 //要求1:至少4条边相等 //要求2:四条边相等时,另两条边一定不相邻(即对边) //题解:以当前边为不相邻的其中一条边,对可以构成等腰三角形的第三点进行枚举 //再对这些第三点的集合做一次n^2的枚举,分两种情况找出四面体 //如果四条边或五条边相同,则只存在两种重复情况(当前边和对边互换) //如果六条边相同,则存在六种重复情况(每个边作一次当前边) //Time:499Ms Memory:1576K #…