結果

問題 No.8107 Listening
ユーザー TKTYI
提出日時 2025-02-23 04:33:37
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 809 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 4,349 ms
コンパイル使用メモリ 279,072 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-02-23 04:34:13
合計ジャッジ時間 36,304 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
	int N,M;cin>>N>>M;
	vector<bool>used(N);
	vector<int>ans;
	for(int i=0;i<M;i++){
	    int u,v;cin>>u>>v;u--;v--;
	    if(!(used[u]||used[v])){
	    	ans.emplace_back(i);
	    	used[u]=used[v]=1;
	    }
	}
	cout<<ans.size()<<endl;
	for(auto s:ans)cout<<s+1<<endl;
}
0