이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |