This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// correct/sol_birka0_st2.cpp
#include "longesttrip.h"
using namespace std;
vector<int> longest_trip(int N, int /*D*/)
{
vector<int> t = {0};
int mx = N - 1;
for (int i = 0; i + 1 <= mx; ++i)
{
if (!are_connected({i}, {i + 1}))
{
if (i + 1 < mx)
{
t.push_back(mx);
--mx;
}
else
{
t.push_back(0);
t.erase(t.begin());
}
}
t.push_back(i + 1);
}
return t;
}
# | 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... |