結果

問題 No.1563 Same Degree
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-06-26 14:47:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 218 ms / 2,000 ms
コード長 335 bytes
コンパイル時間 501 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 79,996 KB
最終ジャッジ日時 2023-09-07 16:43:40
合計ジャッジ時間 4,139 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,164 KB
testcase_01 AC 189 ms
77,836 KB
testcase_02 AC 189 ms
78,224 KB
testcase_03 AC 191 ms
77,892 KB
testcase_04 AC 194 ms
78,580 KB
testcase_05 AC 188 ms
78,048 KB
testcase_06 AC 216 ms
79,748 KB
testcase_07 AC 212 ms
79,940 KB
testcase_08 AC 216 ms
79,996 KB
testcase_09 AC 215 ms
79,852 KB
testcase_10 AC 218 ms
79,740 KB
testcase_11 AC 114 ms
79,004 KB
testcase_12 AC 130 ms
79,060 KB
testcase_13 AC 192 ms
79,152 KB
testcase_14 AC 210 ms
78,864 KB
testcase_15 AC 170 ms
79,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    n,m = map(int,input().split())
    e = [0]*n
    for i in range(m):
        a,b = [int(x)-1 for x in input().split()]
        e[a] += 1
        e[b] += 1
    c = [0]*(n+1)
    for i in e:
        if c[i]:
            return "Yes"
        c[i] += 1
    return "No"
t = int(input())
for _ in range(t):
    print(solve())
0