結果

問題 No.408 五輪ピック
ユーザー t98slidert98slider
提出日時 2022-07-18 02:26:47
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 685 bytes
コンパイル時間 1,887 ms
コンパイル使用メモリ 173,124 KB
実行使用メモリ 4,828 KB
最終ジャッジ日時 2023-09-12 13:50:29
合計ジャッジ時間 3,896 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 22 ms
4,376 KB
testcase_06 AC 16 ms
4,420 KB
testcase_07 AC 23 ms
4,480 KB
testcase_08 AC 19 ms
4,376 KB
testcase_09 AC 20 ms
4,376 KB
testcase_10 WA -
testcase_11 AC 15 ms
4,376 KB
testcase_12 AC 27 ms
4,748 KB
testcase_13 AC 22 ms
4,376 KB
testcase_14 WA -
testcase_15 AC 21 ms
4,384 KB
testcase_16 AC 24 ms
4,380 KB
testcase_17 AC 27 ms
4,484 KB
testcase_18 AC 29 ms
4,420 KB
testcase_19 AC 31 ms
4,628 KB
testcase_20 AC 9 ms
4,376 KB
testcase_21 AC 5 ms
4,376 KB
testcase_22 AC 14 ms
4,380 KB
testcase_23 AC 31 ms
4,828 KB
testcase_24 WA -
testcase_25 AC 22 ms
4,376 KB
testcase_26 AC 32 ms
4,824 KB
testcase_27 AC 22 ms
4,384 KB
testcase_28 AC 18 ms
4,376 KB
testcase_29 AC 17 ms
4,380 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    int n, m, u, v;
    cin >> n >> m;
    vector<vector<int>> g(n);
    vector<pair<int,int>> edge(m);
    for(int i = 0; i < m; i++){
        cin >> u >> v;
        edge[i] = {--u, -- v};
        g[u].push_back(v);
        g[v].push_back(u);
    }
    vector<int> used(n);
    int cnt = 0;
    for(auto &&u:g[0]){
        cnt++;
        for(auto &&v:g[u]){
            used[v] ^= cnt;
        }
    }
    for(int i = 0; i < m; i++){
        tie(u, v) = edge[i];
        if(!(u & v))continue;
        if(used[u] && used[v]){
            cout << "YES" << '\n';
            return 0;
        }
    }
    cout << "NO" << '\n';
}
0