結果

問題 No.1563 Same Degree
ユーザー matcharate12matcharate12
提出日時 2022-03-17 18:15:03
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 605 bytes
コンパイル時間 1,625 ms
コンパイル使用メモリ 170,416 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-09 03:15:26
合計ジャッジ時間 3,573 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,820 KB
testcase_01 AC 36 ms
6,944 KB
testcase_02 AC 34 ms
6,944 KB
testcase_03 AC 34 ms
6,944 KB
testcase_04 AC 36 ms
6,944 KB
testcase_05 AC 36 ms
6,944 KB
testcase_06 AC 38 ms
6,948 KB
testcase_07 AC 38 ms
6,944 KB
testcase_08 AC 39 ms
6,944 KB
testcase_09 AC 38 ms
6,944 KB
testcase_10 AC 38 ms
6,948 KB
testcase_11 AC 16 ms
6,948 KB
testcase_12 AC 31 ms
6,944 KB
testcase_13 AC 82 ms
6,948 KB
testcase_14 AC 95 ms
6,944 KB
testcase_15 AC 64 ms
6,948 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:25:27: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   25 |                 for(auto& [k,v] : M) if(v >= 2) ok = 1;
      |                           ^

ソースコード

diff #

#include <bits/stdc++.h>
#include <string.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define srep(i,a,b) for(int i = a; i < b; i++)
#define all(A) (A).begin(),A.end()
#define MOD 1000000007
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;

int main(void){
	int t; cin >> t;
	rep(i,t){
		int n,m; cin >> n >> m;
		vector<int> C(n);
		rep(i,m){
			int a,b; cin >> a >> b;
			a--; b--;
			C[a]++; C[b]++;
		}
		map<int,int> M;
		rep(i,n) M[C[i]]++;
		bool ok = 0;
		for(auto& [k,v] : M) if(v >= 2) ok = 1;
		cout << (ok ? "Yes" : "No") << endl;
	}
}
0