結果
問題 |
No.1563 Same Degree
|
ユーザー |
![]() |
提出日時 | 2022-11-05 06:05:27 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 533 bytes |
コンパイル時間 | 153 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 64,084 KB |
最終ジャッジ日時 | 2024-07-19 02:23:29 |
合計ジャッジ時間 | 5,602 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 5 WA * 10 |
ソースコード
import collections def main(): t = int(input()) for _ in range(t): n, m = map(int, input().split()) if n == 1: print("YES") continue d = collections.defaultdict(set) for _ in range(m): fr, to = map(int, input().split()) d[fr].add(to) d[to].add(fr) lst = list(map(len, dict(d).values())) if len(set(lst)) != n: print("Yes") else: print("No") if __name__ == "__main__": main()