結果

問題 No.806 木を道に
ユーザー mlihua09mlihua09
提出日時 2020-08-31 20:22:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 230 ms / 2,000 ms
コード長 219 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 82,396 KB
実行使用メモリ 87,680 KB
最終ジャッジ日時 2024-04-28 11:07:26
合計ジャッジ時間 5,018 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,712 KB
testcase_01 AC 39 ms
51,712 KB
testcase_02 AC 40 ms
51,840 KB
testcase_03 AC 38 ms
51,968 KB
testcase_04 AC 38 ms
51,584 KB
testcase_05 AC 40 ms
52,096 KB
testcase_06 AC 40 ms
52,352 KB
testcase_07 AC 43 ms
51,712 KB
testcase_08 AC 39 ms
51,584 KB
testcase_09 AC 38 ms
51,584 KB
testcase_10 AC 93 ms
77,568 KB
testcase_11 AC 89 ms
77,312 KB
testcase_12 AC 168 ms
85,248 KB
testcase_13 AC 137 ms
81,792 KB
testcase_14 AC 172 ms
85,248 KB
testcase_15 AC 177 ms
85,488 KB
testcase_16 AC 109 ms
78,424 KB
testcase_17 AC 162 ms
84,352 KB
testcase_18 AC 84 ms
76,544 KB
testcase_19 AC 104 ms
78,048 KB
testcase_20 AC 173 ms
84,608 KB
testcase_21 AC 123 ms
80,844 KB
testcase_22 AC 224 ms
87,552 KB
testcase_23 AC 230 ms
87,680 KB
testcase_24 AC 124 ms
81,664 KB
testcase_25 AC 147 ms
84,992 KB
testcase_26 AC 107 ms
79,272 KB
testcase_27 AC 158 ms
87,340 KB
testcase_28 AC 80 ms
69,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


N = int(input())

V = [[] for i in range(N)]

for i in range(N - 1):
    
    a, b = map(int, input().split())
    
    V[a - 1] += [b - 1]
    
    V[b - 1] += [a - 1]
    
print(sum([max(len(v) - 2, 0) for v in V]))
0