結果

問題 No.583 鉄道同好会
ユーザー ukohank517ukohank517
提出日時 2017-11-07 15:31:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,227 bytes
コンパイル時間 769 ms
コンパイル使用メモリ 91,976 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-03 06:54:50
合計ジャッジ時間 1,336 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 5 ms
5,376 KB
testcase_12 AC 6 ms
5,376 KB
testcase_13 AC 6 ms
5,376 KB
testcase_14 AC 7 ms
5,376 KB
testcase_15 AC 8 ms
5,376 KB
testcase_16 AC 14 ms
5,376 KB
testcase_17 AC 16 ms
5,376 KB
testcase_18 AC 16 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}

ll station[501];

void operat(ll a){
  if(station[a]==0) station[a]=1;
  else station[a]=0;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll N , M;
  cin >> N >> M;

  rep(i,M){
    ll a, b; cin >> a >> b;
    operat(a);
    operat(b);
  }

  ll ans = 0;
  rep(i,501){
    if(station[i]!=0) ans ++;
  }

  if(ans == 2 || ans == 0) cout << "YES" << endl;
  else cout << "NO" << endl;
  //cout << fixed << setprecision(16) << ans << endl;
  return 0;
}
0