結果

問題 No.806 木を道に
ユーザー TANIGUCHI KousukeTANIGUCHI Kousuke
提出日時 2019-12-17 12:28:07
言語 Ruby
(3.3.0)
結果
AC  
実行時間 212 ms / 2,000 ms
コード長 135 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 11,300 KB
実行使用メモリ 16,092 KB
最終ジャッジ日時 2023-09-15 19:30:43
合計ジャッジ時間 6,684 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,100 KB
testcase_01 AC 78 ms
14,980 KB
testcase_02 AC 77 ms
15,148 KB
testcase_03 AC 77 ms
15,100 KB
testcase_04 AC 77 ms
15,052 KB
testcase_05 AC 78 ms
15,056 KB
testcase_06 AC 76 ms
15,104 KB
testcase_07 AC 76 ms
15,052 KB
testcase_08 AC 77 ms
15,224 KB
testcase_09 AC 77 ms
15,224 KB
testcase_10 AC 109 ms
15,548 KB
testcase_11 AC 106 ms
15,576 KB
testcase_12 AC 193 ms
15,888 KB
testcase_13 AC 162 ms
15,852 KB
testcase_14 AC 186 ms
15,860 KB
testcase_15 AC 194 ms
15,848 KB
testcase_16 AC 123 ms
15,656 KB
testcase_17 AC 180 ms
15,972 KB
testcase_18 AC 91 ms
15,312 KB
testcase_19 AC 109 ms
15,516 KB
testcase_20 AC 178 ms
15,748 KB
testcase_21 AC 135 ms
15,552 KB
testcase_22 AC 212 ms
16,008 KB
testcase_23 AC 211 ms
16,092 KB
testcase_24 AC 146 ms
15,580 KB
testcase_25 AC 183 ms
16,056 KB
testcase_26 AC 118 ms
15,400 KB
testcase_27 AC 209 ms
16,048 KB
testcase_28 AC 83 ms
15,188 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
D = Array.new(N + 1, 0)
(1 ... N).each do
  a,b = gets.split.map(&:to_i)
  D[a] += 1
  D[b] += 1
end
puts D.count(1) - 2
0