結果
| 問題 |
No.583 鉄道同好会
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-24 17:45:23 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 779 bytes |
| コンパイル時間 | 616 ms |
| コンパイル使用メモリ | 60,028 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-25 03:11:03 |
| 合計ジャッジ時間 | 2,061 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 WA * 2 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main(){
int station;
int strain;
int start, end;
vector<int> stationflag;
int odd=0;
int even=0;
cin>>station>>strain;
stationflag.resize(station);
for(int i=0; i<strain; ++i)
{
cin>>start>>end;
stationflag[start]++;
stationflag[end]++;
}
for(int i=0; i<station; ++i)
{
if(stationflag[i] % 2 == 0)
even++;
else
odd++;
}
if(station%2==0)
{
if(odd==2 || odd == 0)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
else
{
if(odd==2)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
return 0;
}