杭电 3007 数学水题

『杭电1178』 Heritage from father Problem Description Famous Harry Potter,who seemd to be a normal and poor boy,is actually a wizard.Everything changed when he had his birthday of ten years old.A huge man called 'Hagrid' found Harry and lead him to a new world full of magic power. If you 阅读详情

    水题,只需求出最远距离的两个点即可。中点就是圆心,题目:

Buried memory

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1191    Accepted Submission(s): 626


Problem Description
Each person had do something foolish along with his or her growth.But,when he or she did this that time,they could not predict that this thing is a mistake and they will want this thing would rather not happened.
The world king Sconbin is not the exception.One day,Sconbin was sleeping,then swakened by one nightmare.It turned out that his love letters to Dufein were made public in his dream.These foolish letters might ruin his throne.Sconbin decided to destroy the letters by the military exercises's opportunity.The missile is the best weapon.Considered the execution of the missile,Sconbin chose to use one missile with the minimum destruction.
Sconbin had writen N letters to Dufein, she buried these letters on different places.Sconbin got the places by difficult,he wants to know where is the best place launch the missile,and the smallest radius of the burst area. Let's help Sconbin to get the award.
 

Input
There are many test cases.Each case consists of a positive integer N(N<500,^V^,our great king might be a considerate lover) on a line followed by N lines giving the coordinates of N letters.Each coordinates have two numbers,x coordinate and y coordinate.N=0 is the end of the input file.
 

Output
For each case,there should be a single line in the output,containing three numbers,the first and second are x and y coordinates of the missile to launch,the third is the smallest radius the missile need to destroy all N letters.All output numbers are rounded to the second digit after the decimal point.
 

Sample Input
3 1.00 1.00 2.00 2.00 3.00 3.00 0
 

Sample Output
2.00 2.00 1.41
 

acCODE:

#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
#define M 505
struct point{
  double x,y;
}pp[M];
int main(){
  int n;
  while(scanf("%d",&n),n){
    for(int i=1;i<=n;++i)
		scanf("%lf%lf",&pp[i].x,&pp[i].y);
	double mm=0,len,xs=0,ys=0,xe=0,ye=0;
	for(int i=1;i<=n;++i){
		for(int j=1;j<=n;++j){
		  if(i==j)
			  continue;
		  len=sqrt((pp[j].x-pp[i].x)*(pp[j].x-pp[i].x)+(pp[j].y-pp[i].y)*(pp[j].y-pp[i].y));
		  if(mm<len){
		    mm=len;
			xs=pp[i].x;ys=pp[i].y;xe=pp[j].x;ye=pp[j].y;
		  }
		}
	}
	printf("%.2lf %.2lf %.2lf\n",(xe+xs)/2,(ye+ys)/2,mm/2);
  }
  return 0;
}


RK3588交叉编译实战:从环境搭建到程序部署 本文详细介绍了在X86主机上为RK3588开发板搭建交叉编译环境的完整流程。从获取ARM工具链、配置sysroot,到实战编译Hello World和Qt应用程序,并提供了部署方法和常见问题解决方案。通过交叉编译,开发者可以在高性能PC上高效开发,并在ARM架构的RK3588上运行程序,大幅提升嵌入式开发效率。 阅读详情

相关推荐

ubuntu打实时内核补丁教程以及安装后显卡驱动问题解决方法

在ubuntu20.04上安装成功,亲测有效 目录ubuntu打实时内核补丁教程1、下载实时内核2、解压和打补丁(patch)3、安装依赖和编译安装4、修改一些文件,便于之后切换内核5、重启电脑实时内核版本下安装nvidia显卡驱动的问题1、先切换回之前的内核(非实时)版本2、重装之前内核(非实时)版本下的显卡驱动3、切换回实时内核(按照上面的步骤)4、在实时内核下安装显卡驱动 ubuntu打实时内核补丁教程 安装目标系统:ubuntu20.04 电脑配置:i9,2080ti 1、下载实时内核 打开终端,输

weixin_39275295的博客 8003

hdu3007(最小覆盖圆问题)

题目:Buried memory   最小圆覆盖,很经典的问题。 题目大概是,平面上n个点,求一个半径最小的圆,能够覆盖所有的点。   如果要求一个最小覆盖圆,这个圆至少要由三个点确定。有一种算法就是任意取三个点作圆,然后判断距离圆心最远的点是否在圆 内,若在,则完成;若不在则用最远点更新这个圆。这里不仔细介绍。   这里介绍的算法是,先任意选取两个点,以这两个点的连线为直径作圆。

ACdreamer 4041

交通流预测爬坑记(一):交通流数据集,原始数据

常用的交通流数据集,持续更新~~

K_first的博客 4万+

hdu3007(最小包围圆/最小覆盖圆)

