Submission #1084585

#TimeUsernameProblemLanguageResultExecution timeMemory
1084585SamueleVidRarest Insects (IOI22_insects)C++17
Compilation error
0 ms0 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)

insects.cpp: In function 'int dfs(int, int)':
insects.cpp:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
   22 | }
      | ^
/usr/bin/ld: /tmp/ccG73Ti5.o: in function `main':
stub.cpp:(.text.startup+0x61): undefined reference to `min_cardinality(int)'
collect2: error: ld returned 1 exit status