제출 #1152257

#제출 시각아이디문제언어결과실행 시간메모리
1152257YSH2020Odašiljači (COCI20_odasiljaci)C++20
21 / 70
19 ms416 KiB
#include <bits/stdc++.h>
using namespace std;

long double dist(int x1, int y1, int x2, int y2) {
  return pow((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2), 0.5);
}

int main() {
  int n; cin >> n;
  vector<pair<int, int>> a(n);
  for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  long double ans = 0;
  for (int i = 0; i < n; i++) {
    long double mindist = dist(a[i].first, a[i].second, a[(i+1)%n].first, a[(i+1)%n].second);
    for (int j = 0; j < n; j++) {
      if (i != j) {
        mindist = min(mindist, dist(a[i].first, a[i].second, a[j].first, a[j].second));
      }
    }
    ans = max(ans, mindist);
  }
  cout << setprecision(10) << ans/2.0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...