This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// incorrect/sol_birka0_pv_D1Half_rand.cpp
#include "longesttrip.h"
#include <algorithm>
#include <random>
using namespace std;
random_device rd;
mt19937 g(rd());
vector<int> longest_trip(int N, int /*D*/)
{
vector<int> t;
for (int i = 0; i < N; ++i)
{
t.push_back(i);
}
bool ok = false;
while (!ok)
{
shuffle(t.begin(), t.end(), g);
ok = true;
for (int i = 0; i + 1 < (N + 1) / 2; ++i)
{
if (!are_connected({t[i]}, {t[i + 1]}))
{
ok = false;
break;
}
}
}
return vector<int>(t.begin(), t.begin() + (N + 1) / 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... |