18 南京 D

裸的最小球覆盖。

坐标范围大一些所以我们把初始的温度也设置的大一些。

 

 1 #include <bits/stdc++.h>
 2 using namespace std;
 3 typedef long long ll;
 4 typedef double db;
 5 const db INF = 1e100;
 6 const db delta = 0.98;
 7 const db eps = 1e-8;
 8 struct p3{
 9     db x,y,z;
10     p3 operator +(const  p3&k1)const { return p3{x+k1.x,y+k1.y,z+k1.z};}
11     p3 operator -(const p3&k1)const { return p3{x-k1.x,y-k1.y,z-k1.z};}
12     p3 operator *(const db k1)const { return p3{x*k1,y*k1,z*k1};}
13     p3 operator /(const db k1)const { return p3{x/k1,y/k1,z/k1};}
14     db abs(){ return sqrt(x*x+y*y+z*z);}
15     db dis(p3 k1){ return (*this-k1).abs();}
16 };
17 int n;
18 p3 p[105];
19 int main(){
20     scanf("%d",&n);
21     for(int i=1;i<=n;i++){
22         scanf("%lf%lf%lf",&p[i].x,&p[i].y,&p[i].z);
23     }
24     db T = 100000;
25     db ans = INF;
26     p3 x = {0,0,0};
27     while (T>eps){
28         db mx =0;int id=-1;
29         for(int i=1;i<=n;i++){
30             if((p[i]-x).abs()>mx){
31                 mx=(p[i]-x).abs();
32                 id=i;
33             }
34         }
35         ans = min(ans,mx);
36         x=x+(p[id]-x)/mx*T;
37         T*=delta;
38     }
39     printf("%.11f\n",ans);
40 }
View Code

 

转载于:https://www.cnblogs.com/MXang/p/10550957.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/278159.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何在iPhone或iPad的控制中心中控制智能家居设备

Apple’s Home app offers quick controls for controlling smart lights, doorbells, thermostats, and other smart home devices—right in your iPhone or iPad’s Control Center. Here’s how to set it up and use it. Apple的Home应用程序可在iPhone或iPad的控制中心内…

亚信安全与安徽电信共创“云网融合”安全新局面

全面提升公共安全能力 联合推“天翼U盾”保障移动政务安全 在近日举办的安徽“互联网”产业合作峰会上&#xff0c;亚信安全宣布与中国电信安徽公司达成战略合作&#xff0c;双方将在“云网融合”的生态基础上打造特色安全服务、促进政企协同安全监管、共创网络安全平安城市等…

idea中开启Run Dashboard

若没有 下一步 ok 转载于:https://www.cnblogs.com/aijiajia1314/p/10551007.html

电台复活节_如何玩Android 11的隐藏复活节彩蛋游戏

电台复活节Justin Duino贾斯汀杜伊诺(Justin Duino)Google includes a hidden “Easter Egg” with each new Android version. Android 11 has one of the more elaborate Easter Eggs as it’s actually a game you can play. We’ll show you how to find it and play. Goog…

如何在Instagram上过滤冒犯性评论

Shubham AgarwalShubham AgarwalIf you have a public Instagram profile, chances are you’ve been a victim of inappropriate comments from strangers. Given the social network’s vast size, it’s practically impossible to escape such bad actors. Thankfully, Ins…

复杂性思维中文第二版 附录 A、算法分析

附录 A、算法分析 原文&#xff1a;Appendix A Analysis of algorithms 译者&#xff1a;飞龙 协议&#xff1a;CC BY-NC-SA 4.0 自豪地采用谷歌翻译 部分参考了《Think Python 2e 中译本 第二十一章&#xff1a;算法分析》 算法分析 (Analysis of algorithms) 是计算机科学的一…

如何在Windows 8.1中获取Windows 10样式的开始菜单

On January 21, Microsoft officially announced the new features that would be included in Windows 10. While you’ll have to wait for the release to enjoy most of the new features, you can take advantage of the new Windows 10 Start menu today. 1月21日&#x…

ubuntu列出所有磁盘_列出Ubuntu上的磁盘空间使用情况

ubuntu列出所有磁盘Simply open a new Terminal window and type in this command 只需打开一个新的终端窗口并输入此命令 df -Th f翻译自: https://www.howtogeek.com/howto/ubuntu/list-disk-space-usage-on-ubuntu/ubuntu列出所有磁盘

