| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 391225 | ahmet | Odašiljači (COCI20_odasiljaci) | C++14 | 1098 ms | 332 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define zaman cout<<endl<<fixed<<setprecision(2)<<1000.0 * clock() / CLOCKS_PER_SEC<< " milliseconds "
#define rep(i,n) for(long long (i)=0;(i)<(n);++(i))
#define ref(i,a,b) for (long long (i)=(a); (i)<=(b); ++(i))	
#define endl '\n'
#define ll long long
#define pb push_back
#define pii pair<ll,ll>
#define mp make_pair
const int mx=1005;
int sz[1005],p[1005];
int par(int x){
	if(p[x]==x)return x;
	return p[x]=par(p[x]);
}
int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
	int n;cin >> n;
	vector <pair <int,int > > a;
	rep(i,n){
		int x,y;cin >> x >> y;
		a.pb(mp(x,y));
	}	
	double l=0;double r=2e9;
	while(r>l+0.000001){
		double mid=(l+r)/2;
		bool ok=false;
		rep(i,mx)sz[i]=1;
		rep(i,mx)p[i]=i;
		for(int i=0;i<n;++i){
			for(int j=0;j<n;++j){
				double dis=(sqrtl((a[i].first-a[j].first)*(a[i].first-a[j].first)+(a[i].second-a[j].second)*(a[i].second-a[j].second)))/2.0;
				if(dis>mid)continue;//mid e arti 0.0000001 ekle
				
				par(i);par(j);
				if(p[i]==p[j])continue;
			//	printf("mid:%f    dis:%f     %d:%d %d:%d\n",mid,dis,i,p[i],j,p[j]);
				if(sz[p[i]]>sz[p[j]]){
					sz[p[i]]+=sz[p[j]];
					sz[p[j]]=0;
					p[p[j]]=p[i];
				
				}
				else{
				
					sz[p[j]]+=sz[p[i]];
					sz[p[i]]=0;
					p[p[i]]=p[j];
				
				}
			}
		}
		for(int i=0;i<n;++i){
			if(sz[i]==n)ok=true;
			//printf("i:%d sz[i]:%d ok:%d\n",i,sz[i],ok);
		}
		if(ok)r=mid;
		else l=mid+0.000001;
		//printf("%f %f %d\n",l,r,ok);
	}
	cout << fixed << setprecision(9) << l << endl;
}	
	
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
