結果

問題 No.1563 Same Degree
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-06-26 14:47:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 195 ms / 2,000 ms
コード長 335 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 78,208 KB
最終ジャッジ日時 2024-06-25 10:36:42
合計ジャッジ時間 3,645 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    n,m = map(int,input().split())
    e = [0]*n
    for i in range(m):
        a,b = [int(x)-1 for x in input().split()]
        e[a] += 1
        e[b] += 1
    c = [0]*(n+1)
    for i in e:
        if c[i]:
            return "Yes"
        c[i] += 1
    return "No"
t = int(input())
for _ in range(t):
    print(solve())
0