結果
問題 |
No.1563 Same Degree
|
ユーザー |
|
提出日時 | 2022-09-03 20:51:45 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 346 ms / 2,000 ms |
コード長 | 562 bytes |
コンパイル時間 | 333 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 31,744 KB |
最終ジャッジ日時 | 2024-11-17 11:59:04 |
合計ジャッジ時間 | 4,319 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 15 |
ソースコード
from collections import * from itertools import * from functools import * from heapq import * import sys,math input = sys.stdin.readline def answer(): N,M = map(int,input().split()) e = [[] for _ in range(N)] for _ in range(M): u,v = map(int,input().split()) u -= 1 v -= 1 e[u].append(v) e[v].append(u) used = [0]*(N+1) for i in range(N): used[len(e[i])] += 1 if used[len(e[i])]==2: print('Yes') return print('No') for _ in range(int(input())): answer()