ural 1640 Circle of Winter
这道题真的很无聊,就是找一个圆,至少有一个点在这个圆上,其他点不能在圆外,半径不定;
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#define maxn 3000
using namespace std; struct node
{
int x,y;
}p[];
double sqr(double x)
{
return x*x;
}
bool vis[maxn];
double dis(int x1,int y1,int x2,int y2)
{
return sqrt(sqr(x1-x2)+sqr(y1-y2));
}
int main()
{
int n;
scanf("%d",&n);
memset(vis,false,sizeof(vis));
for(int i=; i<n; i++)
{
scanf("%d%d",&p[i].x,&p[i].y);
vis[p[i].x]=true;
}
int x,y;
for(int i=; i<=maxn; i++)
{
if(!vis[i])
{
x=i;
y=;
break;
}
}
double max1=-;
for(int i=; i<n; i++)
{
max1=max(max1,dis(p[i].x,p[i].y,x,y));
}
printf("%d %d %.9lf\n",x,y,max1);
return ;
}
ural 1640 Circle of Winter的更多相关文章
- ural 2068. Game of Nuts
2068. Game of Nuts Time limit: 1.0 secondMemory limit: 64 MB The war for Westeros is still in proces ...
- URAL 1936 Roshambo 题解
http://acm.timus.ru/problem.aspx?space=1&num=1936 F - Roshambo Time Limit:1000MS Memory Limit:65 ...
- Ural 1079 - Maximum
Consider the sequence of numbers ai, i = 0, 1, 2, …, which satisfies the following requirements: a0 ...
- bzoj 1814 Ural 1519 Formula 1 插头DP
1814: Ural 1519 Formula 1 Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 942 Solved: 356[Submit][Sta ...
- Ural 1960 Palindromes and Super Abilities
Palindromes and Super Abilities Time Limit: 1000ms Memory Limit: 65536KB This problem will be judged ...
- URAL 2092 Bolero 贪心
C - Bolero Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit S ...
- [翻译svg教程]svg中的circle元素
svg中的<circle> 元素,是用来绘制圆形的,例如 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink= ...
- 设计一个程序,程序中有三个类,Triangle,Lader,Circle。
//此程序写出三个类,triangle,lader,circle:其中triangle类具有类型为double的a,b,c边以及周长,面积属性, //具有周长,面积以及修改三边的功能,还有判断能否构成 ...
- c++作业:Circle
Circle Github链接
随机推荐
- 3D视频可能出现的质量问题 (MSU出品)
俄罗斯的MSU Graphics & Media Lab (Video Group)提出的3D视频存在的几种问题.有一定的参考价值,在此翻译一下. 他们目前总结出4种问题: 水平视差(Hori ...
- windows 编程 —— 子窗口 与 子窗口控件
目录: 子窗口与主窗口的交互 子窗口控件 按钮类别 button 滚动条类别 scrollbar 静态类别 static 编辑框类别 edit 清单方块 listbox 子窗口与主窗口的交互 创建窗 ...
- Machine Learning—Mixtures of Gaussians and the EM algorithm
印象笔记同步分享:Machine Learning-Mixtures of Gaussians and the EM algorithm
- 斐波那契数列(fabnacci)java实现
斐波那契数列定义:From Wikipedia, the free encyclopedia http://en.wikipedia.org/wiki/Fibonacci_number In math ...
- Class loading in JBoss AS 7--官方文档
Class loading in AS7 is considerably different to previous versions of JBoss AS. Class loading is ba ...
- Hadoop HA的搭建
1.首先添加hosts文件 vim /etc/hosts 192.168.0.1 MSJTVL-DSJC-H01 192.168.0.2 MSJTVL-DSJC-H03 192.168.0.3 MSJ ...
- Html.RenderPartial与Html.RenderAction区别(转)
Html.RenderPartial与Html.RenderAction这两个方法都是用来在界面上嵌入用户控件的. Html.RenderPartial是直接将用户控件嵌入到界面上: <%Htm ...
- java反射机制 struts2 获取 action、method、invocation、proxy
ActionInvocation invocation = ActionContext.getContext().getActionInvocation(); Object action = invo ...
- phpmyadmin设置id自增(AUTO_INCREMENT)(转)
phpmyadmin设置id自增(AUTO_INCREMENT) 在A_I 前面打勾:如图 AUTO_INCREMENT =A_I 查看效果
- Ubuntu 11.10 安装GMONE3,卸载 UNITY和UNITY 2D
Ubuntu 11.10安装GNOME3: 1)sudo apt-get install gnome-shell sudo apt-get install gnome-themes* (或者 ...