这个。。初看这个题型竟然看成最小包围圈= =! 然后算法感觉比较奇怪。。叫什么随机增量法。。不过个人感觉是暴力枚举吧。。 由于3点确定一圆,所以枚举3个点,如果有点在圆外那么加入该点之后该点必定在覆盖圆上。。 然后据说这方法的时间复杂度的期望是O(n)。。。给窝感觉却不止o(n)。。证明看不懂。。 实际上貌似真的没那么快。。。500都跑60ms是闹哪样? 然后求圆心的方法

qkoqhh 1325

【七】Hadoop3.3.4基于ubuntu24的分布式集群安装

本次安装实验基于苹果m2芯片的mac系统,使用vmware fusion搭建三台ubuntu24分布式虚拟机,确保在三台机器上安装了Java jdk8,并配置了免密码登录,网络互通,防火墙关闭,授时服务器已经同步。访问apche官网源,下载3.3.4版本,我们用二进制通用版即可,因为hadoop运行在java环境,跨平台性使得无需编译arm架构版本。至此,Hadoop的安装完成,包括hdfs文件存储系统,mapreduce计算框架,yarn资源管理系统均能正常、稳定使用。

qq_31412425的博客 2167

36、基于启发式的双向RRT*路径规划算法解析

本文介绍了一种基于启发式的双向RRT*路径规划算法(LGHB-RRT*),通过地图预处理、通道区域提取和通道识别点定义,结合随机树的引导生长与可变密度采样机制,显著提升了在复杂通道环境下的搜索效率与成功率。算法采用双向扩展结构,并引入启发式生长策略引导树向通道关键点发展,同时利用路径优化简化最终路径。仿真结果表明,该算法在多种复杂地图中均能高效找到最优路径,优于传统RRT*和Bi-RRT*算法,具备良好的适应性与应用前景。

rgv234567的博客 125

HDU-3007 最小圆覆盖

Problem Description Each person had do something foolish along with his or her growth.But,when he or she did this that time,they could not predict that this thing is a mistake and they will want this ...

刷题记录 296

从 Junior 到 Lead:ABAP 开发者进阶路线图与真实项目练级法

本文拆解了ABAP工程师从初级到高级的成长路径,强调能力提升依赖于可复用经验的积累。对于初级开发者,建议夯实ABAP Dictionary、内表处理和数据库思维三大基础,培养数据流与规则层的结构化思维,并逐步掌握面向对象编程。中级阶段应注重代码可维护性,通过单元测试和Clean ABAP规范提升工程质量。文章指出,ABAP开发者需要学会筛选学习重点,建立知识地图,并重视团队协作中的代码可读性。关键在于将碎片知识整合为可迁移的模型,而非盲目追求新技术。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 184

HDU 3007 Buried memory 最小圆覆盖

题目大意:没看。反正就是求最小圆覆盖。 思路:一个神奇的算法——随机增量法。可以证明,这个算法可以在O(n)的时间复杂度内求出最小圆覆盖。虽然好像能卡掉的样子,但是加上一句random_shuffle就卡不掉了。 具体的过程是这样的: 在全局记录一个圆,表示目前的最小圆覆盖。从头开始扫描。遇到第一个不在当前最小圆覆盖内的点的时候: 将这个点与当前最小圆覆盖的圆心为直径做一个圆,作为

