/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 768.0 KiB
#2 Accepted 2ms 532.0 KiB
#3 Accepted 1ms 344.0 KiB
#4 Wrong Answer 2ms 560.0 KiB
#5 Accepted 1ms 540.0 KiB
#6 Accepted 1ms 328.0 KiB
#7 Accepted 1ms 540.0 KiB
#8 Accepted 2ms 524.0 KiB
#9 Accepted 2ms 368.0 KiB
#10 Accepted 2ms 496.0 KiB
#11 Wrong Answer 1ms 540.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)
{
    ll mx=LLONG_MIN;
    for(ll i=0;i<n-1;i++)
    {
        for(ll j=i+1;j<n;j++)
        {
            ll 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);
            mx=max(mx,dis);           
        }           
    }
    return mx<=(2*mid)*(2*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=1e10;
    for(ll i=0;i<=100;i++)
    {
        ld mid=(l+r)/2;
        if(good(mid))    r=mid;
        else l=mid;          
    }
    cout<<fixed<<setprecision(18)<<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:11:12
Judged At
2024-10-30 09:11:12
Judged By
Score
45
Total Time
2ms
Peak Memory
768.0 KiB