結果

問題 No.2179 Planet Traveler
ユーザー tailstails
提出日時 2023-01-06 23:14:28
言語 cLay
(20240104-1)
結果
AC  
実行時間 54 ms / 3,000 ms
コード長 474 bytes
コンパイル時間 2,558 ms
コンパイル使用メモリ 174,960 KB
実行使用メモリ 10,124 KB
最終ジャッジ日時 2024-05-07 23:03:04
合計ジャッジ時間 4,486 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 3 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 3 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 18 ms
9,496 KB
testcase_12 AC 15 ms
8,748 KB
testcase_13 AC 12 ms
9,516 KB
testcase_14 AC 34 ms
8,636 KB
testcase_15 AC 54 ms
8,800 KB
testcase_16 AC 45 ms
8,648 KB
testcase_17 AC 40 ms
9,540 KB
testcase_18 AC 39 ms
9,940 KB
testcase_19 AC 29 ms
10,120 KB
testcase_20 AC 6 ms
7,668 KB
testcase_21 AC 31 ms
8,612 KB
testcase_22 AC 18 ms
8,704 KB
testcase_23 AC 15 ms
8,816 KB
testcase_24 AC 32 ms
10,124 KB
testcase_25 AC 19 ms
8,904 KB
testcase_26 AC 26 ms
9,328 KB
testcase_27 AC 7 ms
8,324 KB
testcase_28 AC 14 ms
8,764 KB
testcase_29 AC 34 ms
9,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll n,m,d[800][800],v[800];

void f(ll i){
	v[i]=1;
	rep(j,n){
		if(!v[j]&&d[i][j]<=m){
			f(j);
		}
	}
}


{
	rd(n);
	ll x[n],y[n],t[n];
	rd((x,y,t)(n));
	rep(i,n){
		rep(j,i){
			d[i][j]=d[j][i]=
				t[i]==t[j] ?
				(x[i]-x[j])**2+(y[i]-y[j])**2 :
				x[i]**2+y[i]**2+x[j]**2+y[j]**2-Isqrt(4*(x[i]**2+y[i]**2)*(x[j]**2+y[j]**2));
		}
	}
	ll l=-1,h=33d8;
	while(l+1<h){
		m=l+h>>1;
		rep(i,n){
			v[i]=0;
		}
		f(0);
		if(v[n-1]){
			h=m;
		}else{
			l=m;
		}
	}
	wt(h);
}
0