답안 #935560

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
935560 2024-02-29T09:11:01 Z Faissel Odašiljači (COCI20_odasiljaci) C++17
28 / 70
14 ms 600 KB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;cin >> n;
    vector<pair<int,int>>v;
    for(int i=0;i<n;i++){
        int x,y;cin >> x >> y;
        v.push_back({x,y});
    }
    sort(v.begin(),v.end());
    long double maxx = -1e9;
    for(int i=0;i<v.size();i++){
        long double minx = 1e9;
        for(int j=0;j<v.size();j++){
            int x = abs(v[i].first - v[j].first) * abs(v[i].first - v[j].first);
            int y = abs(v[i].second - v[j].second) * abs(v[i].second - v[j].second);
            if(sqrt(x + y) > 0)
            minx = min(minx,(long double)sqrt(x+y));
        }
        maxx = max(maxx,(long double)minx);
    }
    cout << fixed << setprecision(10) << (maxx/2) << endl;
}

Compilation message

odasiljaci.cpp: In function 'int main()':
odasiljaci.cpp:17:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     for(int i=0;i<v.size();i++){
      |                 ~^~~~~~~~~
odasiljaci.cpp:19:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |         for(int j=0;j<v.size();j++){
      |                     ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Incorrect 1 ms 348 KB Output isn't correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 600 KB Output is correct
8 Incorrect 3 ms 348 KB Output isn't correct
9 Incorrect 14 ms 348 KB Output isn't correct
10 Incorrect 14 ms 472 KB Output isn't correct