結果

問題 No.583 鉄道同好会
ユーザー kurenai3110kurenai3110
提出日時 2017-10-27 23:05:45
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 429 bytes
コンパイル時間 563 ms
コンパイル使用メモリ 63,948 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-21 22:46:56
合計ジャッジ時間 1,580 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main()
{
	int N, M; cin >> N >> M;
	vector<vector<int>>E(N);
	for (int i = 0; i < M; i++) {
		int a, b; cin >> a >> b;
		E[a].push_back(b);
		E[b].push_back(a);
	}

	int cnt = 0;
	for (int i = 0; i < N; i++) {
		if (E[i].size() % 2)cnt++;
	}

	if (cnt <= 2)cout << "YES" << endl;
	else cout << "NO" << endl;

    return 0;
}

0