結果

問題 No.763 Noelちゃんと木遊び
ユーザー cielciel
提出日時 2021-07-31 09:52:42
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 164 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 11,552 KB
実行使用メモリ 32,216 KB
最終ジャッジ日時 2023-10-14 14:33:45
合計ジャッジ時間 7,514 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 166 ms
21,276 KB
testcase_02 AC 296 ms
30,464 KB
testcase_03 AC 220 ms
23,732 KB
testcase_04 AC 177 ms
21,720 KB
testcase_05 AC 229 ms
23,756 KB
testcase_06 AC 334 ms
31,944 KB
testcase_07 AC 324 ms
31,600 KB
testcase_08 AC 224 ms
24,112 KB
testcase_09 AC 172 ms
21,808 KB
testcase_10 AC 113 ms
17,136 KB
testcase_11 AC 339 ms
32,076 KB
testcase_12 AC 312 ms
31,192 KB
testcase_13 AC 305 ms
30,988 KB
testcase_14 AC 286 ms
29,416 KB
testcase_15 AC 218 ms
23,828 KB
testcase_16 AC 102 ms
16,436 KB
testcase_17 AC 221 ms
24,048 KB
testcase_18 AC 342 ms
32,216 KB
testcase_19 AC 318 ms
31,316 KB
testcase_20 AC 329 ms
31,124 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