This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "islands.h"
#include <variant>
#include <vector>
#include<bits/stdc++.h>
using namespace std;
int odw[100010];
vector<int>graf[100010];
void dfs(int x){
for(auto j: graf[x]){
odw[j]++;
if(odw[j]==1)
dfs(j);
}
}
std::variant<bool, std::vector<int>> find_journey(int n, int m, std::vector<int> U, std::vector<int> V) {
int i;
for(i=0;i<m;i+=2){
graf[U[i]].push_back(V[i]);
}
odw[0] = 1;
dfs(0);
for(i=0;i<n;i++)
if(odw[i]>1)
return {};
return false;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |