結果
問題 |
No.806 木を道に
|
ユーザー |
![]() |
提出日時 | 2019-03-24 04:33:32 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 243 bytes |
コンパイル時間 | 95 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 28,032 KB |
最終ジャッジ日時 | 2024-09-25 09:34:11 |
合計ジャッジ時間 | 6,939 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 3 WA * 24 |
ソースコード
N=int(input()) edges=[[int(j) for j in input().split()] for i in range(N-1)] cnts=[0 for i in range(N+1)] for edge in edges: cnts[edge[0]]+=1 cnts[edge[1]]+=1 solo=0 for cnt in cnts: if cnt==1: solo+=1 print((solo-1)//2)