
几何问题
文章平均质量分 65
nka_kun
ACMer
展开
-
CCPC秦皇岛 ZOJ3993 Safest Buildings(半径比较/圆的相交面积)
PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others while avoiding getting killed themselves. BaoBao is a big fan of the game, but this原创 2017-11-01 18:08:13 · 1368 阅读 · 0 评论 -
HDU - 4311 Meeting point-1(最小曼哈顿距离和)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4311题意:选中一个点,使其他点到这个点的曼哈顿距离之和最小.思路:加入我们选中一个点(x,y),那么其他点到这个点的曼哈顿距离之和为|x-x1|+|x-x2|+···+|x-xn| + |y-y1|+|y-y2|+···+|y-yn|我们发现其实就是x被用了很多次,然后对其他x求和,y同理....原创 2018-10-21 10:22:57 · 2407 阅读 · 0 评论 -
POJ-2926 Requirements(最远曼哈顿距离)
**题目:http://poj.org/problem?id=2926题意:求五维空间最远曼哈顿距离.思路:曼哈顿距离:dis = |x1-x2|+|y1-y2|切比雪夫距离:dis = max(|x1-x2|,|y1-y2|)求曼哈顿距离若去掉绝对值,即在以下4项中选择最大值.(x1-x2)+(y1-y2)(-x1+x2)+(y1-y2)(x1-x2)+(-y1+y2)(-x1+...原创 2018-10-21 10:09:39 · 328 阅读 · 0 评论 -
Garden Gathering Gym - 100792G(求距离最远的两个点)
题目链接:http://codeforces.com/gym/100792/problem/G题意:给出n个坐标整数点,求出距离最远的两个点.两点之间的路径为只能走整数点.思路:显然两点之间的路径为sqrt(2)*min(|x1-x2|,|y1-y2|)+max(|x1-x2|,|y1-y2|)-min(|x1-x2|,|y1-y2|) =(sqrt(2)-1)*min(|x1-x2|...原创 2018-10-22 16:40:25 · 572 阅读 · 0 评论 -
HDU-6325 Interstellar Travel(几何...上凸包)
Interstellar Travel Time Limit: 4000/2000 MS (Java/Other...原创 2018-08-01 09:57:44 · 288 阅读 · 0 评论 -
POJ2653 Pick-up sticks(线段相交,暴力?)
Pick-up sticksTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 14261 Accepted: 5398DescriptionStan has n sticks of various length. He throws them one at a time on the floor in a random way. A...原创 2018-03-01 15:42:05 · 195 阅读 · 0 评论 -
判断线段是否相交(快速排斥实验和跨立实验)
首先声明几点定义:矢量 如果一条线段的端点是有次序之分的话,那么这种线段就称为 有向线段,如果有向线段p1p2的起点p1在坐标的原点,则可以把它称为矢量 p2矢量的加减 设二维矢量 P = (x1, y1), Q = (x2, y2),则 P + Q = (x1 + x2, y1 + y2), P - Q = (x1 - x2, y1 - y2),且有 P + Q = Q + ...原创 2018-03-01 15:31:45 · 1255 阅读 · 0 评论 -
poj3304 Segments (线段与直线之间的关系)
SegmentsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 16366 Accepted: 5160DescriptionGiven n segments in the two dimensional space, write a program, which determines if there exists a line...原创 2018-02-26 20:09:46 · 193 阅读 · 0 评论 -
判断是否所有直线交于一点
t,样例个数n,直线条数p,交点代码://此程序可以判断是否所有直线交于一点 #include<cstdio>#include<iostream>#include<algorithm>#include<queue>#include<stack>#include<cstring>#include<string...原创 2018-02-26 19:22:21 · 301 阅读 · 0 评论 -
POJ - 2318 TOYS(点与线的位置关系)
TOYSTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 17182 Accepted: 8195DescriptionCalculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - t...原创 2018-02-26 14:22:15 · 293 阅读 · 0 评论 -
HDU - 4312 Meeting point-2(最小切比雪夫距离和)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4312题意:选中一个点,使其他点到这个点的切比雪夫距离之和最小.思路:将一个点(x,y)的坐标变为(x+y,x−y)后,原坐标系中的曼哈顿距离 = 新坐标系中的切比雪夫距离将一个点(x,y)的坐标变为((x+y)/2,(x−y)/2) 后,原坐标系中的切比雪夫距离 = 新坐标系中的曼哈顿距离参...原创 2018-10-21 10:30:40 · 430 阅读 · 0 评论