結果

問題 No.806 木を道に
ユーザー Mopepe51Mopepe51
提出日時 2019-03-22 21:45:37
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 233 bytes
コンパイル時間 720 ms
コンパイル使用メモリ 81,660 KB
実行使用メモリ 262,684 KB
最終ジャッジ日時 2023-10-19 07:45:29
合計ジャッジ時間 10,543 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,448 KB
testcase_01 AC 39 ms
53,448 KB
testcase_02 AC 40 ms
53,448 KB
testcase_03 AC 40 ms
53,448 KB
testcase_04 AC 40 ms
53,448 KB
testcase_05 AC 41 ms
53,448 KB
testcase_06 AC 41 ms
53,448 KB
testcase_07 AC 41 ms
53,448 KB
testcase_08 AC 40 ms
53,448 KB
testcase_09 AC 40 ms
53,448 KB
testcase_10 AC 120 ms
81,720 KB
testcase_11 AC 119 ms
81,036 KB
testcase_12 AC 232 ms
102,904 KB
testcase_13 AC 177 ms
93,156 KB
testcase_14 AC 224 ms
103,668 KB
testcase_15 AC 222 ms
101,336 KB
testcase_16 AC 122 ms
83,016 KB
testcase_17 AC 193 ms
97,180 KB
testcase_18 AC 95 ms
77,132 KB
testcase_19 AC 119 ms
82,000 KB
testcase_20 AC 196 ms
97,164 KB
testcase_21 AC 145 ms
87,240 KB
testcase_22 AC 247 ms
107,780 KB
testcase_23 AC 256 ms
107,780 KB
testcase_24 AC 141 ms
91,488 KB
testcase_25 AC 163 ms
97,824 KB
testcase_26 AC 1,549 ms
262,684 KB
testcase_27 TLE -
testcase_28 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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