結果

問題 No.1563 Same Degree
ユーザー KudeKude
提出日時 2021-06-26 13:04:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 269 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 78,688 KB
最終ジャッジ日時 2024-06-25 10:09:08
合計ジャッジ時間 3,850 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
for _ in range(int(input())):
    n, m = map(int, input().split())
    deg = [0] * n
    for _ in range(m):
        u, v = map(int, input().split())
        deg[u - 1] += 1
        deg[v - 1] += 1
    print('Yes' if any(v >= 2 for k, v in Counter(deg).items()) else 'No')
0