/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 356.0 KiB
#2 Accepted 1ms 320.0 KiB
#3 Accepted 1ms 536.0 KiB
#4 Wrong Answer 2ms 520.0 KiB
#5 Accepted 2ms 764.0 KiB
#6 Accepted 2ms 320.0 KiB
#7 Accepted 1ms 324.0 KiB
#8 Accepted 1ms 324.0 KiB
#9 Accepted 1ms 324.0 KiB
#10 Accepted 2ms 532.0 KiB
#11 Wrong Answer 1ms 320.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 sqrtl(mx)<=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=1e5;
    for(ll i=0;i<=100;i++)
    {
        ld mid=(l+r)/2;
        if(good(mid))    r=mid;
        else l=mid;          
    }
    cout<<fixed<<setprecision(10)<<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:06:57
Judged At
2024-11-11 02:35:28
Judged By
Score
45
Total Time
2ms
Peak Memory
764.0 KiB