結果
| 問題 | No.1719 Tree and Permutation |
| コンテスト | |
| ユーザー |
nok0
|
| 提出日時 | 2021-09-16 22:01:24 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 324 ms / 2,000 ms |
| + 504µs | |
| コード長 | 253 bytes |
| 記録 | |
| コンパイル時間 | 237 ms |
| コンパイル使用メモリ | 95,700 KB |
| 実行使用メモリ | 88,704 KB |
| 最終ジャッジ日時 | 2026-09-02 22:35:52 |
| 合計ジャッジ時間 | 4,485 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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] += 1
deg[b] += 1
print("Yes" if deg.count(1) * 2 >= n else "No")
nok0