結果

問題 No.1563 Same Degree
ユーザー wgrapewgrape
提出日時 2023-11-08 16:55:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 266 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 399 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 87,280 KB
最終ジャッジ日時 2023-11-08 16:55:49
合計ジャッジ時間 5,632 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 163 ms
76,432 KB
testcase_02 AC 163 ms
76,424 KB
testcase_03 AC 174 ms
76,548 KB
testcase_04 AC 177 ms
77,072 KB
testcase_05 AC 212 ms
76,792 KB
testcase_06 AC 236 ms
78,224 KB
testcase_07 AC 244 ms
77,928 KB
testcase_08 AC 239 ms
78,516 KB
testcase_09 AC 236 ms
77,692 KB
testcase_10 AC 265 ms
78,040 KB
testcase_11 AC 95 ms
80,356 KB
testcase_12 AC 130 ms
83,188 KB
testcase_13 AC 247 ms
87,280 KB
testcase_14 AC 266 ms
86,992 KB
testcase_15 AC 200 ms
85,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for _ in range(T):
    N,M = map(int,input().split())
    G = [[] for i in range(N)]
    for _ in range(M):
        u,v = map(int,input().split())
        G[u - 1].append(v - 1)
        G[v - 1].append(u - 1)
    cnt = set()
    for i in range(N):
        c = len(G[i])
        if c in cnt:
            print("Yes")
            break
        cnt.add(c)
    else:
        print("No")
0