結果

問題 No.1563 Same Degree
ユーザー miya145592miya145592
提出日時 2023-05-07 03:22:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 210 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 82,580 KB
実行使用メモリ 88,480 KB
最終ジャッジ日時 2024-11-24 06:05:12
合計ジャッジ時間 3,875 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
51,840 KB
testcase_01 AC 130 ms
76,740 KB
testcase_02 AC 130 ms
76,668 KB
testcase_03 AC 124 ms
76,928 KB
testcase_04 AC 128 ms
76,672 KB
testcase_05 AC 143 ms
77,568 KB
testcase_06 AC 163 ms
77,316 KB
testcase_07 AC 181 ms
77,172 KB
testcase_08 AC 184 ms
78,028 KB
testcase_09 AC 177 ms
77,696 KB
testcase_10 AC 170 ms
77,168 KB
testcase_11 AC 89 ms
81,664 KB
testcase_12 AC 114 ms
84,608 KB
testcase_13 AC 199 ms
88,480 KB
testcase_14 AC 210 ms
88,320 KB
testcase_15 AC 169 ms
87,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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