이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "islands.h"
#include <bits/stdc++.h>
using namespace std;
std::variant<bool, std::vector<int>> find_journey(
	int N, int M, std::vector<int> U, std::vector<int> V) {
	vector<vector<pair<int,int>>> arr(N);
	for (int i = 0; i < M; i++){
		arr[U[i]].push_back({V[i],i});
	}
	for (int i = 0; i < N; ++i)
	{
		sort(arr[i].begin(), arr[i].end());
	}
	if (arr[0].size()<=1) return false;
	int a = arr[0][0].first;
	int b = arr[0][1].first;
	if (a==b){
		return vector<int>{arr[0][0].second,arr[a][0].second,arr[0][1].second,arr[0][0].second,arr[a][0].second,arr[0][1].second};
	}
	else {
		return vector<int>{arr[0][0].second,arr[a][0].second,arr[0][1].second,arr[b][0].second,arr[a][0].second,arr[0][0].second,arr[b][0].second,arr[0][1].second};
	}
}
| # | 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... |