timus 1640. Circle of Winter URAL 解题报告 水题一枚,坑死多少英雄啊……

This blog post delves into the intricacies of a problem from Timus titled 'Circle of Winter', part of the Ural contest. It discusses the challenge of guiding Lich Sandro's corpse to defeat monsters using a circular ice wall skill. The solution involves calculating the optimal point for teleportation based on monster locations and distances. The author highlights the deceptive simplicity of the problem's execution compared to its initial complexity in understanding.

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

timus   1640. Circle of Winter  URAL  解题报告  水题一枚,坑死多少英雄啊……

题目大意:话说不死族的尸体  即Lich Sandro 尸体桑德罗 去打怪, 他有一个技能就是一他为圆点放出一个圆圈冰墙,被冰墙砸中的直接死了……
然后被包围的:he demons enclosed in a circle stay alive, but can't participate in the fight anymore. 仍然活着,但是不能对战争做出贡献了,让你找一个合适的点,将桑德罗传送过去,该点不能有怪否则无法着陆,然后释放一个冰圈,使得至少一个怪物被砸中,其他的怪物被包围……
数据量,怪物所在的坐标已经给出,并且绝对值不超过1000,要求圈子的半径不超过10000,那就好办了,随便定义一个点为圆形,释放一个圈子就好,这个圈子的半径就是圆点到最远的点的距离!
这个题我刚开始也没明白,后来在小媛的博客中找到,确实A的挺可爱的……
话说这个题的读题难度又大于做题难度了……


#include<cstdio>
#include<string.h>

#include<iostream>
#include<cmath>
#define EPS 1e-11
using namespace std;
#define FOR(a,b,i)  for(i=a;i<b;++i)
double dis(double d1,double d2,double d3,double d4)
{
    return sqrt(pow(d3-d1,2.0)+pow(d4-d2,2.0));
}
int main()
{
    int n;
    cin>>n;
    int i;
    double cx=1010,cy=1010;
    double x,y;
    double min=0;
    FOR(0,n,i)
    {
        cin>>x>>y;
        if(dis(cx,cy,x,y)>min)
        {
            min=dis(cx,cy,x,y);
        }
    }
    printf("%.9f %.9f %.9f\n",cx,cy,min+EPS);


    return 0;

}



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值