結果

問題 No.1563 Same Degree
ユーザー ytqm3ytqm3
提出日時 2021-06-26 14:11:15
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 1,943 bytes
コンパイル時間 2,588 ms
コンパイル使用メモリ 204,532 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-07 16:38:04
合計ジャッジ時間 3,658 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 33 ms
4,380 KB
testcase_02 AC 31 ms
4,380 KB
testcase_03 AC 31 ms
4,380 KB
testcase_04 AC 33 ms
4,380 KB
testcase_05 AC 32 ms
4,376 KB
testcase_06 AC 36 ms
4,376 KB
testcase_07 AC 36 ms
4,376 KB
testcase_08 AC 36 ms
4,380 KB
testcase_09 AC 36 ms
4,380 KB
testcase_10 AC 36 ms
4,376 KB
testcase_11 AC 15 ms
4,376 KB
testcase_12 AC 28 ms
4,384 KB
testcase_13 AC 74 ms
4,376 KB
testcase_14 AC 85 ms
4,376 KB
testcase_15 AC 57 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
typedef uint64_t u64;
typedef int64_t i64;
typedef long double f128;
using namespace std;

template<typename T>
void scan(T& n){
  cin>>n;
}

void scan(){}

template<typename T,class... Args>
void scan(T& n,Args&... args){
  scan(n);
  scan(args...);
}

template<typename T>
void scanall(T start,T end){
  for(;start!=end;++start){
    scan(*start);
  }
}

template<typename T>
void print(T n){
  cout<<n;
}

void print(){}

template<typename T,class... Args>
void print(T n,Args... args){
  print(n);
  print(args...);
}

template<typename T>
void println(T n){
  print(n);
  cout<<endl;
}

template<typename T,class... Args>
void println(T n,Args... args){
  print(n,' ');
  println(args...);
}

template<typename T>
void printall(T start,T end){
  if(start!=end){
    print(*start);
    for(++start;start!=end;++start){
      print(' ',*start);
    }
  }
  cout<<endl;
}

template<typename T>
void chmax(T& n,T m){
  n=max(n,m);
}

template<typename T>
void chmin(T& n,T m){
  n=min(n,m);
}

template<typename T,typename U>
T power(T a,U n){
  T res=1;
  while(n){
    res*=(n&1)?a:1;
    a*=a;
    n>>=1;
  }
  return res;
}

template<typename T>
struct combination{
  vector<T> fact;
  combination(const int Max=3000000):fact(Max+1,1){
    for(int i=2;i<=Max;++i){
      fact[i]=fact[i-1]*i;
    }
  }
  template<typename U>
  T nCk(U n,U k){
    if(n<k||n<0||k<0){
      return 0;
    }
    return fact[n]/fact[k]/fact[n-k];
  }
};

void solve();

int main(){
  cout<<fixed<<setprecision(15);
  bool is_multicase=true;
  int T=1;
  if(is_multicase){
    scan(T);
  }
  for(int i=0;i<T;++i){
    solve();
  }
  return 0;
}

void solve(){
  int N,M;
  scan(N,M);
  vector<int> A(N);
  for(int i=0;i<M;++i){
    int u,v;
    scan(u,v);
    A[u-1]++;
    A[v-1]++;
  }
  sort(A.begin(),A.end());
  A.erase(unique(A.begin(),A.end()),A.end());
  if(A.size()!=N){
    println("Yes");
  }
  else{
    println("No");
  }
}
0