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>
#include "longesttrip.h"
using namespace std;
using ll = long long;
int n, d;
vector<int> longest_trip(int N, int D)
{
n = N;
d = D;
vector<int> g1, g2;
g1.push_back(0);
for (int i = 1;i < n;i++) {
if (are_connected({ 0 }, { i })) g1.push_back(i);
else g2.push_back(i);
}
if (!are_connected(g1, g2)) {
if (g1.size() > g2.size()) return g1;
return g2;
}
return g2;
}
# | 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... |