結果

問題 No.1424 Ultrapalindrome
ユーザー ryuusagi
提出日時 2021-03-12 22:14:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 219 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 89,736 KB
最終ジャッジ日時 2024-10-14 12:43:46
合計ジャッジ時間 4,648 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 WA * 9
権限があれば一括ダウンロードができます

ソースコード

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'[sum(len(i)>1for i in m)>1 and any(len(i)>2for i in m)::2])
0