Submission #1076976

#TimeUsernameProblemLanguageResultExecution timeMemory
1076976mariaclaraThousands Islands (IOI22_islands)C++17
0 / 100
20 ms5548 KiB
#include "islands.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; #define all(x) x.begin(), x.end() #define sz(x) (int)x.size() #define pb push_back #define mk make_pair #define fr first #define sc second vector<int> vis, at; vector<vector<pii>> edges; vector<int> dfs(int x) { vis[x] = 1; for(auto [viz,ind] : edges[x]) { if(vis[viz]) { at.pb(ind); return at; } at.pb(ind); vector<int> v = dfs(viz); if(!v.empty()) return v; } return {}; } variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) { edges.resize(N); vis.resize(N); for(int i = 0; i < M; i += 2) edges[U[i]].pb({V[i], i}); vector<int> c = dfs(0); if(c.empty()) return false; return true; }
#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...