Submission #1037699

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10376992024-07-29 06:59:46thinknoexitThousands Islands (IOI22_islands)C++17
0 / 100
21 ms8540 KiB
#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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...