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, vector<int> > find_journey(int N, int M, vector<int> U, vector<int> V){
if(N == 2){
vector<int> v0, v1;
for(int i = 0; i < M; i++){
if(U[i]==0) v0.push_back(i);
else v1.push_back(i);
}
if(v0.size() < 2 || v1.size() < 1) return false;
return vector<int>{v0[0], v1[0], v0[1], v0[0], v1[0], v0[1]};
}
if(N <= 400){
int p[N + 5][N + 5];
for(int i = 0; i < M; i++) p[U[i]][V[i]]=i;
return vector<int>{p[0][1],p[1][0],p[0][2],p[2][0],p[1][0],p[0][1],p[2][0],p[0][2]};
}
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... |