結果

問題 No.806 木を道に
ユーザー anagohirameanagohirame
提出日時 2019-03-22 22:01:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 323 ms / 2,000 ms
コード長 162 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 11,732 KB
実行使用メモリ 10,988 KB
最終ジャッジ日時 2023-10-19 09:11:02
合計ジャッジ時間 5,381 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,100 KB
testcase_01 AC 30 ms
10,100 KB
testcase_02 AC 30 ms
10,100 KB
testcase_03 AC 32 ms
10,100 KB
testcase_04 AC 31 ms
10,100 KB
testcase_05 AC 30 ms
10,100 KB
testcase_06 AC 29 ms
10,100 KB
testcase_07 AC 30 ms
10,100 KB
testcase_08 AC 29 ms
10,100 KB
testcase_09 AC 31 ms
10,100 KB
testcase_10 AC 95 ms
10,216 KB
testcase_11 AC 87 ms
10,240 KB
testcase_12 AC 279 ms
10,868 KB
testcase_13 AC 210 ms
10,688 KB
testcase_14 AC 266 ms
10,836 KB
testcase_15 AC 281 ms
10,880 KB
testcase_16 AC 120 ms
10,448 KB
testcase_17 AC 246 ms
10,788 KB
testcase_18 AC 53 ms
10,188 KB
testcase_19 AC 96 ms
10,212 KB
testcase_20 AC 247 ms
10,788 KB
testcase_21 AC 151 ms
10,532 KB
testcase_22 AC 321 ms
10,988 KB
testcase_23 AC 323 ms
10,988 KB
testcase_24 AC 183 ms
10,620 KB
testcase_25 AC 261 ms
10,832 KB
testcase_26 AC 115 ms
10,440 KB
testcase_27 AC 305 ms
10,968 KB
testcase_28 AC 38 ms
10,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
deg = [0 for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    deg[a-1] += 1
    deg[b-1] += 1
print(deg.count(1) - 2)
0