제출 #482825

#제출 시각아이디문제언어결과실행 시간메모리
482825rainboyOdašiljači (COCI20_odasiljaci)C++17
70 / 70
4 ms204 KiB
#include <math.h> #include <stdio.h> #include <string.h> #define N 1000 #define INF 0x3f3f3f3f3f3f3f3fLL long long min(long long a, long long b) { return a < b ? a : b; } long long max(long long a, long long b) { return a > b ? a : b; } int main() { static int xx[N], yy[N]; static long long dd[N]; int n, m, i; long long ans; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d%d", &xx[i], &yy[i]); ans = 0; memset(dd, 0x3f, n * sizeof *dd), dd[0] = 0; for (m = 1; m <= n; m++) { int i_ = -1; for (i = 0; i < n; i++) if (dd[i] != -1 && (i_ == -1 || dd[i_] > dd[i])) i_ = i; ans = max(ans, dd[i_]); dd[i_] = -1; for (i = 0; i < n; i++) dd[i] = min(dd[i], (long long) (xx[i] - xx[i_]) * (xx[i] - xx[i_]) + (long long) (yy[i] - yy[i_]) * (yy[i] - yy[i_])); } printf("%f\n", sqrt(ans) / 2); return 0; }

컴파일 시 표준 에러 (stderr) 메시지

odasiljaci.cpp: In function 'int main()':
odasiljaci.cpp:17:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |  scanf("%d", &n);
      |  ~~~~~^~~~~~~~~~
odasiljaci.cpp:19:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |   scanf("%d%d", &xx[i], &yy[i]);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...