結果

問題 No.1563 Same Degree
ユーザー KudeKude
提出日時 2021-06-26 13:04:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 312 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 678 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 81,796 KB
最終ジャッジ日時 2023-09-07 16:15:23
合計ジャッジ時間 5,167 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,568 KB
testcase_01 AC 217 ms
78,660 KB
testcase_02 AC 204 ms
78,748 KB
testcase_03 AC 202 ms
78,516 KB
testcase_04 AC 202 ms
78,476 KB
testcase_05 AC 222 ms
79,892 KB
testcase_06 AC 300 ms
80,860 KB
testcase_07 AC 297 ms
79,772 KB
testcase_08 AC 312 ms
81,796 KB
testcase_09 AC 300 ms
80,524 KB
testcase_10 AC 300 ms
79,816 KB
testcase_11 AC 133 ms
78,716 KB
testcase_12 AC 147 ms
78,568 KB
testcase_13 AC 188 ms
78,492 KB
testcase_14 AC 200 ms
78,480 KB
testcase_15 AC 175 ms
78,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
for _ in range(int(input())):
    n, m = map(int, input().split())
    deg = [0] * n
    for _ in range(m):
        u, v = map(int, input().split())
        deg[u - 1] += 1
        deg[v - 1] += 1
    print('Yes' if any(v >= 2 for k, v in Counter(deg).items()) else 'No')
0