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 <cassert>
#include <cstdio>
#include <variant>
#include <vector>
#include <algorithm>
using namespace std;
variant<bool, vector<int>> find_journey(int N, int M, std::vector<int> U, std::vector<int> V) {
if (N == 2){
if(count(U.begin(), U.end(), 0) >= 2 && count(U.begin(), U.end(), 1) >= 1){
vector<pair<int, int>> ans(M);
for(int i = 0; i < M; i ++){
ans[i] = {U[i], i};
}
sort(ans.begin(), ans.end());
vector<int> ret = {ans[0].second, ans.back().second, ans[1].second, ans[0].second, ans.back().second, ans[1].second};
return ret;
}
return false;
}
return false;
}
# | 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... |