結果

問題 No.583 鉄道同好会
ユーザー mitsuomitsuo
提出日時 2017-12-31 16:46:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 447 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,712 KB
実行使用メモリ 29,040 KB
最終ジャッジ日時 2023-08-23 12:30:33
合計ジャッジ時間 3,549 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,564 KB
testcase_01 AC 21 ms
8,508 KB
testcase_02 AC 20 ms
8,492 KB
testcase_03 AC 19 ms
8,568 KB
testcase_04 WA -
testcase_05 AC 19 ms
8,572 KB
testcase_06 AC 19 ms
8,420 KB
testcase_07 AC 18 ms
8,472 KB
testcase_08 AC 19 ms
8,424 KB
testcase_09 AC 19 ms
8,516 KB
testcase_10 AC 20 ms
8,520 KB
testcase_11 AC 127 ms
13,280 KB
testcase_12 AC 169 ms
15,264 KB
testcase_13 AC 170 ms
15,292 KB
testcase_14 AC 168 ms
15,280 KB
testcase_15 AC 217 ms
17,240 KB
testcase_16 AC 412 ms
25,296 KB
testcase_17 AC 508 ms
28,988 KB
testcase_18 AC 498 ms
29,040 KB
権限があれば一括ダウンロードができます

ソースコード

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