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链接
随机推荐
- Unity绘制GUI连连看(尚未完善效果和重置)
OneImage.cs public class OneImage : MonoBehaviour { public int row, col; public Rect rect; public Te ...
- Robot Framework安装配置 Linux
Simple introduction Robot Framework is a generic test automation framework for acceptance testing an ...
- in, out, ref
C#中的函数传递方式可以为in.out.ref(引用) in方式的是默认的传递方式,即向函数内部传送值,不作讲解 很多语言都有类似的操作从函数向调用者返回值,这样我们可以通过函数的调用返回多个值,因为 ...
- 循序渐进DB2(第2版)——DBA系统管理、运维与应用案例
<循序渐进DB2(第2版)——DBA系统管理.运维与应用案例> 基本信息 作者: 牛新庄 出版社:清华大学出版社 ISBN:9787302323013 上架时间:2013-7-3 出 ...
- Android Studio中自己定义快捷输入块
快捷键:Ctrl + Alt + s,进入Settings >Editor>Live Templates>output中加入一个项,选择第一个Live Template waterm ...
- session过期后自动跳转到登陆页
项目需要做一个自动登出的功能,查询了网上的资料,一开始准备用session监听做,按照下面方式配置监听器 1.在项目的web.xml文件中添加如下代码: <!--添加Session监听器--&g ...
- 【转】iOS实时卡顿监控
转自http://www.tanhao.me/code/151113.html/ 在移动设备上开发软件,性能一直是我们最为关心的话题之一,我们作为程序员除了需要努力提高代码质量之外,及时发现和监控软件 ...
- noip 2009 道路游戏
/*10分钟的暴力 意料之中的5分..*/ #include<iostream> #include<cstdio> #include<cstring> #defin ...
- MVC4数据访问EF查询linq语句的时候报错找不到表名问题
一天做项目的时候遇到这样的问题,MVC4用EF访问数据查询用linq语句的时候报错找不到表名:报错如下图: 研究了几种情况,最后还是没有找到正真的问题所在,不过可能是和路由解析问题有关,暂时还没有进行 ...
- hdu 1175
#include <iostream> #include <string> #include <stdio.h> using namespace std; int ...