Submission #1145499

#TimeUsernameProblemLanguageResultExecution timeMemory
1145499HabibaOdašiljači (COCI20_odasiljaci)C++20
0 / 70
46 ms8264 KiB
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define HABIBA ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define F first
#define S second
#define ll 0LL
#define int long long
#define LL long long
#define lp     \
    int _ = 1; \
    //cin >> _;  \
    while (_--)
#define sorting sort(a, a + n);
#define pb(X) push_back(X);
#define all(X) X.begin(), X.end()
#define sz(str) (long long)str.size()
const LL MOD = 1e9 + 7;
const LL N = 1e4 + 2;
using namespace __gnu_pbds;
using namespace std;
int dx[8] = {0, 0, -1, 1, 1, 1, -1, -1};
int dy[8] = {1, -1, 0, 0, -1, 1, -1, 1};
#pragma GCC optimize("-Ofast")
#pragma GCC optimize("-O1")
template <class T>
using o_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
bool comp(vector<int> a, vector<int> b)
{
    return (a.size() < b.size());
}
double phy(pair<double, double> x, pair<double, double> y)
{
    return sqrt((abs(x.F - y.F) * abs(x.F - y.F)) + (abs(x.S - y.S) * abs(x.S - y.S)));
}
void cat()
{
    int n;
    cin >> n;
    vector<pair<double, double>> a(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a[i].F >> a[i].S;
    }
    vector<vector <double>> mx(n);
    vector <double> mk(n);
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (i != j)
            {
                mx[i].pb(phy(a[i], a[j]));
               // cout << phy(a[i], a[j]) << " ";
            }
        }
        sort (all(mx[i]));
        mk[i]=(mx[i].size()>1? mx[i][mx[i].size()-2]: mx[i][mx[i].size()-1]);
    }
    double mn = LLONG_MAX;
    for (int i = 0; i < n; i++)
        mn = min(mn, mk[i] / 2);
    cout << fixed << setprecision(7) << mn;
}
signed main()
{
    HABIBA
    lp { cat(); }
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...