python基础之字符编码

阅读目录 一 了解字符编码的知识储备二 字符编码介绍三 字符编码应用之文件编辑器3.1 文本编辑器之nodpad3.2 文本编辑器之pycharm3.3 文本编辑器之python解释器3.4 总结四 字符编码应用之python4.1 执行python程序的三个阶段4.2 python2与python3字符串类型的区别一 了解字符编…

C# WinForm开发系列 - DataGridView

1.DataGridView实现课程表 testcontrol.rar 2.DataGridView二维表头及单元格合并 DataGridView单元格合并和二维表头.rar myMultiColHeaderDgv.rar 3.DataGridView单元格显示GIF图片 gifanimationindatagrid.rar 4.自定义显示DataGridView列(行头显示行号与图标,同一单元格显示…

ruby语法_Ruby函数(方法)语法

ruby语法The Ruby language makes it easy to create functions. Ruby语言使创建函数变得容易。 Function Syntax 功能语法 def functionname(variable) return <value>end def functionname(variable)return <值>结束Examples 例子 Your function can compute …

pageadmin CMS网站建设教程:站点添加自定义字段

首先看看pagedmin默认的站点设置都有什么&#xff0c;如下图&#xff1a; 这里只有一些最基本的参数设置&#xff0c;用过3.0版本或用过其他公司开发的cms的用户应该有这种体验&#xff0c;在站点设置中可以设置logo图片&#xff0c;备案号&#xff0c;底部内容等等。 那么为什…

如何将世界时钟和时区小部件添加到您的iPhone

When you work remotely or have friends and family who live in another country, it’s important to know what time it is across time zones. A world clock (or time zone) widget on your iPhone’s Home screen makes this much easier. 当您远程工作或有家人和朋友居…

小程序视频截gif_3个简单的应用程序,可让您深入视频和GIF

小程序视频截gifDeepfakes make it possible to manipulate videos and GIFs. The technology has become so easy to use, you can now create deepfakes right on your phone. That’s right—you can now easily insert yourself into a meme. 借助Deepfake &#xff0c;可以…

【AtCoder】ARC095 E - Symmetric Grid 模拟

【题目】E - Symmetric Grid 【题意】给定n*m的小写字母矩阵&#xff0c;求是否能通过若干行互换和列互换使得矩阵中心对称。n,m<12。 【算法】模拟 【题解】首先行列操作独立&#xff0c;如果已确定行操作&#xff0c;那么两个在对称位置的列要满足条件必须其中一列反转后和…

如何使用Google TV设置Chromecast

Justin Duino贾斯汀杜伊诺(Justin Duino)Google changed up its streaming platform with the release of the Chromecast with Google TV. Instead of being a Cast-only device like Chromecasts before it, Google’s latest dongle runs the successor of Android TV. If y…

scala 方法、函数定义小结

2019独角兽企业重金招聘Python工程师标准>>> package scalapackage.testmethod/*** Created by Germmy on 2018/4/15.*/ object TesMethod {def main(args: Array[String]) {//定义方法的一种方法,高阶函数的一种定义方法def m1(x:Int)(y:Int)x*yval resm1(3)(4)pri…

ipad和iphone切图_如何在iPhone和iPad上密码保护照片

ipad和iphone切图Sometimes, you need to protect your iPhone or iPad photos from prying eyes that might also have access to your device. Unfortunately, Apple doesn’t provide an obvious, secure way to do this. However, there’s a work-around thanks to the No…

Java高级篇(二)——网络通信

网络编程是每个开发人员工具箱中的核心部分&#xff0c;我们在学习了诸多Java的知识后&#xff0c;也将步入几个大的方向&#xff0c;Java网络编程就是其中之一。 如今强调网络的程序不比涉及网络的更多。除了经典的应用程序&#xff0c;如电子邮件、Web浏览器和远程登陆外&…

Jerry和您聊聊Chrome开发者工具

2019独角兽企业重金招聘Python工程师标准>>> Chrome开发者工具是Jerry日常工作使用的三大调试器之一。虽然工具名称前面带了个"开发者", 但是它对非开发人员仍然有用。不信&#xff1f; 用Chrome打开我们常用的网站&#xff0c;按F12&#xff0c;在Consol…