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链接
随机推荐
- kindle paperwhite 使用说明
calibre,eink必备转换软件. easypub,lucida制作的软件,支持txt to epub:txt to mobi,可以实现目录. 售后电话:400 817 0100 正常的设计格式转 ...
- 技能CDDemo(点击鼠标左键实现技能界面旋转)
using UnityEngine; using System.Collections; using UnityEngine.UI; public class HealthController : M ...
- Tomcat的错误 之 java.lang.IllegalArgumentException: Document base * does not exist
Tomcat的异常 之 java.lang.IllegalArgumentException: Document base 有些刚开始使用的Tomcat的朋友会出现的问题,明明已经将某个web应用从t ...
- [Redux] Writing a Todo List Reducer (Adding a Todo)
Learn how to implement adding a todo in a todo list application reducer. let todo = (state = [], act ...
- CSDN挑战编程——《数学问题》
数学问题 题目详情: 给你两个长度为n的正整数序列分别为{a1,a2,a3...an},{b1,b2,b3...bn},0<ai,bi<=100: 设S=max{x1*a1+x2*a2+x ...
- unity3d触屏操作对象运动
using UnityEngine; using System.Collections; public class robot : MonoBehaviour { private GameObject ...
- [转] GDB 下 watch的使用
这里大概说下gdb调试程序时,watch的使用.至于原理尚不清楚,以后再做补充,还请见谅. watch通常需要和break,run,continue联合使用. 下面举例说明: 代码如下: #inclu ...
- Android 连接Wifi和创建Wifi热点 demo
android的热点功能不可见,用了反射的技术搞定之外. Eclipse设置语言为utf-8才能查看中文注释 上代码: MainActivity.java package com.widget.hot ...
- lab3
lamp: 在阿里云linux(Ubuntu)上安装Apache mysql php : apt-get install mysql_server mysql_client php5 php_mysq ...
- Topcoder SRM 648 (div.2)
第一次做TC全部通过,截图纪念一下. 终于蓝了一次,也是TC上第一次变成蓝名,下次就要做Div.1了,希望div1不要挂零..._(:зゝ∠)_ A. KitayutaMart2 万年不变的水题. # ...