結果

問題 No.1563 Same Degree
ユーザー chacoder1chacoder1
提出日時 2021-12-29 10:43:25
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 524 bytes
コンパイル時間 2,274 ms
コンパイル使用メモリ 204,028 KB
実行使用メモリ 9,472 KB
最終ジャッジ日時 2024-04-14 16:05:51
合計ジャッジ時間 4,747 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 42 ms
6,940 KB
testcase_02 AC 41 ms
6,944 KB
testcase_03 AC 40 ms
6,944 KB
testcase_04 AC 42 ms
6,940 KB
testcase_05 AC 42 ms
6,940 KB
testcase_06 AC 44 ms
6,940 KB
testcase_07 AC 44 ms
6,940 KB
testcase_08 AC 43 ms
6,944 KB
testcase_09 AC 43 ms
6,944 KB
testcase_10 AC 42 ms
6,940 KB
testcase_11 AC 22 ms
6,944 KB
testcase_12 AC 45 ms
7,680 KB
testcase_13 AC 123 ms
9,088 KB
testcase_14 AC 144 ms
9,472 KB
testcase_15 AC 95 ms
8,436 KB
権限があれば一括ダウンロードができます

ソースコード

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