結果

問題 No.1563 Same Degree
ユーザー 炭酸水炭酸水
提出日時 2022-05-14 03:58:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 394 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 10,708 KB
実行使用メモリ 9,284 KB
最終ジャッジ日時 2023-09-29 15:42:17
合計ジャッジ時間 6,992 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,832 KB
testcase_01 WA -
testcase_02 AC 252 ms
7,864 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 82 ms
8,936 KB
testcase_12 AC 157 ms
8,996 KB
testcase_13 AC 416 ms
9,272 KB
testcase_14 AC 475 ms
9,252 KB
testcase_15 AC 311 ms
9,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):

    n, m = map(int, input().split())
    a = [0 for _ in range(n)]
    for i in range(m):
        v, u = map(int, input().split())
        a[v - 1] += 1
        a[u - 1] += 1
    a.sort()
    ans = True
    for i in range(n - 1):
        if a[i] == a[i - 1]:
            ans = False
            break
    if ans:
        print("No")
    else:
        print("Yes")
0