結果

問題 No.3107 Listening
ユーザー 👑 nu50218nu50218
提出日時 2024-04-01 21:32:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 318 ms / 2,000 ms
コード長 925 bytes
コンパイル時間 3,349 ms
コンパイル使用メモリ 219,044 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2024-04-01 21:33:04
合計ジャッジ時間 20,068 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 2 ms
6,548 KB
testcase_03 AC 154 ms
6,548 KB
testcase_04 AC 32 ms
6,548 KB
testcase_05 AC 62 ms
6,548 KB
testcase_06 AC 40 ms
6,548 KB
testcase_07 AC 120 ms
6,548 KB
testcase_08 AC 83 ms
6,548 KB
testcase_09 AC 94 ms
6,548 KB
testcase_10 AC 143 ms
6,548 KB
testcase_11 AC 188 ms
6,548 KB
testcase_12 AC 84 ms
6,548 KB
testcase_13 AC 153 ms
6,548 KB
testcase_14 AC 100 ms
6,548 KB
testcase_15 AC 58 ms
6,548 KB
testcase_16 AC 45 ms
6,548 KB
testcase_17 AC 66 ms
6,548 KB
testcase_18 AC 22 ms
6,548 KB
testcase_19 AC 118 ms
6,548 KB
testcase_20 AC 122 ms
6,548 KB
testcase_21 AC 233 ms
6,548 KB
testcase_22 AC 158 ms
6,548 KB
testcase_23 AC 216 ms
6,548 KB
testcase_24 AC 186 ms
6,548 KB
testcase_25 AC 142 ms
6,548 KB
testcase_26 AC 64 ms
6,548 KB
testcase_27 AC 93 ms
6,548 KB
testcase_28 AC 174 ms
6,548 KB
testcase_29 AC 197 ms
6,548 KB
testcase_30 AC 100 ms
6,548 KB
testcase_31 AC 117 ms
6,548 KB
testcase_32 AC 166 ms
6,548 KB
testcase_33 AC 318 ms
6,548 KB
testcase_34 AC 314 ms
6,548 KB
testcase_35 AC 316 ms
6,548 KB
testcase_36 AC 313 ms
6,548 KB
testcase_37 AC 316 ms
6,548 KB
testcase_38 AC 312 ms
6,548 KB
testcase_39 AC 314 ms
6,548 KB
testcase_40 AC 314 ms
6,548 KB
testcase_41 AC 315 ms
6,548 KB
testcase_42 AC 312 ms
6,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#ifdef LOCAL
#include <local.hpp>
#else
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2")
#include <bits/stdc++.h>
#define debug(...) ((void)0)
#define postprocess(...) ((void)0)
#endif

using namespace std;
using ll = long long;
using ld = long double;

void solve([[maybe_unused]] int test) {
    int N, M;
    cin >> N >> M;

    bool used[200010] = {};

    vector<int> ans;
    for (int i = 1; i <= M; i++) {
        int u, v;
        cin >> u >> v;
        if (!used[u] && !used[v]) {
            ans.emplace_back(i);
            used[u] = used[v] = true;
        }
    }

    cout << ans.size() << endl;
    for (int i = 0; i < (int)ans.size(); i++) {
        cout << ans[i] << endl;
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t = 1;
    // cin >> t;
    for (int i = 1; i <= t; i++) {
        solve(i);
    }

    postprocess();
}
0