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>
using namespace std;
std::variant<bool, std::vector<int>> find_journey(
int n, int m, std::vector<int> u, std::vector<int> v){
assert(n<=400);
if(n==2){
vector<int> a, b;
for(int i=0;i<m;++i){
if(u[i]==0) a.push_back(i);
if(u[i]==1) b.push_back(i);
}
if(a.size() < 2 || b.size() < 1) return false;
else return vector<int>{a[0], b[0], a[1], a[0], b[0], a[1]};
}
else{
int e[n][n];
for(int i=0; i<m; ++i){
e[u[i]][v[i]] = i;
}
return vector<int>{e[0][1], e[1][2], e[2][0],
e[0][2], e[2][1], e[1][0],
e[2][0], e[1][2], e[0][1],
e[1][0], e[2][1], e[0][2]};
}
}
# | 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... |