#include "islands.h"
#include<bits/stdc++.h>
#include <variant>
#include <vector>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define ll long long
#define ld long double
const int N=1e5+50;
vector<int>E[N];
std::variant<bool, std::vector<int>> find_journey(int n, int m, std::vector<int> U, std::vector<int> V) {
if(n==2){
int deg[n+10]={0};
vector<int>nesto[n+10];
for(int i=0;i<m;i++){
deg[U[i]]++;
nesto[U[i]].pb(i);
}
if(deg[0]<=1||deg[1]<=0) return false;
return (vector<int>){nesto[0][0],nesto[1][0],nesto[0][1],nesto[0][0],nesto[1][0],nesto[0][1]};
}
else{
int ind[10];
for(int i=0;i<m;i++){
if(U[i]==0&&V[i]==1) ind[0]=i;
if(U[i]==1&&V[i]==0) ind[1]=i;
if(U[i]==0&&V[i]==2) ind[2]=i;
if(U[i]==2&&V[i]==0) ind[3]=i;
}
if(n==2) return false;
return (vector<int>){ind[0],ind[1],ind[2],ind[3],ind[1],ind[0],ind[3],ind[2]};
}
}
# | 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... |