結果

問題 No.1563 Same Degree
ユーザー take000
提出日時 2021-07-02 23:28:55
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 555 bytes
コンパイル時間 2,428 ms
コンパイル使用メモリ 199,532 KB
最終ジャッジ日時 2025-01-22 16:57:21
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int T;
    cin >> T;
    while (T--) {
        int N, M;
        cin >> N >> M;
        vector<int> d(N);
        rep(i, M) {
            int u, v;
            cin >> u >> v;
            u--, v--;
            d[u]++;
            d[v]++;
        }
        set<int> st;
        rep(i, N) st.insert(d[i]);
        if (st.size() == N)
            cout << "No\n";
        else
            cout << "Yes\n";
    }

    return 0;
}
0