結果

問題 No.583 鉄道同好会
ユーザー ふーらくたる
提出日時 2018-01-14 08:06:55
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 420 bytes
コンパイル時間 594 ms
コンパイル使用メモリ 68,604 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-24 02:31:29
合計ジャッジ時間 1,557 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;

int main() {
    int N, M;
    cin >> N >> M;

    vector<int> deg(N, 0);
    for (int i = 0; i < M; i++) {
        int a, b;
        cin >> a >> b;
        deg[a]++; deg[b]++;
    }
    int cnt = 0;
    for (int i = 0; i < N; i++) {
        cnt += deg[i] & 1;
    }
    
    if (cnt <= 2) cout << "YES" << endl;
    else cout << "NO" << endl;

    return 0;
}
0