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 "islands.h"
using namespace std;
variant<bool, std::vector<int>> find_journey(int N,int M,vector<int> U,vector<int> V){
if(N==2){
int Back=-1;
int Front_1=-1;
int Front_2=-1;
vector<int> S;
for(int i=0;i<M;i++){
if(!(Back+1) && U[i]==1) Back=i;
else if(!(Front_1+1) && V[i]==1) Front_1=i;
else if(!(Front_2+1) && V[i]==1) Front_2=i;
}
if(!(Back+1) || !(Front_1+1) || !(Front_2+1)) return false;
S.push_back(Front_1);
S.push_back(Back);
S.push_back(Front_2);
S.push_back(Front_1);
S.push_back(Back);
S.push_back(Front_2);
return S;
}
int find_0_1=-1;
int find_0_2=-1;
int find_1_0=-1;
int find_2_0=-1;
//vector<int> S;
for(int i=0;i<M;i++){
if(!(find_0_1+1) && U[i]==0 && V[i]==1) find_0_1=i;
else if(!(find_0_2+1) && U[i]==0 && V[i]==2) find_0_2=i;
else if(!(find_1_0+1) && U[i]==1 && V[i]==0) find_1_0=i;
else if(!(find_2_0+1) && U[i]==2 && V[i]==0) find_2_0=i;
}
//if(!(Back+1) || !(Front_1+1) || !(Front_2+1)) return S;
vector<int> S={find_0_1,find_1_0,find_0_2,find_2_0,find_1_0,find_0_1,find_2_0,find_0_2};
return S;
}
# | 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... |