結果

問題 No.94 圏外です。(EASY)
ユーザー 👑 hos.lyrichos.lyric
提出日時 2015-02-24 01:43:40
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,565 ms / 5,000 ms
コード長 290 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 11,584 KB
実行使用メモリ 27,508 KB
最終ジャッジ日時 2023-09-08 14:21:27
合計ジャッジ時間 18,795 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,688 KB
testcase_01 AC 79 ms
15,076 KB
testcase_02 AC 83 ms
15,624 KB
testcase_03 AC 84 ms
15,104 KB
testcase_04 AC 98 ms
15,668 KB
testcase_05 AC 135 ms
16,200 KB
testcase_06 AC 222 ms
16,828 KB
testcase_07 AC 399 ms
18,408 KB
testcase_08 AC 738 ms
21,496 KB
testcase_09 AC 1,327 ms
27,412 KB
testcase_10 AC 1,352 ms
27,280 KB
testcase_11 AC 1,319 ms
27,200 KB
testcase_12 AC 1,347 ms
27,480 KB
testcase_13 AC 1,340 ms
27,200 KB
testcase_14 AC 1,341 ms
27,404 KB
testcase_15 AC 1,345 ms
27,456 KB
testcase_16 AC 1,357 ms
27,508 KB
testcase_17 AC 1,341 ms
27,188 KB
testcase_18 AC 1,354 ms
27,400 KB
testcase_19 AC 1,565 ms
27,460 KB
testcase_20 AC 82 ms
15,664 KB
testcase_21 AC 78 ms
15,140 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
a=(1..n).map{gets.split}
d=(0...n).map{|u|(0...n).map{|v|s=0;[0,1].map{|i|s+=(a[u][i].to_i-a[v][i].to_i)**2};s}}
$p=*0...n
def r u;u==$p[u]?u:$p[u]=r($p[u])end
n.times{|u|n.times{|v|d[u][v]<101&&$p[r v]=r(u)}}
a=1
n.times{|u|n.times{|v|r(u)==r(v)&&a=[a,2+d[u][v]**0.5].max}}
p a
0