結果

問題 No.806 木を道に
ユーザー lllllll88938494lllllll88938494
提出日時 2023-05-10 14:57:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 229 ms / 2,000 ms
コード長 215 bytes
コンパイル時間 1,881 ms
コンパイル使用メモリ 86,364 KB
実行使用メモリ 89,636 KB
最終ジャッジ日時 2023-09-18 12:13:55
合計ジャッジ時間 7,180 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,104 KB
testcase_01 AC 75 ms
71,196 KB
testcase_02 AC 77 ms
71,124 KB
testcase_03 AC 78 ms
71,024 KB
testcase_04 AC 77 ms
70,948 KB
testcase_05 AC 79 ms
71,128 KB
testcase_06 AC 76 ms
71,216 KB
testcase_07 AC 78 ms
71,276 KB
testcase_08 AC 79 ms
71,268 KB
testcase_09 AC 79 ms
71,024 KB
testcase_10 AC 133 ms
78,832 KB
testcase_11 AC 128 ms
78,488 KB
testcase_12 AC 202 ms
86,220 KB
testcase_13 AC 169 ms
82,832 KB
testcase_14 AC 197 ms
85,696 KB
testcase_15 AC 198 ms
86,224 KB
testcase_16 AC 138 ms
79,204 KB
testcase_17 AC 193 ms
85,172 KB
testcase_18 AC 119 ms
78,048 KB
testcase_19 AC 132 ms
78,700 KB
testcase_20 AC 193 ms
85,556 KB
testcase_21 AC 150 ms
81,732 KB
testcase_22 AC 229 ms
88,396 KB
testcase_23 AC 219 ms
88,480 KB
testcase_24 AC 139 ms
82,036 KB
testcase_25 AC 161 ms
85,388 KB
testcase_26 AC 122 ms
79,992 KB
testcase_27 AC 173 ms
89,636 KB
testcase_28 AC 106 ms
76,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
g=[[] for i in range(n+1)]

for i in range(n-1):
    a,b=map(int,input().split())
    g[a].append(b)
    g[b].append(a)
cnt=0
for i in range(1,n+1):
    if len(g[i]) == 1:
        cnt+=1

print(cnt-2)
0