結果

問題 No.1563 Same Degree
ユーザー convexineqconvexineq
提出日時 2021-07-09 07:28:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 77,696 KB
最終ジャッジ日時 2024-07-01 13:54:19
合計ジャッジ時間 4,129 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    n,m = map(int,input().split())
    d = [0]*n
    for _ in range(m):
        u,v = map(int,input().split())
        d[u-1] += 1
        d[v-1] += 1
    r = [0]*n
    for i in d:
        if r[i]:
            return "Yes"
        else:
            r[i] += 1
    return "No"

for _ in range(int(input())):
    print(solve())
0