結果

問題 No.806 木を道に
ユーザー KentarokumuraKentarokumura
提出日時 2019-03-22 21:31:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 247 bytes
コンパイル時間 1,558 ms
コンパイル使用メモリ 81,300 KB
実行使用メモリ 76,736 KB
最終ジャッジ日時 2023-10-19 06:31:34
合計ジャッジ時間 3,787 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,336 KB
testcase_01 AC 42 ms
53,336 KB
testcase_02 AC 43 ms
55,384 KB
testcase_03 AC 43 ms
55,384 KB
testcase_04 AC 42 ms
53,336 KB
testcase_05 AC 45 ms
55,384 KB
testcase_06 AC 45 ms
55,384 KB
testcase_07 AC 43 ms
53,336 KB
testcase_08 AC 42 ms
53,336 KB
testcase_09 AC 43 ms
53,336 KB
testcase_10 AC 90 ms
76,116 KB
testcase_11 AC 84 ms
76,092 KB
testcase_12 AC 120 ms
76,616 KB
testcase_13 AC 105 ms
76,428 KB
testcase_14 AC 117 ms
76,580 KB
testcase_15 AC 119 ms
76,620 KB
testcase_16 AC 89 ms
76,180 KB
testcase_17 AC 112 ms
76,536 KB
testcase_18 AC 75 ms
73,996 KB
testcase_19 AC 87 ms
76,124 KB
testcase_20 AC 115 ms
76,536 KB
testcase_21 AC 96 ms
76,276 KB
testcase_22 AC 127 ms
76,728 KB
testcase_23 AC 128 ms
76,736 KB
testcase_24 AC 96 ms
76,352 KB
testcase_25 AC 109 ms
76,588 KB
testcase_26 AC 88 ms
76,184 KB
testcase_27 AC 116 ms
76,712 KB
testcase_28 AC 69 ms
70,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
N=int(input())
table=[0 for i in range(N)]
for i in range(N-1):
    a,b=map(int,input().split())
    a,b=a-1,b-1
    table[a]+=1
    table[b]+=1
num=0
for i in range(N):
    if table[i]==1:
        num+=1
print(num-2)
0