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 "longesttrip.h"
#include "bits/stdc++.h"
using namespace std;
#define vi vector<int>
#define ii pair<int,int>
vi longest_trip(int n, int d){
int st=-1,en=-1;
for(int i=0;i<n;i++)
for(int j=i+1;j<n;j++)
if(!are_connected({i},{j}))
st=i,en=j;
vi res;
if(st!=-1) res.push_back(st);
for(int i=0;i<n;i++)
if(i!=st && i!=en) res.push_back(i);
if(en!=-1) res.push_back(en);
return res;
}
# | 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... |