제출 #1232184

#제출 시각아이디문제언어결과실행 시간메모리
1232184dssfsuper2드문 곤충 (IOI22_insects)C++20
컴파일 에러
0 ms0 KiB
#include "insects.h"
#include <bits/stdc++.h>
using namespace std;

set<int> ls;
void tomf(int nv){

  
}
int min_cardinality(int N) {
  vector<int> representatives;
  vector<vector<int>> groups;
  groups.push_back({0});
  move_inside(0);
  for(int i = 1;i<N;i++){
    move_inside(i);
    int x = press_button();
    if (x==1){
      groups.push_back({i});
    }
    else{
      for(int j = 0;j<groups.size();j++){
        auto thing = groups[j];
        move_outside(thing.back());
        int x = press_button();
        if (x==1){
          groups[j].push_back(i);
          break;
        }
        else{
          move_inside(thing.back());  
        }
    }
  }
  int t = 1000000000;
  for(auto thing:groups){
    t=min(t, (int)thing.size());
  }
  
  return t;
}

컴파일 시 표준 에러 (stderr) 메시지

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:41:2: error: expected '}' at end of input
   41 | }
      |  ^
insects.cpp:10:28: note: to match this '{'
   10 | int min_cardinality(int N) {
      |                            ^
insects.cpp:41:2: warning: control reaches end of non-void function [-Wreturn-type]
   41 | }
      |  ^