# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
745230 | math_rabbit_1028 | Thousands Islands (IOI22_islands) | C++17 | 0 ms | 0 KiB |
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>
int n, m;
vector<int> adj[101010];
std::variant<bool, std::vector<int>> find_journey(
int N, int M, std::vector<int> U, std::vector<int> V) {
n = N; m = M;
for (int i = 0; i < m; i++) {
adj[U[i]].push_back(V[i]);
adj[V[i]].push_back(U[i]);
}
if (adj[0].size() > 0) {
vector<int> ret;
ret.push_back(0);
ret.push_back(adj[0][0]);
ret.push_back(0);
return ret;
}
return false;
}