結果

問題 No.806 木を道に
ユーザー Mopepe51Mopepe51
提出日時 2019-03-22 21:48:05
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 188 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 81,508 KB
実行使用メモリ 277,536 KB
最終ジャッジ日時 2023-10-19 07:46:50
合計ジャッジ時間 8,700 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
57,844 KB
testcase_01 AC 39 ms
53,300 KB
testcase_02 AC 40 ms
53,300 KB
testcase_03 AC 40 ms
53,300 KB
testcase_04 AC 39 ms
53,300 KB
testcase_05 AC 40 ms
53,300 KB
testcase_06 AC 39 ms
53,300 KB
testcase_07 AC 38 ms
53,300 KB
testcase_08 AC 39 ms
53,300 KB
testcase_09 AC 39 ms
53,300 KB
testcase_10 AC 100 ms
78,444 KB
testcase_11 AC 100 ms
78,128 KB
testcase_12 AC 202 ms
92,508 KB
testcase_13 AC 165 ms
87,568 KB
testcase_14 AC 188 ms
88,932 KB
testcase_15 AC 204 ms
92,652 KB
testcase_16 AC 118 ms
82,148 KB
testcase_17 AC 183 ms
88,876 KB
testcase_18 AC 89 ms
76,664 KB
testcase_19 AC 107 ms
78,916 KB
testcase_20 AC 184 ms
89,564 KB
testcase_21 AC 131 ms
83,468 KB
testcase_22 AC 227 ms
93,480 KB
testcase_23 AC 224 ms
92,900 KB
testcase_24 AC 117 ms
84,260 KB
testcase_25 AC 142 ms
87,704 KB
testcase_26 AC 1,482 ms
243,584 KB
testcase_27 TLE -
testcase_28 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
f={}
for _ in range(N-1):
    a,b=map(int,input().split())
    f[a]=f.get(a,[])+[b]
    f[b]=f.get(b,[])+[a]
r=0
for v in f.values():
    l=len(v)
    if l>2:r+=l-2
print(r)
0