結果

問題 No.1424 Ultrapalindrome
ユーザー ryuusagiryuusagi
提出日時 2021-03-12 22:21:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 256 bytes
コンパイル時間 376 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 89,524 KB
最終ジャッジ日時 2024-04-22 13:23:38
合計ジャッジ時間 5,011 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,096 KB
testcase_01 AC 36 ms
51,840 KB
testcase_02 AC 38 ms
51,584 KB
testcase_03 AC 38 ms
51,968 KB
testcase_04 AC 37 ms
51,712 KB
testcase_05 AC 39 ms
51,840 KB
testcase_06 WA -
testcase_07 AC 38 ms
51,840 KB
testcase_08 AC 38 ms
51,840 KB
testcase_09 AC 161 ms
84,852 KB
testcase_10 AC 168 ms
84,996 KB
testcase_11 AC 139 ms
81,656 KB
testcase_12 AC 165 ms
84,268 KB
testcase_13 AC 98 ms
77,824 KB
testcase_14 AC 140 ms
81,988 KB
testcase_15 AC 40 ms
52,736 KB
testcase_16 AC 127 ms
81,536 KB
testcase_17 AC 141 ms
81,960 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 78 ms
74,368 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 200 ms
89,524 KB
testcase_28 AC 152 ms
88,420 KB
testcase_29 AC 150 ms
88,424 KB
testcase_30 AC 149 ms
88,780 KB
testcase_31 AC 158 ms
88,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
m = [[] for _ in [0]*n] # 近傍
for _ in [0]*(n-1):
    a, b = map(int, input().split())
    m[a-1] += [b-1]
    m[b-1] += [a-1]
print('YNeos'[not(sum(len(i)>2for i in m)==1 and sum(len(i)==2for i in m)==0 or all(len(i)<3for i in m))::2])
0