#include "islands.h"
#include <map>
#include <variant>
#include <vector>
std::variant<bool, std::vector<int>> find_journey(int N, int M, std::vector<int> U, std::vector<int> V) {
std::vector<std::map<int, int>> canoesfrom(N);
for (int i = 0; i < M; ++i) {
canoesfrom[U[i]][V[i]] = i;
}
if (N <= 2) return false;
int a, b, x, y;
a = canoesfrom[0][1];
b = canoesfrom[1][0];
x = canoesfrom[0][2];
y = canoesfrom[2][0];
return std::vector<int>{a, b, x, y, b, a, y, x};
}
# | 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... |