/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 324.0 KiB
#2 Accepted 1ms 448.0 KiB
#3 Accepted 1ms 324.0 KiB
#4 Wrong Answer 2ms 324.0 KiB
#5 Accepted 2ms 536.0 KiB
#6 Accepted 2ms 320.0 KiB
#7 Accepted 2ms 320.0 KiB
#8 Accepted 1ms 320.0 KiB
#9 Accepted 2ms 324.0 KiB
#10 Accepted 2ms 556.0 KiB
#11 Wrong Answer 2ms 536.0 KiB

Code

/* SRIJON
        SINGHA
            SAMANTA */
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define nl "\n"
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define yes cout << "YES" << nl
#define no cout << "NO" << nl
#define fi first
#define sec second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define FIO                           \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
const int mod = 1e9 + 7;

struct cor{
    ll x,y;
};

ll n;
vector<cor>v;

bool good(ld mid)
{
    ld mx=LLONG_MIN;
    for(ll i=0;i<n;i++)
    {
        for(ll j=0;j<n;j++)
        {
            ld dis=(v[i].x-v[j].x)*(v[i].x-v[j].x)+(v[i].y-v[j].y)*(v[i].y-v[j].y);
            if(dis>(4*mid*mid)) return false;
            mx=max(mx,dis);           
        }           
    }
    return mx<=(4*mid*mid);
}

int32_t main()
{
    FIO

    cin>>n;
    v.resize(n);
    for(ll i=0;i<n;i++) cin>>v[i].x>>v[i].y;

    ld l=0,r=1e12;
    for(ll i=0;i<=100;i++)
    {
        ld mid=(l+r)/2;
        if(good(mid))    r=mid;
        else l=mid;          
    }
    cout<<fixed<<setprecision(6)<<r<<nl;

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1123 Relic Rescue Radius!
Contest
Sylhet ICPC 2024 Collaborative Challenge: Episode 2
Language
C++17 (G++ 13.2.0)
Submit At
2024-10-30 09:22:51
Judged At
2024-11-11 02:35:21
Judged By
Score
45
Total Time
2ms
Peak Memory
556.0 KiB