Submission #550823

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5508232022-04-19 09:49:01David_MRobots (IOI13_robots)C++14
0 / 100
1 ms312 KiB
#include "robots.h"
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define pb push_back
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) {
int ans=-1;
vector<array<int, 3>> p(T);
for (int i=0; i<T; i++)p[i]={W[i]+1, S[i]+1, i};
sort(all(p));
sort(X, X+A);
sort(Y, Y+B);
int l=1, r=T+1;
while(l<=r){
int m=l+r>>1;
int M=0, k=0, o=0;
vector<bool> f(T,0);
vector<int> v;
set<array<int, 2>> s;
for (auto[x,y,i] : p){
M=m;
if(x>X[k]){
while(s.size() && M--){
f[(*s.begin())[1]]=1;
s.erase(s.begin());
}
while(k<=A && x>X[k])k++;
if(k==A+1)break;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

robots.cpp: In function 'int putaway(int, int, int, int*, int*, int*, int*)':
robots.cpp:17:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   17 |         int m=l+r>>1;
      |               ~^~
robots.cpp:22:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   22 |         for (auto[x,y,i] : p){
      |                  ^
#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...