結果

問題 No.806 木を道に
ユーザー Mopepe51Mopepe51
提出日時 2019-03-22 21:50:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 177 ms / 2,000 ms
コード長 169 bytes
コンパイル時間 449 ms
コンパイル使用メモリ 81,524 KB
実行使用メモリ 84,700 KB
最終ジャッジ日時 2023-10-19 07:48:56
合計ジャッジ時間 4,404 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,308 KB
testcase_01 AC 39 ms
53,308 KB
testcase_02 AC 40 ms
53,308 KB
testcase_03 AC 39 ms
53,308 KB
testcase_04 AC 39 ms
53,308 KB
testcase_05 AC 40 ms
53,308 KB
testcase_06 AC 40 ms
53,308 KB
testcase_07 AC 39 ms
53,308 KB
testcase_08 AC 38 ms
53,308 KB
testcase_09 AC 39 ms
53,308 KB
testcase_10 AC 94 ms
77,692 KB
testcase_11 AC 92 ms
77,340 KB
testcase_12 AC 157 ms
84,700 KB
testcase_13 AC 131 ms
83,476 KB
testcase_14 AC 154 ms
84,532 KB
testcase_15 AC 160 ms
84,532 KB
testcase_16 AC 101 ms
78,984 KB
testcase_17 AC 149 ms
83,476 KB
testcase_18 AC 84 ms
76,224 KB
testcase_19 AC 95 ms
78,088 KB
testcase_20 AC 149 ms
83,840 KB
testcase_21 AC 113 ms
80,836 KB
testcase_22 AC 172 ms
84,532 KB
testcase_23 AC 177 ms
84,532 KB
testcase_24 AC 106 ms
82,152 KB
testcase_25 AC 126 ms
83,948 KB
testcase_26 AC 88 ms
78,944 KB
testcase_27 AC 138 ms
83,940 KB
testcase_28 AC 68 ms
70,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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