結果

問題 No.1563 Same Degree
ユーザー mono_0812mono_0812
提出日時 2021-06-26 13:25:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 589 ms / 2,000 ms
コード長 1,626 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 10,904 KB
実行使用メモリ 55,896 KB
最終ジャッジ日時 2023-09-07 16:28:47
合計ジャッジ時間 5,271 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
10,920 KB
testcase_01 AC 166 ms
11,128 KB
testcase_02 AC 163 ms
11,028 KB
testcase_03 AC 159 ms
10,980 KB
testcase_04 AC 169 ms
11,040 KB
testcase_05 AC 166 ms
11,024 KB
testcase_06 AC 168 ms
11,012 KB
testcase_07 AC 166 ms
11,012 KB
testcase_08 AC 170 ms
10,948 KB
testcase_09 AC 166 ms
10,944 KB
testcase_10 AC 166 ms
11,016 KB
testcase_11 AC 210 ms
35,268 KB
testcase_12 AC 273 ms
37,540 KB
testcase_13 AC 526 ms
50,760 KB
testcase_14 AC 589 ms
55,896 KB
testcase_15 AC 404 ms
43,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect,collections,copy,heapq,itertools,math,string,sys,queue,time
from typing import Union, ValuesView
input = lambda: sys.stdin.readline().rstrip()
def I(): return input()
def IS(): return input().split()
def II(): return int(input())
def IIS(): return map(int,input().split())
def LIIS(): return list(map(int,input().split()))
def debug(*args): print(*args) if len(args)>0 else print(False);return
start_time=time.time()
def nt(): print(time.time()-start_time);return
def chmax(a: list, b: list) -> bool:
     assert len(a) == len(b) == 1, "1要素のlistを指定してください"
     if a[0] < b[0]:
         a[0] = b[0]
         return True
     return False
def chmin(a: list, b: list) -> bool:
    assert len(a) == len(b) == 1, "1要素のlistを指定してください"
    if a[0] > b[0]:
        a[0] = b[0]
        return True
    return False
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def Base_n_to_10(X,n):
    out = 0
    for i in range(1,len(str(X))+1):
        out += int(X[-i])*(n**(i-1))
    return out#int out
ragen=range
INF=10**20
MOD=10**9+7
from decimal import Decimal as d, DefaultContext
##############################################################################
t=II()
for i in range(t):
    n,m=IIS()
    li=[set() for j in range(n)]
    for j in range(m):
        u,v=IIS()
        li[u-1].add(v-1)
        li[v-1].add(u-1)
    co=collections.Counter([len(j)for j in li])
    f=False
    for j in co:
        if co[j]>=2:
            print("Yes")
            f=True
            break
    if not f:
        print("No")
0