結果
問題 |
No.583 鉄道同好会
|
ユーザー |
|
提出日時 | 2017-12-31 16:47:56 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 485 bytes |
コンパイル時間 | 313 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 31,232 KB |
最終ジャッジ日時 | 2024-12-21 15:29:09 |
合計ジャッジ時間 | 3,885 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 1 |
ソースコード
import collections def solve(N, M, data): if M == 1: return "YES" count = collections.Counter() for d in data: count.update(d) oddcount = 0 for key, val in count.items(): if val % 2 == 1: oddcount += 1 return "YES" if oddcount <= 2 else "NO" if __name__ == '__main__': N, M = map(int, input().split()) d = [] for _ in range(0, M): d.append(list(map(int, input().split()))) print(solve(N, M, d))