제출 #1084586

#제출 시각아이디문제언어결과실행 시간메모리
1084586SamueleVid수천개의 섬 (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; }

컴파일 시 표준 에러 (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...