結果

問題 No.763 Noelちゃんと木遊び
ユーザー cielciel
提出日時 2021-07-31 09:52:58
言語 Ruby
(3.3.0)
結果
AC  
実行時間 461 ms / 2,000 ms
コード長 226 bytes
コンパイル時間 348 ms
コンパイル使用メモリ 11,296 KB
実行使用メモリ 149,500 KB
最終ジャッジ日時 2023-10-14 14:34:01
合計ジャッジ時間 8,687 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
外部呼び出し有り
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 461 ms
149,500 KB
testcase_01 AC 217 ms
21,256 KB
testcase_02 AC 324 ms
30,524 KB
testcase_03 AC 262 ms
24,020 KB
testcase_04 AC 219 ms
21,480 KB
testcase_05 AC 256 ms
23,984 KB
testcase_06 AC 368 ms
31,936 KB
testcase_07 AC 358 ms
31,704 KB
testcase_08 AC 262 ms
24,084 KB
testcase_09 AC 213 ms
21,760 KB
testcase_10 AC 164 ms
17,032 KB
testcase_11 AC 360 ms
31,872 KB
testcase_12 AC 354 ms
31,092 KB
testcase_13 AC 364 ms
30,988 KB
testcase_14 AC 328 ms
29,468 KB
testcase_15 AC 269 ms
24,024 KB
testcase_16 AC 162 ms
16,420 KB
testcase_17 AC 267 ms
23,836 KB
testcase_18 AC 382 ms
31,936 KB
testcase_19 AC 364 ms
31,276 KB
testcase_20 AC 346 ms
31,092 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