結果

問題 No.806 木を道に
ユーザー NagisaNagisa
提出日時 2019-03-22 23:08:53
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 329 ms / 2,000 ms
コード長 166 bytes
コンパイル時間 534 ms
コンパイル使用メモリ 11,716 KB
実行使用メモリ 11,800 KB
最終ジャッジ日時 2023-10-19 10:22:59
合計ジャッジ時間 5,517 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,132 KB
testcase_01 AC 29 ms
10,132 KB
testcase_02 AC 30 ms
10,132 KB
testcase_03 AC 30 ms
10,132 KB
testcase_04 AC 29 ms
10,132 KB
testcase_05 AC 30 ms
10,132 KB
testcase_06 AC 29 ms
10,132 KB
testcase_07 AC 29 ms
10,132 KB
testcase_08 AC 29 ms
10,132 KB
testcase_09 AC 29 ms
10,132 KB
testcase_10 AC 95 ms
10,512 KB
testcase_11 AC 88 ms
10,480 KB
testcase_12 AC 280 ms
11,680 KB
testcase_13 AC 213 ms
11,236 KB
testcase_14 AC 270 ms
11,648 KB
testcase_15 AC 284 ms
11,692 KB
testcase_16 AC 120 ms
10,480 KB
testcase_17 AC 252 ms
11,392 KB
testcase_18 AC 53 ms
10,256 KB
testcase_19 AC 97 ms
10,536 KB
testcase_20 AC 249 ms
11,392 KB
testcase_21 AC 152 ms
10,816 KB
testcase_22 AC 325 ms
11,800 KB
testcase_23 AC 329 ms
11,800 KB
testcase_24 AC 179 ms
10,900 KB
testcase_25 AC 258 ms
11,380 KB
testcase_26 AC 113 ms
10,464 KB
testcase_27 AC 307 ms
11,516 KB
testcase_28 AC 37 ms
10,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
G = [0 for k in range(N)]
for k in range(N-1):
    a, b = map(int,input().split())
    G[a-1] += 1
    G[b-1] += 1

G = sorted(G)
print(G.count(1)-2)
0