結果
問題 | No.1719 Tree and Permutation |
ユーザー |
![]() |
提出日時 | 2021-09-16 22:01:24 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 454 ms / 2,000 ms |
コード長 | 253 bytes |
コンパイル時間 | 275 ms |
コンパイル使用メモリ | 82,728 KB |
実行使用メモリ | 80,800 KB |
最終ジャッジ日時 | 2024-09-23 03:48:55 |
合計ジャッジ時間 | 4,022 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 6 |
ソースコード
t = int(input())for _ in range(t):n = int(input())deg = [0 for i in range(n + 1)]for i in range(n - 1):a, b = map(int, input().split())deg[a] += 1deg[b] += 1print("Yes" if deg.count(1) * 2 >= n else "No")