結果

問題 No.8107 Listening
ユーザー SnowBeenDidingSnowBeenDiding
提出日時 2024-04-01 23:22:10
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 556 bytes
コンパイル時間 6,055 ms
コンパイル使用メモリ 313,308 KB
実行使用メモリ 13,248 KB
最終ジャッジ日時 2024-09-30 22:46:59
合計ジャッジ時間 57,362 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#include <atcoder/all>
#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
using namespace std;
using namespace atcoder;

typedef long long ll;

int main() {
    int n, m;
    cin >> n >> m;
    set<int> st;
    vector<int> ans(n);
    rep(i, 0, m) {
        int a, b;
        cin >> a >> b;
        if (!st.count(a) && !st.count(b)) {
            st.insert(a);
            st.insert(b);
            ans.push_back(i + 1);
        }
    }
    cout << ans.size() << endl;
    rep(i, 0, ans.size()) cout << ans[i] << endl;
}
0