题目链接 题目大意 给你n(n<=100)个点,要你找一个点使得和所有点距离的最大值最小值ans 题目思路 一直在想二分答案,但是不会check 这个时候就要换一下思想 三分套三分套三分坐标即可 复杂度\(O(n(log_n)^3)\) 代码 #include<set> #include<map> #include<queue> #include<stack> #include<cmath> #include<cstdio> #…
n个点求出最小圆覆盖所有点 退火算法不会,不过这题可以用三分套三分写 x轴y轴z轴各三分 #include <cstdio> #include <cstring> #include <queue> #include <cmath> #include <algorithm> #include <set> #include <iostream> #include <map> #include <stack&g…
2018ACM-ICPC南京现场赛D题-Country Meow Problem D. Country Meow Input file: standard input Output file: standard output In the 24th century, there is a country somewhere in the universe, namely Country Meow. Due to advanced technology, people can easily tra…
// 2019.10.3 // 练习题:2018 ICPC 南京现场赛 D Country Meow 题目大意 给定空间内 N 个点,求某个点到 N 个点的距离最大值的最小值.   思路 非常裸的最小球覆盖问题啊,即找到半径最小的球包含全部的点. 在最小圆覆盖问题上,可以使用随机增量法,这里没有四点确定球心的公式,所以板子失效了. 最小圆覆盖可以用三分套三分,这里空间有三维,假装证明得到在任意一维上都满足凸函数特性,那么再套一层维度三分就OK了.   AC代码 三分套三分套三分写法,复杂度O(n…
Country Meow 和这基本一样 https://www.cnblogs.com/Fighting-sh/p/9809518.html #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<string> #include<algorithm> #include<queue> #include<vector&…
题意:Q次操作,三维空间内 每个星星对应一个坐标,查询以(x1,y1,z1) (x2,y2,z2)为左下顶点 .右上顶点的立方体内的星星的个数. 注意Q的范围为50000,显然离散化之后用三维BIT会MLE. 我们可以用一次CDQ把三维变成二维,变成二维之后就有很多做法了,树套树,不会树套树的话还可以继续CDQ由二维变成一维,,变成一维了就好做了,,最基本的数据结构题目了.. 不得不说.CDQ真的很神奇. 下面做法就是CDQ套CDQ套树状数组. #include <cstdio> #inclu…
layout: post cid: 19 title: cdn套中套 slug: 19 date: 2022/08/25 20:32:00 updated: 2022/08/26 11:20:20 status: waiting author: admin categories: 默认分类 tags: postDesc: postFile: postKeywords: postShowImg: postShuoBvid: postShuoMP: netease postShuoMT: playl…
题意: 给\(n\)个三维点,问最小覆盖球的半径. 思路: 模拟退火. 代码: #include<set> #include<map> #include<cmath> #include<queue> #include<bitset> #include<string> #include<cstdio> #include<vector> #include<cstring> #include <io…
#1142 : 三分·三分求极值 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 这一次我们就简单一点了,题目在此: 在直角坐标系中有一条抛物线y=ax^2+bx+c和一个点P(x,y),求点P到抛物线的最短距离d. 提示:三分法 输入 第1行:5个整数a,b,c,x,y.前三个数构成抛物线的参数,后两个数x,y表示P点坐标.-200≤a,b,c,x,y≤200 输出 第1行:1个实数d,保留3位小数(四舍五入) 样例输入 2 8 2 -2 6 样例输出 2.437…
题目: 题意:三维里有n个点,找一个最小的球将所有点覆盖. 题解:退火法模拟的一道板子题. 1 #include <stdio.h> 2 #include <iostream> 3 #include <math.h> 4 using namespace std; 5 const int MAXN=105; 6 const double EPS=1e-8; 7 struct Point{ 8 double x,y,z; 9 Point(double _x=0,double…