Submission #498774

#TimeUsernameProblemLanguageResultExecution timeMemory
498774KarabasanOdašiljači (COCI20_odasiljaci)C++17
21 / 70
145 ms24940 KiB
#include <bits/stdc++.h> #define ll long long #define fast1 ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define endl "\n" using namespace std; #pragma GCC optimize("Ofast") #pragma GCC target("fma,sse,sse2,sse3,avx") #pragma GCC optimize("unroll-loops") int n; vector<pair<double,int> > v[1005]; pair<int,int> p[1005]; int vis[1005]; double mx; void solve() { cin>>n; for(int i=0;i<n;i++) cin>>p[i].first>>p[i].second; for(int i=0;i<n;i++) { for(int j=i+1;j<n;j++) { v[i].push_back({-sqrt(abs(p[i].first-p[j].first)*abs(p[i].first-p[j].first)+abs(p[i].second-p[j].second)*abs(p[i].second-p[j].second))/2.0,j}); v[j].push_back({-sqrt(abs(p[i].first-p[j].first)*abs(p[i].first-p[j].first)+abs(p[i].second-p[j].second)*abs(p[i].second-p[j].second))/2.0,i}); } } priority_queue<pair<double,int> > pq; pq.push({0,0}); while(!pq.empty()) { double yol=pq.top().first; int x=pq.top().second; pq.pop(); if(vis[x]==1) continue; vis[x]=1; mx=min(mx,yol); for(int i=0;i<v[x].size();i++) { if(vis[v[x][i].second]) continue; pq.push({v[x][i].first,v[x][i].second}); } } cout<<-mx<<endl; } signed main() { //freopen ("lca.gir","r",stdin); //freopen ("lca.cik","w",stdout); fast1 int t=1; //cin>>t; while(t--) { solve(); } return 0; }

Compilation message (stderr)

odasiljaci.cpp: In function 'void solve()':
odasiljaci.cpp:39:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<double, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |         for(int i=0;i<v[x].size();i++)
      |                     ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...