結果
| 問題 | No.1719 Tree and Permutation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-06 00:59:01 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 319 ms / 2,000 ms |
| コード長 | 310 bytes |
| 記録 | |
| コンパイル時間 | 712 ms |
| コンパイル使用メモリ | 85,504 KB |
| 実行使用メモリ | 85,504 KB |
| 最終ジャッジ日時 | 2026-05-22 06:23:14 |
| 合計ジャッジ時間 | 3,983 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()