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 "fun.h"
using namespace std;
int adj[501][501]; bool vis[501];
vector <int> ret;
int n;
vector <int> createFunTour (int N, int q) {
n = N;
int prev = 0;
for (int i = 0; i < n; i++) {
vector <int> o;
for (int j = 0; j < n; j++) {
if (!vis[j]) {
adj[prev][j] = hoursRequired(prev, j);
o.push_back(j);
}
}
sort(o.begin(), o.end(), [&] (int x, int y) {
return adj[prev][x] > adj[prev][y];
});
ret.push_back(o.front()); prev = o.front(); vis[prev] = 1;
//cout << prev << '\n';
}
//reverse(ret.begin(), ret.end());
return ret;
}
# | 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... |