/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 332.0 KiB
#2 Accepted 2ms 508.0 KiB
#3 Accepted 3ms 556.0 KiB
#4 Wrong Answer 3ms 516.0 KiB
#5 Accepted 3ms 536.0 KiB
#6 Accepted 3ms 516.0 KiB
#7 Accepted 2ms 492.0 KiB
#8 Accepted 2ms 328.0 KiB
#9 Accepted 3ms 332.0 KiB
#10 Accepted 3ms 544.0 KiB
#11 Wrong Answer 2ms 504.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);
            if(dis>(2*mid)*(2*mid)) return false;
            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=1e18;
    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:15:16
Judged At
2024-11-11 02:35:24
Judged By
Score
45
Total Time
3ms
Peak Memory
556.0 KiB