結果

問題 No.1563 Same Degree
ユーザー れいん
提出日時 2025-06-04 19:59:29
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 698 bytes
コンパイル時間 3,309 ms
コンパイル使用メモリ 281,056 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-06-04 19:59:35
合計ジャッジ時間 6,023 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int T;
    cin >> T;
    for (int i = 0; i < T; i++)
    {
        int N, M;
        cin >> N >> M;
        vector<int> V(N);
        for (int j = 0; j < M; j++)
        {
            int u, v;
            cin >> u >> v;
            u--;
            v--;
            V[u]++;
            V[v]++;
        }
        set<int> st;
        bool ok = false;
        for (auto v : V)
        {
            if (st.count(v))
            {
                ok = true;
                cout << "Yes\n";
                break;
            }
            st.insert(v);
        }
        if (!ok)
        {
            cout << "No\n";
        }
    }
}
0