Submission #123746

#TimeUsernameProblemLanguageResultExecution timeMemory
123746turbatRobots (IOI13_robots)C++14
Compilation error
0 ms0 KiB
#include "robots.h" #include <bits/stdc++.h> using namespace std; int a, b, t, *x, *y, *w, *s, cnt; priority_queue <int> se; pair <int, int> p[1000005]; vector <int> vc; bool can(int k){ se.clear(); int j = 0; for (int i = 0;i < a;i++){ while (j < t && p[j].first < x[i]) se.push(s[p[j++].second]); cnt = k; while (cnt-- && !se.empty()) se.pop(); } for (;j < t;j++) se.push(s[p[j].second]); vc.clear(); while (!se.empty()){ vc.push_back(se.top()); se.pop(); } reverse(vc.begin(), vc.end()); j = 0; cnt = k; for (auto it : vc){ while (j < b && (!cnt || it >= y[j])){ j++; cnt = k; } if (j == b) return 0; cnt--; } return 1; } int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { a = A, b = B, t = T, x = X, y = Y, w = W, s = S; sort(x, x + a); sort(y, y + b); for (int i = 0;i < t;i++){ if (w[i] >= x[a - 1] && s[i] >= y[b - 1]) return -1; p[i].first = w[i]; p[i].second = i; } sort(p, p + t); int l = 1, r = t, mid; while (l != r){ mid = (l + r) / 2; if (can(mid)) r = mid; else l = mid + 1; } return l; }

Compilation message (stderr)

robots.cpp: In function 'bool can(int)':
robots.cpp:10:5: error: 'class std::priority_queue<int>' has no member named 'clear'
  se.clear();
     ^~~~~