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 <bits/stdc++.h>
#include <variant>
#include "islands.h"
using namespace std;
typedef int ll;
variant<bool, vector<int>> find_journey(int n, int m, vector<int> u, vector<int> v){
if(n==2){
ll a=-1, b=-1, c=-1;
for(ll i=0; i<m; i++){
if(u[i]==0){
if(a==-1) a=i;
else b=i;
}
else c=i;
}
if(b==-1 || c==-1) return false;
return vector<int>({a, c, b, a, c, b});
}
else{
ll a=-1, b=-1, c=-1, d=-1, e=-1, f=-1;
for(ll i=0; i<m; i++){
if(u[i]==0 && v[i]==1) a=i;
if(u[i]==1 && v[i]==0) b=i;
if(u[i]==1 && v[i]==2) c=i;
if(u[i]==2 && v[i]==1) d=i;
if(u[i]==2 && v[i]==0) e=i;
if(u[i]==0 && v[i]==2) f=i;
}
return vector<int>({a, c, e, f, d, b, e, c, a, b, d, f});
}
}
# | 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... |