結果

問題 No.763 Noelちゃんと木遊び
ユーザー cielciel
提出日時 2018-12-12 00:11:01
言語 Ruby
(3.3.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 164 bytes
コンパイル時間 341 ms
コンパイル使用メモリ 11,812 KB
実行使用メモリ 32,492 KB
最終ジャッジ日時 2023-10-24 22:28:24
合計ジャッジ時間 7,835 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 167 ms
22,164 KB
testcase_02 AC 308 ms
31,364 KB
testcase_03 AC 220 ms
24,800 KB
testcase_04 AC 179 ms
22,480 KB
testcase_05 AC 220 ms
24,756 KB
testcase_06 AC 372 ms
32,276 KB
testcase_07 AC 373 ms
32,356 KB
testcase_08 AC 242 ms
25,148 KB
testcase_09 AC 185 ms
22,524 KB
testcase_10 AC 119 ms
17,912 KB
testcase_11 AC 366 ms
32,488 KB
testcase_12 AC 333 ms
31,920 KB
testcase_13 AC 346 ms
31,804 KB
testcase_14 AC 315 ms
30,312 KB
testcase_15 AC 232 ms
24,724 KB
testcase_16 AC 110 ms
17,336 KB
testcase_17 AC 226 ms
24,796 KB
testcase_18 AC 359 ms
32,492 KB
testcase_19 AC 340 ms
32,148 KB
testcase_20 AC 335 ms
32,148 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

h=Hash.new{|h,k|h[k]=[]}
v={}
r=0
f=->j{a=true;v[j]=1;h[j].each{|e|!v[e]&&f[e]&&a=false};a&&r+=1;a}
gets;$<.each{|e|a,b=e.split.map &:to_i;h[a]<<b;h[b]<<a}
f[1];p r
0