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链接
随机推荐
- centOS 6.4挂载centOS分区
今天想用centOS打开在windows下编辑的emacs笔记,发现好像不可以自动挂载nfts分区,搜了一下,发现一大坨,还是发个文来标记下好: 首先,安装rpmforge软件库的源 命令行下输入下面 ...
- Eclipse ADT的Custom debug keystore所需证书规格
最近开始研究Google Play的In-app Billing IAB内置计费API,发现一个比较烦人的问题就是测试时应用必须经过正式签名,而默认Eclipse ADT调试运行使用的是临时生成的De ...
- 《JAVA课程设计》实训第四天——《猜猜看》游戏
第四天,本来想进一步去改进<猜猜看>游戏的.可是非常多问题都不理解.也不熟悉怎么去弄到连接数据库.统计猜对次数,所以并没有进行再多的改动. 基本上就是这种执行结果了 import java ...
- hdu1074 Doing Homework(状态压缩DP Y=Y)
Doing Homework Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) T ...
- GCC编译选项
一.看例子分析gcc 的编译选项 gcc -o hello hello.c -I /home/hello/include -L /home/hello/lib -lworld 1.-I /home/h ...
- android开发之——混淆编译
众所周知,android的apk文件是非常容易被反编译的,这样对于开发者来说,辛辛苦苦开发应用被破解是一件很令人懊恼的事情,谷歌也认识到了这一点,所以从2.3之后就为开发者提供了一个代码混淆工具pro ...
- Android(java)学习笔记255:JNI之JNI概念
1. JNI是什么? java native interface (java本机接口) 比如方法声明: public final native Class<?> getClass(): ...
- SQL 结构化查询语言手册
摘自该学习网站: http://www.w3school.com.cn/sql/ 新学到的几点: and 和or 连用,记得用括号. 2.SQL通配符补充 例如: ...
- PHP的魔术方法(简介)
public void _set(string $name,mixed $value) public mixed _get(string $name) public bool _isset(strin ...
- 自定义控件 TextView 歌词 Lrc
演示 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> < ...