Submission #223602

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2236022020-04-15 14:50:09staniewzkiRobots (IOI13_robots)C++17
100 / 100
1942 ms24368 KiB
#include<bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
using PII = pair<int, int>;
#include "robots.h"
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) {
sort(X, X + A), sort(Y, Y + B);
vector<PII> pts(T);
REP(i, T) pts[i] = {W[i], S[i]};
sort(pts.begin(), pts.end());
auto check = [&](int q) {
priority_queue<int> Q;
int cur = 0;
REP(i, A + 1) {
while(cur < size(pts) && (i == A || pts[cur].first < X[i]))
Q.emplace(pts[cur++].second);
if(i != A) REP(j, q) {
if(Q.empty()) break;
Q.pop();
}
}
for(int i = B - 1; i >= 0; i--) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

robots.cpp: In lambda function:
robots.cpp:21:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    while(cur < size(pts) && (i == A || pts[cur].first < X[i]))
          ~~~~^~~~~~~~~~~
#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...