#include "robots.h"
#include <bits/stdc++.h>
using namespace std;
typedef int ll;
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) {
bool isWeak[2];
ll limitArr[2];
int idx = 0;
for (int i = 0; i < A; i++) {
isWeak[idx] = true;
limitArr[idx] = X[i];
idx++;
}
for (int j = 0; j < B; j++) {
isWeak[idx] = false;
limitArr[idx] = Y[j];
idx++;
}
vector<int> canCarry[2];
for (int k = 0; k < 2; k++) {
for (int r = 0; r < 2; r++) {
if (isWeak[r]) {
if ((ll)W[k] < limitArr[r]) {
canCarry[k].push_back(r);
}
} else {
if ((ll)S[k] < limitArr[r]) {
canCarry[k].push_back(r);
}
}
}
if (canCarry[k].empty()) {
return 1;
}
}
int best = INT_MAX;
for (int r0 : canCarry[0]) {
for (int r1 : canCarry[1]) {
int load[2] = {0, 0};
load[r0]++;
load[r1]++;
int timeNeeded = max(load[0], load[1]);
best = min(best, timeNeeded);
}
}
return best;
}
# | 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... |