제출 #424628

#제출 시각아이디문제언어결과실행 시간메모리
424628saleh커다란 상품 (IOI17_prize)C++17
컴파일 에러
0 ms0 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; const int MAXN = 200 * 1000 + 23; vector<int> vec[MAXN]; bitset<MAXN> mark; int look = 0, javab = -1, n, sum[MAXN]; set<int> s; vector<int> osk(int x) { if (mark[x]) return vec[x]; mark[x] = true; left.erase(x); return vec[x] = ask(x); } bool go() { int dw = 0, up = n, l = 0, r = 0; while (up - dw > 1) { int mid = (dw + up) >> 1; if (mark[mid] && vec[mid][0] + vec[mid][1] < look) {//opt if tle auto tmp = left.lower_bund(mid); if (*tmp < dw) tmp++; mid = *tmp; } vector<int> v = osk(mid); s.insert(v[0] + v[1]); if (v[0] + v[1] == 0) return javab = mid, true; if (v[0] + v[1] < look) return false; if (look < v[0] + v[1]) { look = v[0] + v[1]; for (int i = 1; i <= n; i++) if (mark[i]) sum[i] = sum[i - 1] + 1; } int ll = v[0] - l - (sum[mid] - sum[dw]), rr = v[1] - r - (sum[up] - sum[mid]); if (ll < rr) dw = mid; else up = mid; } } int find_best(int N) { n = N; for (int i = 0; i < n; i++) left.insert(i); while (!go()); return javab; } //int main() {}

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

prize.cpp: In function 'std::vector<int> osk(int)':
prize.cpp:17:7: error: request for member 'erase' in 'std::left', which is of non-class type 'std::ios_base&(std::ios_base&)'
   17 |  left.erase(x);
      |       ^~~~~
prize.cpp: In function 'bool go()':
prize.cpp:25:20: error: request for member 'lower_bund' in 'std::left', which is of non-class type 'std::ios_base&(std::ios_base&)'
   25 |    auto tmp = left.lower_bund(mid);
      |                    ^~~~~~~~~~
prize.cpp: In function 'int find_best(int)':
prize.cpp:45:35: error: request for member 'insert' in 'std::left', which is of non-class type 'std::ios_base&(std::ios_base&)'
   45 |  for (int i = 0; i < n; i++) left.insert(i);
      |                                   ^~~~~~
prize.cpp: In function 'bool go()':
prize.cpp:41:1: warning: control reaches end of non-void function [-Wreturn-type]
   41 | }
      | ^