結果
| 問題 | No.1719 Tree and Permutation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-23 17:12:45 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 140 ms / 2,000 ms |
| + 30µs | |
| コード長 | 337 bytes |
| 記録 | |
| コンパイル時間 | 237 ms |
| コンパイル使用メモリ | 95,944 KB |
| 実行使用メモリ | 86,528 KB |
| 最終ジャッジ日時 | 2026-09-02 22:36:13 |
| 合計ジャッジ時間 | 2,930 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 6 |
ソースコード
import sys
input = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
T = int(input())
for _ in range(T):
N = int(input())
deg = [0] * N
for _ in range(N - 1):
u, v = map(int, input().split())
u -= 1; v -= 1
deg[u] += 1
deg[v] += 1
print("Yes" if deg.count(1) * 2 >= N else "No")