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 putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) {
sort(X, X+A);
reverse(X, X+A);
sort(Y, Y+B);
reverse(Y, Y+B);
for (int i = 0; i < T; i++)
{
if (W[i] >= X[0] and S[i] >= Y[0])
{
return -1;
}
}
float maxMinutes = 0;
for (int i = 0; i <= A; i++)
{
for (int j = 0; j <= B; j++)
{
if (i == 0 and j == 0)
{
continue;
}
float toyCount = 0;
for (int k = 0; k < T; k++)
{
if ((i == A or W[k] >= X[i]) and (j == B or S[k] >= Y[j]))
{
toyCount += 1;
}
}
float robotCount = i + j;
maxMinutes = max(maxMinutes, toyCount/robotCount);
}
}
maxMinutes = ceil(maxMinutes);
return int(maxMinutes);
}
# | 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... |