結果

問題 No.583 鉄道同好会
ユーザー mogurockermogurocker
提出日時 2017-10-28 16:34:09
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 706 bytes
コンパイル時間 1,373 ms
コンパイル使用メモリ 160,728 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-01 21:00:03
合計ジャッジ時間 3,941 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 WA -
testcase_02 RE -
testcase_03 AC 2 ms
5,376 KB
testcase_04 RE -
testcase_05 WA -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main(int, const char**)’:
main.cpp:20:18: warning: ‘a’ may be used uninitialized [-Wmaybe-uninitialized]
   20 |                 a--; b--;
      |                 ~^~
main.cpp:19:21: note: ‘a’ declared here
   19 |                 int a, b;
      |                     ^
main.cpp:20:23: warning: ‘b’ may be used uninitialized [-Wmaybe-uninitialized]
   20 |                 a--; b--;
      |                      ~^~
main.cpp:19:24: note: ‘b’ declared here
   19 |                 int a, b;
      |                        ^

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define FORR(x, arr) for(auto& x:arr)
#define ITR(x, c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;
typedef pair<int, int> P;

int n, m;
vector<int> g[505];

int main(int argc, char const *argv[]) {
	ios_base::sync_with_stdio(false);
	cin >> n >> m;
	FOR(i, m) {
		int a, b;
		a--; b--;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	int cnt = 0;
	FOR(i, n) {
		if (g[i].size() & 1) cnt++;
	}
	cout << (cnt==0 || cnt==2 ? "YES" : "NO") << endl;
	return 0;
}
0