Submission #996683

#TimeUsernameProblemLanguageResultExecution timeMemory
996683stdfloatThousands Islands (IOI22_islands)C++17
1.75 / 100
25 ms7628 KiB
#include <bits/stdc++.h> #include "islands.h" using namespace std; vector<vector<pair<int, int>>> E; bool tr = false; vector<bool> vis; void dfs(int x, int p = -1) { vis[x] = true; for (auto [i, k] : E[x]) { if (i == p) continue; if (vis[i]) { if (!i) tr = true; } else dfs(i, x); } } variant<bool, vector<int>> find_journey(int n, int M, vector<int> U, vector<int> V) { E.assign(n, {}); for (int i = 0; i < M; i++) { E[U[i]].push_back({V[i], i}); E[V[i]].push_back({U[i], i}); } vis.assign(n, false); dfs(0); return tr; }
#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...