結果

問題 No.2179 Planet Traveler
ユーザー tailstails
提出日時 2023-01-06 23:14:28
言語 cLay
(20240104-1)
結果
AC  
実行時間 34 ms / 3,000 ms
コード長 474 bytes
コンパイル時間 2,574 ms
コンパイル使用メモリ 162,128 KB
実行使用メモリ 9,816 KB
最終ジャッジ日時 2023-08-20 16:43:03
合計ジャッジ時間 4,093 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,580 KB
testcase_01 AC 2 ms
5,440 KB
testcase_02 AC 2 ms
5,440 KB
testcase_03 AC 2 ms
5,508 KB
testcase_04 AC 2 ms
5,572 KB
testcase_05 AC 2 ms
5,440 KB
testcase_06 AC 2 ms
5,444 KB
testcase_07 AC 2 ms
5,460 KB
testcase_08 AC 2 ms
5,848 KB
testcase_09 AC 2 ms
5,632 KB
testcase_10 AC 2 ms
5,848 KB
testcase_11 AC 17 ms
9,624 KB
testcase_12 AC 14 ms
9,552 KB
testcase_13 AC 12 ms
9,540 KB
testcase_14 AC 24 ms
9,552 KB
testcase_15 AC 34 ms
9,612 KB
testcase_16 AC 28 ms
9,552 KB
testcase_17 AC 26 ms
9,816 KB
testcase_18 AC 27 ms
9,620 KB
testcase_19 AC 24 ms
9,544 KB
testcase_20 AC 6 ms
7,392 KB
testcase_21 AC 26 ms
9,748 KB
testcase_22 AC 17 ms
9,544 KB
testcase_23 AC 13 ms
9,540 KB
testcase_24 AC 22 ms
9,548 KB
testcase_25 AC 15 ms
9,548 KB
testcase_26 AC 21 ms
9,564 KB
testcase_27 AC 7 ms
7,484 KB
testcase_28 AC 12 ms
9,660 KB
testcase_29 AC 24 ms
9,816 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