제출 #231114

#제출 시각아이디문제언어결과실행 시간메모리
231114a_player로봇 (IOI13_robots)C++14
0 / 100
5 ms384 KiB
#include <bits/stdc++.h> #include "robots.h" #ifdef ALE #include "grader.c" #endif using namespace std; const int nax=1e6+5; priority_queue<int> q; int idx1[nax]; int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { auto cmp1=[W](int a, int b){ return W[a]<W[b]; }; iota(idx1,idx1+T,0); sort(idx1,idx1+T,cmp1); sort(X,X+A); sort(Y,Y+B,greater<int>()); auto check=[A,B,T,X,Y,W,S](int t){ int j=0; for(int i=0;i<A;i++){ while(j<T&&W[idx1[j]]<X[i])q.push(S[idx1[j++]]); for(int z=0;z<t&&!q.empty();z++){ q.pop(); } } if(q.empty())return true; for(int i=0;i<B;i++){ if(q.top()>=Y[i])return false; for(int z=0;z<t&&!q.empty();z++){ q.pop(); } if(q.empty())return true; } return q.empty(); }; int x=-1; for(int b=T;b>=1;b/=2) while(!check(x+b))x+=b; return x+1; }
#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...