結果

問題 No.1563 Same Degree
ユーザー ThetaTheta
提出日時 2023-01-27 19:34:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 386 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 214 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 8,852 KB
最終ジャッジ日時 2023-09-10 13:26:17
合計ジャッジ時間 5,531 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,808 KB
testcase_01 AC 217 ms
7,804 KB
testcase_02 AC 213 ms
7,860 KB
testcase_03 AC 213 ms
7,864 KB
testcase_04 AC 213 ms
7,916 KB
testcase_05 AC 209 ms
7,860 KB
testcase_06 AC 198 ms
7,768 KB
testcase_07 AC 199 ms
7,920 KB
testcase_08 AC 202 ms
7,772 KB
testcase_09 AC 202 ms
7,900 KB
testcase_10 AC 197 ms
7,816 KB
testcase_11 AC 68 ms
8,852 KB
testcase_12 AC 130 ms
8,832 KB
testcase_13 AC 347 ms
8,848 KB
testcase_14 AC 386 ms
8,772 KB
testcase_15 AC 268 ms
8,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    for _ in range(int(input())):
        N, M = map(int, input().split())
        degrees = [0] * N
        for _ in range(M):
            dep, dest = map(int, input().split())
            degrees[dep-1] += 1
            degrees[dest-1] += 1

        if len(degrees) != len(set(degrees)):
            print("Yes")
        else:
            print("No")


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