/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 328.0 KiB
#2 Accepted 2ms 324.0 KiB
#3 Accepted 2ms 560.0 KiB
#4 Wrong Answer 50ms 564.0 KiB
#5 Accepted 55ms 560.0 KiB
#6 Accepted 56ms 556.0 KiB
#7 Accepted 30ms 560.0 KiB
#8 Accepted 3ms 480.0 KiB
#9 Accepted 27ms 556.0 KiB
#10 Accepted 43ms 552.0 KiB
#11 Wrong Answer 17ms 556.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
#define debug(a) cerr << #a << " = " << (a) << nl;
#define ll long long
#define nl '\n'

void jAVA()
{
    int n;
    cin >> n;
    vector<int> a(n), b(n);
    for (int i = 0; i < n; i++)
        cin >> a[i] >> b[i];
    
    double ans = 1e9;
    for(int i=0;i<n;++i) {
        for(int j=0;j<n;++j){
            double x = (a[i] + a[j]) / 2.0l;
            double y = (b[i] + b[j]) / 2.0l;
            double l = 0, r = 1e6;
            int t = 100;
            while(t--){
                double mid = (l + r) / 2;
                bool ok = true;
                for(int i=0; i<n; i++) ok &= ((x-a[i])*(x-a[i])+(y-b[i])*(y-b[i])<=mid*mid);
                if(ok) r = mid;
                else l = mid;
            }
            ans = min(ans, l);
        }
    }
    cout << fixed << setprecision(10) << ans << nl;
    
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);

    int t = 1, cs = 0;
    // cin >> t;
    while (t--){
        // cout << "Case " << ++cs << ": ";
        jAVA();
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1123 Relic Rescue Radius!
Language
C++17 (G++ 13.2.0)
Submit At
2024-11-01 13:49:00
Judged At
2024-11-11 02:34:16
Judged By
Score
45
Total Time
56ms
Peak Memory
564.0 KiB