結果

問題 No.763 Noelちゃんと木遊び
ユーザー cielciel
提出日時 2018-12-12 00:48:50
言語 Ruby
(3.3.0)
結果
AC  
実行時間 582 ms / 2,000 ms
コード長 226 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 11,920 KB
実行使用メモリ 148,912 KB
最終ジャッジ日時 2023-10-24 22:29:59
合計ジャッジ時間 9,791 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
外部呼び出し有り
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 582 ms
148,912 KB
testcase_01 AC 271 ms
22,288 KB
testcase_02 AC 425 ms
31,488 KB
testcase_03 AC 329 ms
24,836 KB
testcase_04 AC 281 ms
22,600 KB
testcase_05 AC 325 ms
24,872 KB
testcase_06 AC 485 ms
32,984 KB
testcase_07 AC 470 ms
32,712 KB
testcase_08 AC 340 ms
25,116 KB
testcase_09 AC 278 ms
22,652 KB
testcase_10 AC 209 ms
18,088 KB
testcase_11 AC 491 ms
32,968 KB
testcase_12 AC 452 ms
32,220 KB
testcase_13 AC 454 ms
32,012 KB
testcase_14 AC 417 ms
30,444 KB
testcase_15 AC 329 ms
24,844 KB
testcase_16 AC 195 ms
17,512 KB
testcase_17 AC 337 ms
24,820 KB
testcase_18 AC 488 ms
32,964 KB
testcase_19 AC 452 ms
32,180 KB
testcase_20 AC 445 ms
32,196 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

ENV[Z='RUBY_THREAD_VM_STACK_SIZE']||exec({Z=>?5*8},'ruby',$0)
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