#include "robots.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef tuple<ll, ll, ll> plll;
typedef vector<plll> vplll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vector<pll>> vvpll;
typedef vector<vector<ll>> vvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
#define loop(i, s, e) for (ll i = (s); i < (e); ++i)
#define loopr(i, e, s) for (ll i = (e)-1; i >= (s); --i)
#define all(a) a.begin(), a.end()
const ll inf = 1e9 + 7;
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) {
bool w[2];
int l[2];
if (A == 2) {
w[0] = w[1] = true;
l[0] = X[0]; l[1] = X[1];
} else if (A == 1) {
w[0] = true; l[0] = X[0];
w[1] = false; l[1] = Y[0];
} else {
w[0] = w[1] = false;
l[0] = Y[0]; l[1] = Y[1];
}
if (T != 2) return -1;
bool c[2][2];
for (int i = 0; i < 2; i++)
for (int j = 0; j < 2; j++)
c[i][j] = w[i] ? (W[j] < l[i]) : (S[j] < l[i]);
if ((c[0][0] && c[1][1]) || (c[0][1] && c[1][0])) return 1;
for (int j = 0; j < 2; j++) {
bool ok = false;
for (int i = 0; i < 2; i++)
if (c[i][j]) { ok = true; break; }
if (!ok) return -1;
}
return 2;
}
# | 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... |