結果

問題 No.1719 Tree and Permutation
ユーザー nok0nok0
提出日時 2021-09-16 22:01:24
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 445 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 81,844 KB
実行使用メモリ 80,356 KB
最終ジャッジ日時 2023-10-24 11:28:56
合計ジャッジ時間 3,813 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,576 KB
testcase_01 AC 445 ms
76,760 KB
testcase_02 AC 323 ms
76,472 KB
testcase_03 AC 335 ms
80,232 KB
testcase_04 AC 314 ms
80,304 KB
testcase_05 AC 316 ms
79,852 KB
testcase_06 AC 314 ms
80,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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")
0