結果

問題 No.1563 Same Degree
ユーザー chacoder1
提出日時 2021-12-29 10:43:25
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 524 bytes
コンパイル時間 2,065 ms
コンパイル使用メモリ 202,816 KB
最終ジャッジ日時 2025-01-27 07:27:02
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

signed main(){   
  int t;cin>>t;
  while(t--){
  int n,m;cin>>n>>m;
  vector<int>edge[n];  
  rep(i,m){
    int u,v;
    cin>>u>>v;
    u--;v--;
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  map<int,int>mp;
  rep(i,n){
    mp[edge[i].size()]++;
  }
    int flag=1;
  for(auto e:mp){
    if(e.second>1){
      cout<<"Yes"<<endl;
      flag=0;
      break;
    }
  }
    if(flag) cout<<"No"<<endl;
  }
    
  return 0;
}


     
0