結果

問題 No.1563 Same Degree
ユーザー 👑 KazunKazun
提出日時 2021-06-27 21:41:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 475 bytes
コンパイル時間 408 ms
コンパイル使用メモリ 87,324 KB
実行使用メモリ 78,600 KB
最終ジャッジ日時 2023-09-07 18:08:45
合計ジャッジ時間 3,476 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,788 KB
testcase_01 AC 137 ms
78,408 KB
testcase_02 AC 137 ms
78,388 KB
testcase_03 AC 138 ms
78,304 KB
testcase_04 AC 137 ms
78,332 KB
testcase_05 AC 137 ms
78,208 KB
testcase_06 AC 153 ms
78,296 KB
testcase_07 AC 157 ms
78,600 KB
testcase_08 AC 150 ms
78,324 KB
testcase_09 AC 157 ms
78,400 KB
testcase_10 AC 154 ms
78,372 KB
testcase_11 AC 112 ms
78,220 KB
testcase_12 AC 118 ms
78,452 KB
testcase_13 AC 137 ms
78,304 KB
testcase_14 AC 143 ms
78,448 KB
testcase_15 AC 127 ms
78,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import defaultdict
input=sys.stdin.readline
write=sys.stdout.write\

T=int(input())
X=[0]*T
for case in range(T):
    N,M=map(int,input().split())
    deg=[0]*(N+1); deg[0]=-1

    for _ in range(M):
        u,v=map(int,input().split())
        deg[u]+=1
        deg[v]+=1

    C=defaultdict(int)
    for v in range(1,N+1):
        C[deg[v]]+=1

    if max(C.values())>=2:
        X[case]=1

write("\n".join(map(lambda x:"Yes" if x else "No",X)))
0