結果

問題 No.94 圏外です。(EASY)
ユーザー 👑 hos.lyrichos.lyric
提出日時 2015-02-24 01:51:44
言語 Ruby
(3.3.0)
結果
AC  
実行時間 993 ms / 5,000 ms
コード長 254 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 11,352 KB
実行使用メモリ 27,056 KB
最終ジャッジ日時 2023-09-08 14:20:51
合計ジャッジ時間 12,758 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,320 KB
testcase_01 AC 86 ms
15,000 KB
testcase_02 AC 82 ms
15,216 KB
testcase_03 AC 83 ms
14,996 KB
testcase_04 AC 97 ms
15,352 KB
testcase_05 AC 120 ms
15,968 KB
testcase_06 AC 167 ms
16,420 KB
testcase_07 AC 281 ms
18,092 KB
testcase_08 AC 489 ms
20,884 KB
testcase_09 AC 862 ms
27,056 KB
testcase_10 AC 859 ms
26,856 KB
testcase_11 AC 862 ms
26,976 KB
testcase_12 AC 874 ms
27,020 KB
testcase_13 AC 863 ms
27,008 KB
testcase_14 AC 863 ms
26,916 KB
testcase_15 AC 868 ms
26,896 KB
testcase_16 AC 879 ms
27,004 KB
testcase_17 AC 867 ms
26,720 KB
testcase_18 AC 869 ms
26,768 KB
testcase_19 AC 993 ms
26,788 KB
testcase_20 AC 84 ms
15,328 KB
testcase_21 AC 84 ms
15,272 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a=(1..n=gets.to_i).map{Complex(*gets.split)}
d=(0...n).map{|u|(0...n).map{|v|(a[u]-a[v]).abs}}
$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]>10||$p[r v]=r(u)}}
a=1
n.times{|u|n.times{|v|r(u)==r(v)&&a=[a,2+d[u][v]].max}}
p a
0