제출 #1069915

#제출 시각아이디문제언어결과실행 시간메모리
1069915Unforgettablepl수천개의 섬 (IOI22_islands)C++17
11.90 / 100
26 ms6488 KiB
#include "islands.h" #include <bits/stdc++.h> using namespace std; variant<bool, vector<int>> find_journey(int N,int M,vector<int> U,vector<int> V){ vector<vector<int>> adj(N); for(int i=0;i<M;i++) { adj[U[i]].emplace_back(V[i]); } vector<int> visited(N); bool found = false; for(int&child:adj[0]) { bool works = false; function<void(int)> dfs = [&](int x) { if(visited[x]==2)return; if(visited[x]==1) { works = true; return; } visited[x]=1; for(int&i:adj[x])dfs(i); visited[x]=2; }; dfs(child); if(!works)continue; visited = vector<int>(N); if(found)return true; found = true; } return false; }
#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...