結果
| 問題 |
No.583 鉄道同好会
|
| コンテスト | |
| ユーザー |
Kutimoti_T
|
| 提出日時 | 2018-06-24 16:10:17 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 465 bytes |
| コンパイル時間 | 1,234 ms |
| コンパイル使用メモリ | 160,404 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-30 22:31:15 |
| 合計ジャッジ時間 | 3,731 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | AC * 3 WA * 1 RE * 12 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
int main(){
int N;
cin >> N;
int M;
cin >> M;
vector<int> cnt(N + 1,0);
rep(i,0,M - 1){
int a,b;
cin >> a >> b;
a--;
b--;
cnt[a]++;
cnt[b]++;
}
int ans = 0;
rep(i,0,N - 1){
ans += cnt[i] % 2;
}
if(ans == 0 || ans == 2){
cout << "YES" << endl;
}
else{
cout << "NO" << endl; }
}
Kutimoti_T