結果

問題 No.2179 Planet Traveler
ユーザー tailstails
提出日時 2023-01-06 23:05:07
言語 cLay
(20240104-1)
結果
WA  
実行時間 -
コード長 456 bytes
コンパイル時間 2,506 ms
コンパイル使用メモリ 176,236 KB
実行使用メモリ 9,584 KB
最終ジャッジ日時 2024-05-07 22:50:40
合計ジャッジ時間 3,972 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 18 ms
8,448 KB
testcase_12 AC 14 ms
8,576 KB
testcase_13 WA -
testcase_14 AC 35 ms
8,576 KB
testcase_15 AC 55 ms
8,576 KB
testcase_16 AC 46 ms
8,576 KB
testcase_17 AC 39 ms
8,576 KB
testcase_18 AC 40 ms
8,576 KB
testcase_19 AC 30 ms
8,448 KB
testcase_20 AC 6 ms
5,376 KB
testcase_21 AC 30 ms
8,320 KB
testcase_22 AC 17 ms
7,424 KB
testcase_23 AC 16 ms
7,040 KB
testcase_24 AC 32 ms
7,936 KB
testcase_25 AC 18 ms
7,552 KB
testcase_26 AC 28 ms
8,064 KB
testcase_27 AC 6 ms
5,376 KB
testcase_28 AC 14 ms
6,784 KB
testcase_29 AC 33 ms
8,192 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 :
				(ll)ceil((sqrt(x[i]**2+y[i]**2)-sqrt(x[j]**2+y[j]**2))**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