結果

問題 No.806 木を道に
ユーザー convexineqconvexineq
提出日時 2021-04-06 08:21:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 144 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 87,048 KB
実行使用メモリ 78,752 KB
最終ジャッジ日時 2023-08-30 19:58:21
合計ジャッジ時間 5,054 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,212 KB
testcase_01 AC 67 ms
71,552 KB
testcase_02 AC 67 ms
71,444 KB
testcase_03 AC 66 ms
71,464 KB
testcase_04 AC 67 ms
71,092 KB
testcase_05 AC 69 ms
71,416 KB
testcase_06 AC 67 ms
71,504 KB
testcase_07 AC 67 ms
71,340 KB
testcase_08 AC 67 ms
71,116 KB
testcase_09 AC 66 ms
71,396 KB
testcase_10 AC 100 ms
77,596 KB
testcase_11 AC 97 ms
77,580 KB
testcase_12 AC 126 ms
77,980 KB
testcase_13 AC 115 ms
77,672 KB
testcase_14 AC 125 ms
78,032 KB
testcase_15 AC 129 ms
78,112 KB
testcase_16 AC 104 ms
77,636 KB
testcase_17 AC 121 ms
77,944 KB
testcase_18 AC 91 ms
77,060 KB
testcase_19 AC 102 ms
77,640 KB
testcase_20 AC 124 ms
78,144 KB
testcase_21 AC 108 ms
77,528 KB
testcase_22 AC 139 ms
78,008 KB
testcase_23 AC 137 ms
77,868 KB
testcase_24 AC 112 ms
77,496 KB
testcase_25 AC 123 ms
77,988 KB
testcase_26 AC 101 ms
77,284 KB
testcase_27 AC 131 ms
78,752 KB
testcase_28 AC 89 ms
77,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
deg = [0]*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