This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#include "robots.h"
typedef long long ll;
typedef vector<int> vi;
#define MAXI (int)1e5
#define pb(x) push_back(x)
vector<int> ad[MAXI];
vector<bool> vis(MAXI,0);
int putaway(int A,int B,int T, int X[],int Y[],int W[],int S[]){
sort(X,X+A);
sort(W,W+T);
if(W[T-1] >= X[A-1]) return -1;
multiset<int> se;
for(int i = 0;i<T;i++) se.insert(W[i]);
set<int> av;
int time = 0;
multiset<int>::reverse_iterator it;
while(!se.empty()){
++time;
for(int i = 0;i<A;i++) av.insert(X[i]);
vector<int> loe;
for(it = se.rbegin();it != se.rend();it++){
if(av.size() == 0) break;
if(*av.rbegin() > *it){
av.erase(*av.rbegin());
loe.push_back(*it);
}
}
for(int i = 0;i<(int)loe.size();i++){
se.erase(se.find(loe[i]));
}
}
return time;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |