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>
#include "robots.h"
using namespace std;
int ans = 0;
int putaway(int a, int b, int t, int x[], int y[], int w[], int s[]){
sort(x, x + a);
multiset<int> st;
for(int i = 0; i < t; i++) st.insert(w[i]);
while(!st.empty()){
ans++;
bool flag = false;
int cur = 0;
while(!st.empty() && cur != a){
int indx = upper_bound(x + cur, x + a, *st.begin()) - x;
if(indx == a) break;
else{
cur = indx + 1;
auto it = prev(st.lower_bound(x[indx]));
st.erase(it);
flag = true;
}
}
if(flag == false) return -1;
}
return ans;
}
# | 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... |