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 "robots.h"
#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define ln "\n"
using namespace std;
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) {
vector<ll> robot(A), toy(T);
for (ll i=0; i<A; i++) robot[i]=X[i];
for (ll i=0; i<T; i++) toy[i]=W[i];
sort(robot.rbegin(), robot.rend());
sort(toy.rbegin(), toy.rend());
ll l=0;
multiset<ll> usd;
for (ll i=0; i<T; i++){
while (l<A and robot[l]>toy[i]){
usd.insert(0);
l++;
}
if (usd.empty()) return -1;
ll val = *usd.begin();
usd.erase(usd.begin());
usd.insert(val+1);
}
return *usd.rbegin();
}
# | 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... |