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;
bool are_connected(vector<int> A, vector<int> B);
vector<int> longest_trip(int N, int D){
vector<int> perc = {0};
for (int i = 1; i < N-1; i++) {
vector<int> ca = {i}, cb = {perc.back()};
if (are_connected(ca, cb)) perc.push_back(i);
else {
perc.push_back(i+1); perc.push_back(i);
}
}
vector<int> a = {N-1}, b = {perc.back()};
if (are_connected(a, b)) perc.push_back(N-1);
else {
perc.insert(perc.begin(), N-1);
}
return perc;
}
# | 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... |