結果

問題 No.1563 Same Degree
ユーザー DrDrpilotDrDrpilot
提出日時 2022-01-24 14:13:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 473 ms / 2,000 ms
コード長 356 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 9,156 KB
最終ジャッジ日時 2023-08-21 01:48:21
合計ジャッジ時間 6,526 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,428 KB
testcase_01 AC 263 ms
8,588 KB
testcase_02 AC 258 ms
8,524 KB
testcase_03 AC 250 ms
8,620 KB
testcase_04 AC 265 ms
8,640 KB
testcase_05 AC 257 ms
8,524 KB
testcase_06 AC 274 ms
8,632 KB
testcase_07 AC 272 ms
8,476 KB
testcase_08 AC 269 ms
8,628 KB
testcase_09 AC 271 ms
8,536 KB
testcase_10 AC 267 ms
8,484 KB
testcase_11 AC 85 ms
9,156 KB
testcase_12 AC 152 ms
9,084 KB
testcase_13 AC 412 ms
8,984 KB
testcase_14 AC 473 ms
9,016 KB
testcase_15 AC 316 ms
9,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t=int(input())
for _ in range(t):
    n,m=map(int,input().split())
    g=[0]*n
    for _ in range(m):
        u,v=map(int,input().split())
        g[u-1]+=1
        g[v-1]+=1
    from collections import Counter
    l=Counter(g)
    f=False
    for key,val in l.items():
        if val>=2:
            f=True
            break
    print('Yes'if f else 'No')
0