Submission #1067148

#TimeUsernameProblemLanguageResultExecution timeMemory
1067148j_vdd16Thousands Islands (IOI22_islands)C++17
1.75 / 100
17 ms3932 KiB
#include "islands.h" #include <variant> #include <algorithm> #include <bitset> #include <cstdint> #include <cstring> #include <iostream> #include <limits.h> #include <math.h> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> //#define int long long #define loop(X, N) for(int X = 0; X < (N); X++) #define all(V) V.begin(), V.end() #define rall(V) V.rbegin(), V.rend() using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<vector<ii>> vvii; typedef vector<bool> vb; typedef vector<vector<bool>> vvb; typedef uint64_t u64; typedef int64_t i64; int n, m; vvii adj; vb vis; vi depths; int counter = 0; vii inOut; void dfs(int node, int d) { if (vis[node]) { return; } vis[node] = true; depths[node] = d; inOut[node].first = counter++; for (auto [child, idx] : adj[node]) { dfs(child, d + 1); } inOut[node].second = counter++; } bool isAncestor(int a, int b) { return inOut[a].first <= inOut[b].first && inOut[b].first <= inOut[a].second; } bool dfs2(int node) { if (vis[node]) { } } std::variant<bool, std::vector<int>> find_journey(int N, int M, vi U, vi V) { n = N; m = M; adj = vvii(n); loop(i, m) { if (V[i] == 0 || U[i] == 0) adj[U[i]].push_back({V[i], i}); } if (n >= 3) { int n1 = adj[0][0].first; int n2 = adj[0][1].first; return vi{adj[0][0].second, adj[n1][0].second, adj[0][0].second, adj[n2][0].second, adj[0][0].second, adj[n1][0].second, adj[0][0].second, adj[n2][0].second }; } return false; // depths = vi(n); // counter = 0; // inOut = vii(n); // vis = vb(n); // dfs(0, 0); // vis = vb(n); // return false; // return success; }

Compilation message (stderr)

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