Submission #1084586

#TimeUsernameProblemLanguageResultExecution timeMemory
1084586SamueleVidThousands Islands (IOI22_islands)C++17
0 / 100
1153 ms1579776 KiB
#include <bits/stdc++.h> using namespace std; constexpr int MAXN = 1e5 + 5; vector<int> adj[MAXN]; bool v[MAXN]; bool ciclo = 0; int dfs(int u, int p) { if (v[u]) ciclo = 1; v[u] = 1; bool tolto_p = 0; for (auto x : adj[u]) { if (x == p && !tolto_p) { tolto_p = 1; continue; } dfs(x, u); } } variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) { fill(v, v + MAXN, 0); for (int i = 0; i < M; i ++) { adj[U[i]].push_back(V[i]); } dfs(0, -1); return ciclo; }

Compilation message (stderr)

islands.cpp: In function 'int dfs(int, int)':
islands.cpp:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
   22 | }
      | ^
#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...