(╯°口°)╯(┴—┴ 1167

计算机视觉与深度学习 | 2024年至2025年图像匹配算法总结(原理,公式,代码,开源链接)

以上总结覆盖了当前主流和前沿技术,实际选择需结合具体场景(速度/精度/资源限制)评估。

尘世冰封的专栏 1603

工业-实时数据采集

在主节点使用Flume采集/data_log目录下实时日志文件中的数据,将数据存入到Kafka的Topic 中(Topic名称分别为ChangeRecord、ProduceRecord和EnvironmentData,分区数为4),Flume 采集ChangeRecord。

dafsq的博客 594

HDU 3007 Buried memory(点集最小圆覆盖 模拟退火解法)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3007 这题和ZOJ1450是一样的,不过这个题目我换个解法 ZOJ1450我是用标准求最小点集覆盖求圆的方法来做的,速度很快 对于这一题目,我用的是模拟退火思想,每次像正确结果逼近 不过精度一点也不好控制,还有step也一点也不好控制,这些值都不能随便 取,要取特定意义的值才行! 恶心的是

sunrain的专栏 1936

rk3568 点亮双LVDS 屏

承接文章《rk3568点亮LCD(lvds)》中仅仅只能使用亮单LVDS;经过厂商的努力,陆续发布新补丁。目前支持双lvds显示,缺憾是需要自己额外移植相关补丁。受限于通信频率和VOP编码能力,支持最大分辨仍然是1920x1080、60fps。

weixin_35723192的博客 3014

HDU 1395 /ZOJ 1489

2^x mod n = 1 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 9735    Accepted Submission(s): 3005 Problem Description Give a number

u012659423的专栏 1025

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

ACM相关资源

ACM相关资源 ACM经验吐血分享 :http://www.docin.com/p-110943363.html 1.常用OJ平台 ZOJ http://acm.zju.edu.cn/ 九度 http://ac.jobdu.com/ POJ http://poj.org/ 杭电 http://acm.hdu.edu.cn/ 2.POJ分类一 初期: 一.基

hedafighter2011的专栏 1289

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

算法学习之路

第一阶段:练经典常用算法,下面的每个算法给我打上十到二十遍,同时自己精简代码, 因为太常用,所以要练到写时不用想,10-15分钟内打完,甚至关掉显示器都可以把程序打 出来. 1.最短路(Floyd、Dijstra,BellmanFord) 2.最小生成树(先写个prim,kruscal要用并查集,不好写) 3.大数(高精度)加减乘除 4.二分查找. (代码可在五行以内)

Hayden‘s Blog 851

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

hdu 3007 Buried memory (最小圆覆盖)

问题: 最小圆覆盖指平面上有n个点,给定nge

记录走过的风风雨雨 1454

Buried memory 简单几何之最小圆覆盖问题

Each person had do something foolish along with his or her growth.But,when he or she did this that time,they could not predict that this thing is a mistake and they will want this thing would rather n

扬帆起航 498

Buried memory(HDU-3007)

Problem Description Each person had do something foolish along with his or her growth.But,when he or she did this that time,they could not predict that this thing is a mistake and they will want thi...

Alex_McAvoy的博客 750

hdu 3007 Buried memory (最小覆盖圆)

http://acm.hdu.edu.cn/showproblem.php?pid=3007   前几天认真看了一下最小圆覆盖的论文,对于随机点集,只需要按顺序插入。每次插入分两种情况,一种是点在当前的圆中,另一种是点在园外。在圆中可以直接不理,在圆外的就要枚举所有构成最小覆盖圆的可能了。当发现点在圆外的时候,这个点必定是当前要找到的最小圆经过的点之一,于是就可以枚举出两个点和三个点的情况。看上...

weixin_34289744的博客 148

HDU3007(最小圆覆盖问题)

题意:给定n个点,用一个最小的圆把这些点全部覆盖,求这个最下覆盖圆的圆心及半径 #include<iostream> #include<algorithm> #include<cmath> #include<cstring> #include<cstdio> using namespace std; const int maxx=1005; const int inf=0x3f3f3f3f; struct node{ double x,y; }

Keep_Trying_Go的博客 584

hdu 3007(模拟退火算法)

Problem Description Each person had do something foolish along with his or her growth.But,when he or she did this that time,they could not predict that this thing is a mistake and they will want this thing would rather not happened. The world king Sconbin

Aaron_Yang 1043

[HDU3007]Buried memory(最小圆覆盖)

题目描述传送门题解三个点能确定一个圆,答案一定为某一个三角形的外接圆 有一种非常神奇的复杂度为O(n)O(n)的随机增量法解决这个问题 算法流程 - 先对点集random_shuffle处理一下 - 假设已经有了前i-1个点的最小圆覆盖Ci−1C_{i-1},检验点pip_i是否在Ci−1C_{i-1}内,如果在,则Ci=Ci−1C_i=C_{i-1},否则,pip_i一定在圆CiC_i

zyf2000 981

Buried memory HDU - 3007 最小覆盖圆算法&&模板

Each person had do something foolish along with his or her growth.But,when he or she did this that time,they could not predict that this thing is a mistake and they will want this thing would rather n...

W349652743的博客 285

[hdu3007]Buried memory(最小圆覆盖)--计算几何

题目描述 Each person had do something foolish along with his or her growth.But,when he or she did this that time,they could not predict that this thing is a mistake and they will want this thing would ra...

dark_dawn的博客 347

最小圆覆盖 hdu 3007

今天学习了一下最小圆覆盖, 看了一下午都没看懂, 晚上慢慢的摸索这代码,接合着别人的讲解, 画着图跟着代码一步一步的走着,竟然有些理解了. 最小圆覆盖: 给定n个点, 求出半径最小的圆可以把这些点全部包围, 可以在圆的边界上 下面是我的个人理解. 如果不对, 还请路过大牛指出 先找一个点, 让圆心等于这个点的坐标, 半径等于0, 显然这个对的, 接着找下一个点, 如果只有两个点...

dizhuo0219的博客 210
上一篇: 杭电 1505 动态规划
下一篇: 杭电 2857 计算几何
wmn_wmn
博客等级 码龄15年 301粉丝 413原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值