結果

問題 No.1563 Same Degree
ユーザー FromBooskaFromBooska
提出日時 2023-06-18 19:38:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 278 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 858 ms
コンパイル使用メモリ 86,904 KB
実行使用メモリ 82,108 KB
最終ジャッジ日時 2023-09-08 15:44:26
合計ジャッジ時間 6,077 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,740 KB
testcase_01 AC 184 ms
78,652 KB
testcase_02 AC 185 ms
78,832 KB
testcase_03 AC 181 ms
78,756 KB
testcase_04 AC 185 ms
78,604 KB
testcase_05 AC 201 ms
78,928 KB
testcase_06 AC 264 ms
81,096 KB
testcase_07 AC 267 ms
81,312 KB
testcase_08 AC 267 ms
80,876 KB
testcase_09 AC 267 ms
82,108 KB
testcase_10 AC 278 ms
81,800 KB
testcase_11 AC 127 ms
78,620 KB
testcase_12 AC 138 ms
78,896 KB
testcase_13 AC 184 ms
78,808 KB
testcase_14 AC 194 ms
78,724 KB
testcase_15 AC 168 ms
78,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

T = int(input())
for t in range(T):
    N, M = map(int, input().split())
    deg = [0]*N
    for i in range(M):
        u, v = map(int, input().split())
        deg[u-1] += 1
        deg[v-1] += 1
    counted = Counter(deg)
    mx = max(counted.values())
    if mx > 1:
        print('Yes')
    else:
        print('No')
0