結果
| 問題 |
No.806 木を道に
|
| コンテスト | |
| ユーザー |
25__toma
|
| 提出日時 | 2019-03-24 04:38:07 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 390 ms / 2,000 ms |
| コード長 | 238 bytes |
| コンパイル時間 | 196 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 28,032 KB |
| 最終ジャッジ日時 | 2024-09-25 09:46:45 |
| 合計ジャッジ時間 | 5,945 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 |
ソースコード
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-2)
25__toma