結果

問題 No.806 木を道に
ユーザー kawacchukawacchu
提出日時 2019-03-23 09:58:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 286 ms / 2,000 ms
コード長 127 bytes
コンパイル時間 387 ms
コンパイル使用メモリ 11,588 KB
実行使用メモリ 10,892 KB
最終ジャッジ日時 2023-10-21 22:54:48
合計ジャッジ時間 4,985 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,000 KB
testcase_01 AC 27 ms
10,000 KB
testcase_02 AC 24 ms
10,000 KB
testcase_03 AC 24 ms
10,000 KB
testcase_04 AC 24 ms
10,000 KB
testcase_05 AC 25 ms
10,000 KB
testcase_06 AC 26 ms
10,000 KB
testcase_07 AC 24 ms
10,000 KB
testcase_08 AC 25 ms
10,000 KB
testcase_09 AC 26 ms
10,000 KB
testcase_10 AC 87 ms
10,120 KB
testcase_11 AC 75 ms
10,140 KB
testcase_12 AC 245 ms
10,772 KB
testcase_13 AC 183 ms
10,592 KB
testcase_14 AC 232 ms
10,740 KB
testcase_15 AC 241 ms
10,784 KB
testcase_16 AC 102 ms
10,352 KB
testcase_17 AC 215 ms
10,692 KB
testcase_18 AC 46 ms
10,088 KB
testcase_19 AC 87 ms
10,116 KB
testcase_20 AC 211 ms
10,692 KB
testcase_21 AC 130 ms
10,436 KB
testcase_22 AC 286 ms
10,892 KB
testcase_23 AC 272 ms
10,892 KB
testcase_24 AC 160 ms
10,524 KB
testcase_25 AC 236 ms
10,736 KB
testcase_26 AC 98 ms
10,344 KB
testcase_27 AC 264 ms
10,872 KB
testcase_28 AC 32 ms
10,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
d=[0 for i in range(N)]
for i in range(N-1):a,b=map(int,input().split());d[a-1]+=1;d[b-1]+=1
print(d.count(1)-2)
0