/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 2ms 532.0 KiB
#3 Accepted 2ms 532.0 KiB
#4 Wrong Answer 3ms 532.0 KiB
#5 Wrong Answer 4ms 532.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
 
#define all(t) t.begin(), t.end()
#define rall(t) t.rbegin(), t.rend()
#define forr(x, n) for (int i = x; i < n; i++)
#define ff first
#define ss second
#define pb push_back
#define nl '\n'
#define faster                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                 \
    cout.tie(0);
 
const double PI = 3.141592653589793238462643383279502884197;
const int N = (int)1e6 + 5;
const ll inf = (ll)1e18 + 5;
const int mod = (int)1e9 + 7;

double dis(int x1, int y1, int x2, int y2){
    ll x = x1-x2;
    ll y = y1-y2;
    return sqrt(x*x + y*y);
}

void solve(){
    int n;
    cin>>n;
    vector<int> x(n), y(n);
    for(int i = 0; i < n; i++){
        cin>>x[i]>>y[i];
    }
    sort(all(x));
    sort(all(y));
    double ans = dis(x[0], y[0], x[n-1],y[n-1]);
    cout<<fixed<<setprecision(10)<<ans/2<<nl;
}


int main(){
    faster;
    solve();
}

Information

Submit By
Type
Submission
Problem
P1123 Relic Rescue Radius!
Language
C++17 (G++ 13.2.0)
Submit At
2024-11-01 16:46:58
Judged At
2024-11-01 16:46:58
Judged By
Score
15
Total Time
4ms
Peak Memory
532.0 KiB