結果

問題 No.583 鉄道同好会
ユーザー snrnsidy
提出日時 2025-09-08 16:42:22
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 494 bytes
コンパイル時間 2,118 ms
コンパイル使用メモリ 191,436 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-09-08 16:42:25
合計ジャッジ時間 3,356 ms
ジャッジサーバーID
(参考情報)
judge2 / judge
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int degree[501];
int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n,m,a,b;
    cin >> n >> m;
    for(int i=0;i<m;i++)
    {
        cin >> a >> b;
        degree[a]+=1;
        degree[b]+=1;
    }

    int cnt = 0;
    for(int i=0;i<n;i++)
    {
        if(degree[i]%2==1) cnt+=1;
    }

    if(cnt!=0 && cnt!=2)
    {
        cout << "NO" << '\n';
        return 0;
    }

    cout << "YES" << '\n';
    return 0;   
}
0