結果

問題 No.806 木を道に
ユーザー mlihua09mlihua09
提出日時 2020-08-31 20:22:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 230 ms / 2,000 ms
コード長 219 bytes
コンパイル時間 906 ms
コンパイル使用メモリ 86,604 KB
実行使用メモリ 89,064 KB
最終ジャッジ日時 2023-08-10 17:41:23
合計ジャッジ時間 9,190 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,964 KB
testcase_01 AC 73 ms
71,372 KB
testcase_02 AC 70 ms
71,216 KB
testcase_03 AC 72 ms
71,324 KB
testcase_04 AC 70 ms
71,452 KB
testcase_05 AC 73 ms
71,224 KB
testcase_06 AC 73 ms
71,276 KB
testcase_07 AC 72 ms
71,184 KB
testcase_08 AC 73 ms
71,208 KB
testcase_09 AC 73 ms
71,456 KB
testcase_10 AC 157 ms
78,652 KB
testcase_11 AC 123 ms
78,528 KB
testcase_12 AC 203 ms
86,408 KB
testcase_13 AC 176 ms
84,528 KB
testcase_14 AC 192 ms
85,876 KB
testcase_15 AC 207 ms
86,284 KB
testcase_16 AC 129 ms
79,080 KB
testcase_17 AC 189 ms
85,428 KB
testcase_18 AC 114 ms
77,980 KB
testcase_19 AC 126 ms
78,788 KB
testcase_20 AC 196 ms
85,560 KB
testcase_21 AC 153 ms
81,860 KB
testcase_22 AC 227 ms
89,064 KB
testcase_23 AC 230 ms
88,928 KB
testcase_24 AC 134 ms
82,496 KB
testcase_25 AC 159 ms
86,156 KB
testcase_26 AC 119 ms
80,040 KB
testcase_27 AC 171 ms
88,656 KB
testcase_28 AC 101 ms
76,864 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