Submission #831171

#TimeUsernameProblemLanguageResultExecution timeMemory
831171caganyanmazThousands Islands (IOI22_islands)C++17
0 / 100
35 ms9160 KiB
#include <bits/stdc++.h> #define pb push_back #include "islands.h" using namespace std; constexpr static int MXN = 1e5 + 5; int n, m; vector<int> u, v; vector<int> g[MXN]; bitset<MXN> visited; bool dfs(int node) { if (visited[node]) return true; visited[node] = true; for (int c : g[node]) if (dfs(c)) return true; visited[node] = false; return false; } variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) { n = N, m = M; u = U, v = V; for (int i = 0; i < m; i++) { g[u[i]].pb(v[i]); g[v[i]].pb(u[i]); } return dfs(0); }
#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...