제출 #1191473

#제출 시각아이디문제언어결과실행 시간메모리
1191473drakozsRarest Insects (IOI22_insects)C++20
컴파일 에러
0 ms0 KiB
#include "insects.h" #include<bits/stdc++.h> using namespace std; int min_cardinality(int N) { vector<int> temp; int d = 0; for (int i = 0; i < N; i++){ move_inside(i); int count = press_button(); if (count > 1){ move_outside(i); } else{ temp.push_back(i); d++; } } for (int i = 0; i < temp.size(); i++){ move_outside(temp[i]); } int ans = N; while(1){ int B = N / d; vector<int> all; for (int i = 0; i < N; i++){ move_inside(i); int count = press_button(i); if (count > B){ move_outside(i); } else{ all.pb(i); if (all.size() == B * d) break; } } if (all.size() == B * d){ return B; } N = all.size(); for (int i = 0; i < all.size(); i++){ move_outside(all[i]); } } return ans; }

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

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:30:49: error: too many arguments to function 'int press_button()'
   30 |                         int count = press_button(i);
      |                                     ~~~~~~~~~~~~^~~
In file included from insects.cpp:1:
insects.h:3:5: note: declared here
    3 | int press_button();
      |     ^~~~~~~~~~~~
insects.cpp:35:37: error: 'class std::vector<int>' has no member named 'pb'
   35 |                                 all.pb(i);
      |                                     ^~