結果

問題 No.1563 Same Degree
ユーザー ygd.ygd.
提出日時 2021-06-28 19:43:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 543 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 91,196 KB
最終ジャッジ日時 2023-09-07 20:39:37
合計ジャッジ時間 4,796 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,152 KB
testcase_01 WA -
testcase_02 WA -
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 117 ms
82,016 KB
testcase_12 AC 140 ms
84,616 KB
testcase_13 AC 222 ms
90,208 KB
testcase_14 AC 238 ms
91,196 KB
testcase_15 AC 193 ms
89,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    T = int(input())
    for _ in range(T):
        N,M = map(int,input().split())
        G = [[] for _ in range(N)]
        for i in range(M):
            u,v = map(int,input().split())
            u-=1;v=-1
            G[u].append(v)
            G[v].append(u)
        s = set([])
        for i in range(N):
            t = len(G[i])
            if t in s:
                print("Yes")
                break
            else:
                s.add(t)
        else:
            print("No")


if __name__ == '__main__':
    main()
0