結果

問題 No.3107 Listening
ユーザー harurunharurun
提出日時 2024-01-05 05:39:14
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 753 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 735 ms
コンパイル使用メモリ 75,064 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2024-04-01 20:51:29
合計ジャッジ時間 26,126 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 395 ms
6,548 KB
testcase_04 AC 72 ms
6,548 KB
testcase_05 AC 111 ms
6,548 KB
testcase_06 AC 90 ms
6,548 KB
testcase_07 AC 255 ms
6,548 KB
testcase_08 AC 155 ms
6,548 KB
testcase_09 AC 228 ms
6,548 KB
testcase_10 AC 385 ms
6,548 KB
testcase_11 AC 517 ms
6,548 KB
testcase_12 AC 160 ms
6,548 KB
testcase_13 AC 385 ms
6,548 KB
testcase_14 AC 202 ms
6,548 KB
testcase_15 AC 152 ms
6,548 KB
testcase_16 AC 84 ms
6,548 KB
testcase_17 AC 109 ms
6,548 KB
testcase_18 AC 46 ms
6,548 KB
testcase_19 AC 285 ms
6,548 KB
testcase_20 AC 327 ms
6,548 KB
testcase_21 AC 595 ms
6,548 KB
testcase_22 AC 427 ms
6,548 KB
testcase_23 AC 549 ms
6,548 KB
testcase_24 AC 516 ms
6,548 KB
testcase_25 AC 319 ms
6,548 KB
testcase_26 AC 106 ms
6,548 KB
testcase_27 AC 243 ms
6,548 KB
testcase_28 AC 466 ms
6,548 KB
testcase_29 AC 493 ms
6,548 KB
testcase_30 AC 205 ms
6,548 KB
testcase_31 AC 258 ms
6,548 KB
testcase_32 AC 424 ms
6,548 KB
testcase_33 AC 753 ms
6,548 KB
testcase_34 AC 730 ms
6,548 KB
testcase_35 AC 731 ms
6,548 KB
testcase_36 AC 733 ms
6,548 KB
testcase_37 AC 726 ms
6,548 KB
testcase_38 AC 734 ms
6,548 KB
testcase_39 AC 732 ms
6,548 KB
testcase_40 AC 722 ms
6,548 KB
testcase_41 AC 745 ms
6,548 KB
testcase_42 AC 752 ms
6,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
using ll=long long;

int main(){
  ll N,M;
  cin>>N>>M;
  vector<ll> V(N);
  vector<ll> ans;
  for(ll i=0;i<M;i++){
    ll u,v;
    cin>>u>>v;
    u--;
    v--;
    if(V[u]==0 && V[v]==0){
      V[u]=1;
      V[v]=1;
      ans.push_back(i+1);
    }
  }
  cout<<ans.size()<<endl;
  for(ll i:ans){
    cout<<i<<endl;
  }
}
0