# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1037699 | thinknoexit | Thousands Islands (IOI22_islands) | C++17 | 21 ms | 8540 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>
using namespace std;
using ll = long long;
const int N = 1010;
vector<int> adj[N];
vector<int> cycle, path;
bool c[N], reach[N], vis[N];
int boat[N][N], bp, ava, n;
void dfs_sz(int v) {
reach[v] = 1;
for (auto& x : adj[v]) {
if (!reach[x]) dfs_sz(x);
}
}
bool dfs(int v, int p = -1) {
if (vis[v]) {
bp = v, ava = 1;
return true;
}
vis[v] = 1;
for (auto& x : adj[v]) {
if (x == p) continue;
if (dfs(x, v)) {
if (ava) cycle.push_back(v), c[v] = 1;
if (v == bp) ava = 0;
return true;
}
}
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... |