結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,096 KB
testcase_01 AC 39 ms
52,096 KB
testcase_02 AC 39 ms
51,712 KB
testcase_03 AC 38 ms
51,968 KB
testcase_04 AC 40 ms
51,840 KB
testcase_05 AC 38 ms
51,840 KB
testcase_06 WA -
testcase_07 AC 37 ms
51,584 KB
testcase_08 AC 37 ms
51,968 KB
testcase_09 AC 163 ms
84,724 KB
testcase_10 AC 165 ms
84,944 KB
testcase_11 AC 138 ms
81,776 KB
testcase_12 AC 158 ms
84,652 KB
testcase_13 AC 102 ms
78,080 KB
testcase_14 AC 153 ms
81,720 KB
testcase_15 AC 42 ms
53,248 KB
testcase_16 AC 134 ms
81,664 KB
testcase_17 AC 141 ms
81,708 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 73 ms
74,112 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 195 ms
89,392 KB
testcase_28 AC 147 ms
88,612 KB
testcase_29 AC 154 ms
88,552 KB
testcase_30 AC 156 ms
88,780 KB
testcase_31 AC 155 ms
89,032 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)==1for i in m)==n-1 or all(len(i)<3for i in m))::2])
0