제출 #714101

#제출 시각아이디문제언어결과실행 시간메모리
714101Pherokung드문 곤충 (IOI22_insects)C++17
컴파일 에러
0 ms0 KiB
#include "insects.h" #include<bits/stdc++.h> #define pb push_back using namespace std; int min_cardinality(int n) { int type = 0; vector<int> in,out,in_temp,out_temp; for(int i=0;i<n;i++){ move_inside(i); if(press_button() > 1) move_outside(i), out.pb(i); else type++, in.pb(i); } int be = 1, ed = n/type; while(be <= ed){ int mid = (be+ed)/2, cnt = in.size(); in_temp.clear(), out_temp.clear(); for(auto x : out){ move_inside(x); if(press_button() > mid) move_outside(x), out_temp.pb(x); else cnt++, in_temp.pb(x); if(cnt == mid * type) break; } if(cnt == mid * type){ be = mid+1; in += in_temp; out = out_temp; } else{ ed = mid-1; out = in_temp; } } return ed; }

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

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:25:10: error: no match for 'operator+=' (operand types are 'std::vector<int>' and 'std::vector<int>')
   25 |       in += in_temp;
      |       ~~~^~~~~~~~~~