# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
628770 | dqhungdl | Thousands Islands (IOI22_islands) | C++17 | 249 ms | 42168 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>
#include <variant>
using namespace std;
const int MAX = 1e5 + 5;
typedef pair<int, int> ii;
int N, mark[MAX];
vector<vector<vector<int>>> g;
vector<ii> ng[MAX];
vector<int> path;
bool dfs(int u) {
if (mark[u] == 2)
return false;
if (mark[u] == 1) {
path.push_back(u);
return true;
}
mark[u] = 1;
for (auto &[v, id]: ng[u])
if (dfs(v)) {
path.push_back(u);
return true;
}
mark[u] = 2;
return false;
}
variant<bool, vector<int>> find_journey(int _N, int M, vector<int> U, vector<int> V) {
Compilation message (stderr)
# | 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... |