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 "islands.h"
#include <bits/stdc++.h>
#include <variant>
using namespace std;
#define lli long long int
#define debug(a) cout << #a << " = " << a << endl
#define debugsl(a) cout << #a << " = " << a << ", "
#define rep(i,a,b) for(int i = (a); i <= (b); i++)
#define repa(i,a,b) for(int i = (a); i >= (b); i--)
#define pll pair<lli,lli>
vector<int> camino;
lli a,b,c,d,n;
std::variant<bool, std::vector<int>> find_journey( int N, int M, std::vector<int> U, std::vector<int> V) {
n = N;
a = -1;
b = -1;
c = -1;
rep(i,0,M-1) {
if (U[i] == 0 && V[i] == 1) {
if(a == -1) a = i;
else c = i;
}
if (U[i] == 1 && V[i] == 0) b = i;
}
if(a == -1 || b == -1 || c == -1) return false;
camino.push_back(a);
camino.push_back(b);
camino.push_back(c);
camino.push_back(a);
camino.push_back(b);
camino.push_back(c);
return camino;
}
# | 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... |