#include "swap.h"
#include <bits/stdc++.h>
#include <vector>
using namespace std;
int n, m, a, b, c;
vector<int> w;
void init(int N, int M, std::vector<int> U, std::vector<int> V, std::vector<int> W)
{
n = N, m = M;
w.resize(n);
for (int i = 0; i < n; i++)
w[V[i]] = W[i];
sort(W.begin(), W.end()), a = W[0], b = W[1], c = W[2];
}
int getMinimumFuelCapacity(int x, int y)
{
int res;
if (a == w[x] and b == w[y])
res = c;
else if (a == w[x])
res = b;
else
res = a;
return (n > 3) ? max({res, w[x], w[y]}) : -1;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |