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 "islands.h"
#include <bits/stdc++.h>
using namespace std;
std::variant<bool, vector<int>> find_journey(int n, int m, vector<int> U, vector<int> V) {
if (n == 2) {
vector<int> e[n];
for (int i = 0; i < m; i++) {
e[U[i]].push_back(i);
}
if (e[0].size() >= 2 && e[1].size() >= 1) {
return vector<int>{e[0][0], e[1][0], e[0][1], e[0][0], e[1][0], e[0][1]};
} else {
return false;
}
}
vector<int> e[n][n];
for (int i = 0; i < m; i++) {
e[U[i]][V[i]].push_back(i);
}
return vector<int>{e[0][1][0], e[1][2][0], e[2][0][0], e[0][2][0], e[2][1][0], e[1][0][0],
e[2][0][0], e[1][2][0], e[0][1][0], e[1][0][0], e[2][1][0], e[0][2][0]};
}
# | 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... |