제출 #837456

#제출 시각아이디문제언어결과실행 시간메모리
837456NothingXD수천개의 섬 (IOI22_islands)C++17
0 / 100
27 ms7764 KiB
#include "islands.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; void debug_out(){cerr<<endl;} template<typename Head, typename... Tail> void debug_out(Head H, Tail... T){ cerr << H << ' '; debug_out(T...); } #define debug(...) cerr << "(" << #__VA_ARGS__ << "): ", debug_out(__VA_ARGS__) #define F first #define S second #define all(x) x.begin(), x.end() #define MP(x, y) make_pair(x, y) const int maxn = 1e5 + 10; int n, m; vector<int> g[maxn]; bool vis[maxn]; bool dfs(int v, int p = -1){ vis[v] = true; for (auto u: g[v]){ if (!vis[u] && dfs(u, v)){ return true; } else if (vis[u] && u != p){ debug(v, u); return true; } } return false; } std::variant<bool, std::vector<int>> find_journey( int N, int M, std::vector<int> U, std::vector<int> V) { n = N, m = M; for (int i = 0; i < m; i++){ g[U[i]].push_back(V[i]); } return dfs(0); }
#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...