結果

問題 No.1563 Same Degree
ユーザー dangodango
提出日時 2023-06-25 13:03:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 212 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 1,784 ms
コンパイル使用メモリ 86,624 KB
実行使用メモリ 78,864 KB
最終ジャッジ日時 2023-09-15 08:55:05
合計ジャッジ時間 5,937 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
70,992 KB
testcase_01 AC 154 ms
77,504 KB
testcase_02 AC 155 ms
77,724 KB
testcase_03 AC 155 ms
77,672 KB
testcase_04 AC 158 ms
77,736 KB
testcase_05 AC 179 ms
78,360 KB
testcase_06 AC 195 ms
77,924 KB
testcase_07 AC 198 ms
78,600 KB
testcase_08 AC 206 ms
78,484 KB
testcase_09 AC 192 ms
78,628 KB
testcase_10 AC 212 ms
78,804 KB
testcase_11 AC 115 ms
78,864 KB
testcase_12 AC 124 ms
78,648 KB
testcase_13 AC 169 ms
78,712 KB
testcase_14 AC 178 ms
78,832 KB
testcase_15 AC 156 ms
78,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    N, M = map(int, input().split())
    cnts = [0] * N
    for i in range(M):
        U, V = map(int, input().split())
        cnts[U - 1] += 1
        cnts[V - 1] += 1
    isO = False
    isS = [False] * N
    for c in cnts:
        isO |= isS[c]
        isS[c] = True
    print("Yes" if isO else "No")
0