結果

問題 No.1563 Same Degree
ユーザー hiragnhiragn
提出日時 2022-11-05 06:09:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 793 ms / 2,000 ms
コード長 533 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 10,980 KB
実行使用メモリ 61,948 KB
最終ジャッジ日時 2023-09-26 07:10:20
合計ジャッジ時間 6,372 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,600 KB
testcase_01 AC 264 ms
8,764 KB
testcase_02 AC 240 ms
8,652 KB
testcase_03 AC 238 ms
8,692 KB
testcase_04 AC 250 ms
8,732 KB
testcase_05 AC 252 ms
8,668 KB
testcase_06 AC 241 ms
8,516 KB
testcase_07 AC 255 ms
8,596 KB
testcase_08 AC 245 ms
8,532 KB
testcase_09 AC 242 ms
8,676 KB
testcase_10 AC 239 ms
8,536 KB
testcase_11 AC 109 ms
20,044 KB
testcase_12 AC 215 ms
30,580 KB
testcase_13 AC 638 ms
56,440 KB
testcase_14 AC 793 ms
61,948 KB
testcase_15 AC 448 ms
43,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections


def main():
    t = int(input())

    for _ in range(t):
        n, m = map(int, input().split())
        if n == 1:
            print("No")
            continue

        d = collections.defaultdict(set)
        for _ in range(m):
            fr, to = map(int, input().split())
            d[fr].add(to)
            d[to].add(fr)

        lst = list(map(len, dict(d).values()))
        if len(set(lst)) != n:
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    main()
0