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 <bits/stdc++.h>
#include "islands.h"
using namespace std;
typedef long long ll;
variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) {
ll cnt0 = 0, cnt1 = 0;
for (auto &e : U) (e ? cnt1 : cnt0)++;
if (cnt0 >= 2 && cnt1 >= 1) {
vector<int> res;
for (int i = 0; i < M && res.size() < 2; i++) {
if (U[i] == 0) {
res.push_back(i);
}
}
for (int i = 0; i < M && res.size() < 3; i++) {
if (U[i] == 1) {
res.insert(++res.begin(), i);
}
}
for (int i = 0; i < 3; i++) res.push_back(res[i]);
return res;
}
return false;
}
#ifdef TEST
#include "grader.cpp"
#endif
# | 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... |