当前位置: 首页 > news >正文

百度网站的主要盈利来源不包括做兼职网上哪个网站好

百度网站的主要盈利来源不包括,做兼职网上哪个网站好,大气好寓意的广告公司名字,建立企业网站 优帮云Description 平面上有n个点#xff0c;每个点有各自的速度向量#xff0c;现在给出0时刻#xff0c;在同一时刻#xff0c;平面点的最远距离叫做special dis 他们每个点的位置和每个点的速度向量#xff0c;现在求在哪个时刻的时候#xff0c;他们的special dis 最小每个点有各自的速度向量现在给出0时刻在同一时刻平面点的最远距离叫做special dis 他们每个点的位置和每个点的速度向量现在求在哪个时刻的时候他们的special dis 最小并输出这个距离。 Input 输入一个正整数T(T10),表示有T组数据每组数据包括一个n(n10000),表示有n个点每行包括每个点的坐标 (x,y) (-100000x,y100000)速度向量 (vx,vy) (-1000vx,vy1000) Output 输出在哪个时刻的时候,special dis距离最小保留两位小数 Sample Input 2 2 0 0 1 0 2 0 -1 0 4 27 27 0 2 58 88 -8 -1 -22 7 1 -1 -38 -26 5 9 Sample Output 1.00 0.00 8.89 81.00 思路 求最大值中最小值首先想到二分 但发现dis不一定随时间增大而增大 事实上两点间距离要么直接增加要么先减少再增加。 所以dis也是要么直接增加要么先减少再增加。 这是一个单峰的变化。 用到三分 其次对于每个时间点我们可以知道每个点坐标。 多对点的最远距离一定是在凸包上取得的证明可以搜搜 找到凸包之后用旋转卡壳求取一个时间点的最远距离 代码 #define _CRT_SECURE_NO_WARNINGS #includeiostream #includecstdio #includecstdlib #includestring #includecstring #includecmath #includectime #includealgorithm #includeutility #includestack #includequeue #includevector #includeset #includemath.h #includemap using namespace std; typedef long long LL; typedef unsigned long long ull; #define per(i,a,b) for(int ia;ib;i) #define ber(i,a,b) for(int ia;ib;i--) const int N 1e4 5; const LL mod 10000000033; double eps 1e-8; int top 0, n; struct Point {     double x;     double y;     double vx;     double vy; }p[N], tmp[N], s[N]; bool cmp(struct Point a, struct Point  b) {     if (a.x ! b.x)         return a.x b.x;     return a.y b.y; } void  into(double t) {     per(i, 1, n)     {         tmp[i].x p[i].x p[i].vx * t;         tmp[i].y p[i].y p[i].vy * t;     }     sort(tmp 1, tmp 1 n, cmp); } double cross(struct Point a, struct Point b, struct Point c) {     return (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x); } void Andro(double t) {     top -1;     into(t);     per(i, 1, n)     {         while (top 0 cross(s[top - 1], s[top], tmp[i]) 0) top--;         s[top] tmp[i];     }     int tt top;     ber(i, n - 1, 1)     {         while (top tt cross(s[top - 1], s[top], tmp[i]) 0)  top--;         s[top] tmp[i];     } } double dis(struct Point a, struct Point b) {     return sqrt((a.x - b.x) * (a.x - b.x) (a.y - b.y) * (a.y - b.y)); } double f(double t) {     Andro(t);     if (top 2)         return dis(s[0], s[1]);     double ans 0;     for (int i 0, j 2; i top; i)     {         while (abs(cross(s[i], s[i 1], s[j])) abs(cross(s[i], s[i 1], s[j 1]))) j (j 1) % top;         ans max(ans, max(dis(s[i], s[j]), dis(s[i 1], s[j])));     }     return ans; } double sanfen(double l, double r) {     double mi, ma;     while (r - l eps)     {         mi l (r - l) / 3;         ma r - (r - l) / 3;         if (f(mi) f(ma)) l mi;         else r ma;     }     return mi; } int main() {     int T;     cin T;     while (T--)     {         cin n;         per(i, 1, n)             cin p[i].x p[i].y p[i].vx p[i].vy;         double t sanfen(0, 10000);         printf(%.2f %.2f\n, t, f(t));     }     return 0; }
http://wiki.neutronadmin.com/news/227631/

相关文章:

  • 网站开发市场前景百度最新版app下载安装
  • 海淀教育互动平台网站建设如何做搞笑原创视频网站
  • 如何建设一个网站站佛山贸易网站建设
  • 陕西省建设集团公司网站上海网站建设公司兴田德润可以不
  • 不用花生壳做网站服务器wordpress 反应慢
  • j2ee大型网站开发框架宝洁公司网站建设案例
  • 软件开发可以做网站么整装公司排名前十强
  • php如何自学做网站即墨今天新闻大事
  • A00网站建设河北廊坊公布新增阳性人员轨迹
  • 怎么知道一个网站的权重永灿网站建设公司
  • 兰州网站排名分析博客seo优化技术
  • 企业建站系统漏洞网络营销是做什么
  • 阿里巴巴网站建设缺点创建全国文明城市我们在行动绘画
  • 蒙牛企业网站建设规划书帮别人发广告赚钱平台
  • 设计比例网站天猫网站建设的目标
  • 男女做那事是什 网站wordpress实现专题
  • 网站开发团队人数构成网站开发流程asp
  • 地方网站建设方案广州网站建设联系电话
  • 做调像什么网站找活品牌展示型网站源码
  • 苏州教育学会网站建设十大手游折扣平台app
  • 网站对接如何做青岛城乡建筑设计院有限公司
  • 自做美食哪些网站石家庄局域网网站建设
  • 备案网站可以做论坛么网站带数据库下载
  • 百度网站是百度公司做的吗东莞网页设计
  • 长春哪家做网站便宜wordpress付费查看内容
  • 免费做网站视频ie不能显示wordpress图片
  • 东莞做一个企业网站中国设计师排名
  • 科技园区建设网站的意义宁波网络公司在哪里
  • .net开发微信网站流程中国空间站完整图
  • 北京手机网站搭建费用同一个服务器的网站做友情链接