URAL 1640 — Circle of Winter
2015-04-04 20:59
369 查看
原题:http://acm.timus.ru/problem.aspx?space=1&num=1640
题意:求一个合适的点(该点不能和题给的点重合)释放冰圈,使得给出的点中,至少一个点在圆上,其余均在圆内;
因为所给点的绝对值不超过1000,而冰圈的半径最多为10000;
所以直接以点(1005, 1005)为圆心释放冰圈即可,圆心和题给点最远的距离即为半径;
题意理解了,就很水了 *^-^*
题意:求一个合适的点(该点不能和题给的点重合)释放冰圈,使得给出的点中,至少一个点在圆上,其余均在圆内;
因为所给点的绝对值不超过1000,而冰圈的半径最多为10000;
所以直接以点(1005, 1005)为圆心释放冰圈即可,圆心和题给点最远的距离即为半径;
题意理解了,就很水了 *^-^*
#include<stdio.h> #include<math.h> int main() { int n; while(scanf("%d", &n)!=EOF) { double x = 1005, y = 1005; double a, b; double r = -1; while(n--) { scanf("%lf%lf", &a, &b); double dis = sqrt(pow(x-a, 2.0)+pow(y-b, 2.0)); if(r<dis) r = dis; } printf("%f %f %.9f\n", x, y, r); } }
相关文章推荐
- ural 1640 Circle of Winter
- URAL 1640 Circle of Winter
- Circle of Winter
- poj 1090:The Circumference of the Circle(计算几何,求三角形外心)
- URAL 1057 Amount of Degrees (数位dp)
- URAL1057_Amount Of Degrees
- URAL 1057 Amount of Degrees (数位统计)
- [URAL1057]Amount of Degrees(数位dp)
- URAL 1057 Amount of Degrees(数位统计)
- An Example of Stepwise Refinement(BanishWinter)
- URAL 1057 Amount of Degrees
- hdu 1374 The Circumference of the Circle
- URAL 1932 The Secret of Identifier 题解
- URAL_1932_The Secret of Identifier(状态压缩+容斥)
- URAL 2017 Best of a bad lot 二分图染色 使x集点数最少
- W - The Circumference of the Circle
- 【数位DP】URAL 1057 Amount of Degrees
- CircleImageView of Android
- URAL - 1721 Two Sides of the Same Coin
- URAL1517-Freedom of Choice