結果

問題 No.583 鉄道同好会
ユーザー mitsuo
提出日時 2017-12-31 16:46:41
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 447 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 31,232 KB
最終ジャッジ日時 2024-12-21 15:29:01
合計ジャッジ時間 3,867 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

def solve(N, M, data):
    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))
0