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>
using namespace std;
int a[50005];
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) {
sort(S, S + T);
sort(X, X + A);
int l = 0;
for (int i = 0; i < T; i ++) {
if (W[i] < X[l]) a[l] ++;
else a[++ l] ++;
}
int days = 0, rem = 1;
for (int i = l; i >= 0; i --) {
a[i] -= days;
days += max(0, a[i] / rem);
a[i] -= a[i] / rem * rem;
if (a[i] > 0) days ++;
if (i) a[i-1] -= a[i];
}
return days;
}
# | 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... |