# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
467957 | nonsensenonsense1 | Fun Tour (APIO20_fun) | C++17 | 1 ms | 256 KiB |
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 "fun.h"
#include <algorithm>
#include <vector>
const int N = 100000;
std::pair<int, int> dist[2][N];
bool u[N];
std::vector<int> createFunTour(int n, int q)
{
int v0, v1, d = 0;
for (int i = 1; i < n; ++i) {
int cur = hoursRequired(0, i);
if (cur > d) {
v0 = i;
d = cur;
}
}
d = 0;
for (int i = 0; i < n; ++i) {
dist[0][i] = std::make_pair(hoursRequired(v0, i), i);
if (dist[0][i].first > d) {
v1 = i;
d = dist[0][i].first;
}
}
for (int i = 0; i < n; ++i) dist[1][i] = std::make_pair(hoursRequired(v1, i), i);
std::sort(dist[0], dist[0] + n);
std::sort(dist[1], dist[1] + n);
std::vector<int> ans;
Compilation message (stderr)
# | 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... |