이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "islands.h"
#include <variant>
#include <vector>
using namespace std;
const int maxn = 410;
int edge_index[maxn][maxn];
std::variant<bool, std::vector<int>> find_journey(
int N, int M, std::vector<int> U, std::vector<int> V)
{
if (N == 2)
{
int cnt0 = 0, cnt1 = 0;
vector < int > idx0, idx1;
for (int i = 0; i < M; i ++)
{
if (U[i] == 0)
cnt0 ++, idx0.push_back(i);
else
cnt1 ++, idx1.push_back(i);
}
if (cnt0 >= 2 && cnt1 >= 1)
{ vector < int > path;
path.push_back(idx0[0]);
path.push_back(idx1[0]);
path.push_back(idx0[1]);
path.push_back(idx0[0]);
path.push_back(idx1[0]);
path.push_back(idx0[1]);
return path;
}
return false;
}
else
{
for (int i = 0; i < M; i ++)
edge_index[U[i]][V[i]] = i;
vector < int > path;
path.push_back(edge_index[0][1]);
path.push_back(edge_index[1][2]);
path.push_back(edge_index[2][0]);
path.push_back(edge_index[0][2]);
path.push_back(edge_index[2][1]);
path.push_back(edge_index[1][0]);
path.push_back(edge_index[0][1]);
path.push_back(edge_index[1][2]);
path.push_back(edge_index[2][0]);
path.push_back(edge_index[0][2]);
path.push_back(edge_index[2][1]);
path.push_back(edge_index[1][0]);
return path;
}
}
# | 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... |