# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
473788 | MamdouhN | Odašiljači (COCI20_odasiljaci) | C++17 | 14 ms | 320 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
vector<pair<int,int>>points;
bool comp(pair<int,int> a,pair<int,int> b)
{
int x = a.first+a.second;
int y = b.first+b.second;
if(x==y)
{
int aa = min(a.first,a.second);
int bb = min(b.first,b.second);
return aa<bb;
}
return x<y;
}
int pwr(double a,double b)
{
int ret=1;
while(b--)ret*=a;
return ret;
}
main()
{
int n;
cin>>n;
for(int i=0;i<n;i++)
{
int a,b;
cin>>a>>b;
points.push_back({a,b});
}
sort(points.begin(),points.end(),comp);
double ans = -1;
for(int i=0;i<n;i++)
{
double ret = 1e9;
for(int j=0;j<n;j++)
{
if(i==j)continue;
double x1 = points[i].first;
double y1 = points[i].second;
double x2 = points[j].first;
double y2 = points[j].second;
double dist = sqrt( pwr(x2-x1,2) + pwr(y2-y1,2) );
dist/=2;
ret = min(dist,ret);
}
ans = max(ans,ret);
}
cout<<fixed<<setprecision(7)<<ans<<endl;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |