Submission #1090985

#TimeUsernameProblemLanguageResultExecution timeMemory
10909854QT0RRobots (IOI13_robots)C++17
0 / 100
1310 ms22984 KiB
#include <bits/stdc++.h> #include "robots.h" using namespace std; int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]){ int l=1,p=(1e6)+1,md; vector<pair<int,int>> vec; sort(X,X+A); sort(Y,Y+B,greater<int>()); for (int i = 0; i<T; i++)vec.push_back({W[i],S[i]}); sort(vec.begin(),vec.end()); priority_queue<int> pq; while(l<p){ md=(l+p)/2; int iter=0; for (int i = 0; i<A; i++){ for (;iter<T && vec[iter].first<X[i];iter++){ pq.push(vec[iter].second); } for (int j = 0; j<md && pq.size(); j++)pq.pop(); } bool ok=true; for (int i = 0; i<B && pq.size(); i++){ for (int j = 0; j<md && pq.size(); j++){ if (pq.top()>Y[i])ok=false; pq.pop(); } } if (pq.size())ok=false; if (ok)p=md; else l=md+1; for (;pq.size();pq.pop()); } return l; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...