제출 #1366296

#제출 시각아이디문제언어결과실행 시간메모리
1366296backer8002Astronomer (BOI23_astronomer)C++20
0 / 100
1 ms344 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    int K,N,S,T;
    cin >> K >> N >> S >> T;

    vector<complex<double>> points(N);
    for (auto& p : points) {
        int x,y;
        cin >> x >> y;
        p = {x,y};
    }
    double minR = DBL_MAX;
    for (int i = 0; i < N; i++) {
        vector pointsSpecial = points;
        ranges::sort(pointsSpecial,[&points,i](auto f, auto s)->bool {
            return abs(f-points[i]) < abs(s-points[i]);
        });
        const complex<double> mid = accumulate(pointsSpecial.begin()+1,pointsSpecial.begin()+K,points[i],[](complex<double> f,complex<double> s)->complex<double> {
                return (f + s)/complex<double>{2,0};
        });

        const double radius = accumulate(pointsSpecial.begin(),pointsSpecial.begin()+K,0.,[mid](double r, complex<double> s) -> double {
                return max(r,abs(s-mid));
        });
        minR = min(minR,radius);
    }
    cout << setprecision(12) << minR*T;
}

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

Main.cpp: In function 'int main()':
Main.cpp:12:14: warning: narrowing conversion of 'x' from 'int' to 'double' [-Wnarrowing]
   12 |         p = {x,y};
      |              ^
Main.cpp:12:16: warning: narrowing conversion of 'y' from 'int' to 'double' [-Wnarrowing]
   12 |         p = {x,y};
      |                ^
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…