結果
| 問題 |
No.1719 Tree and Permutation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-06 00:59:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 421 ms / 2,000 ms |
| コード長 | 310 bytes |
| コンパイル時間 | 161 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 80,512 KB |
| 最終ジャッジ日時 | 2024-11-28 02:46:31 |
| 合計ジャッジ時間 | 3,899 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 6 |
ソースコード
def solve():
n = int(input())
deg = [0] * n
for _ in range(n - 1):
a, b = map(int, input().split())
deg[a - 1] += 1
deg[b - 1] += 1
leaf = deg.count(1)
if leaf * 2 >= n:
print("Yes")
else:
print("No")
for _ in range(int(input())):
solve()