# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
898654 | OAleksa | Fun Tour (APIO20_fun) | C++14 | 1 ms | 348 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 <bits/stdc++.h>
#define f first
#define s second
using namespace std;
vector<int> createFunTour(int N, int Q) {
int n = N;
int cen = 0;
if (n == 2)
return {0, 1};
for (int i = 1;i < n;i++) {
if (attractionsBehind(cen, i) * 2 >= n)
cen = i;
}
vector<int> dis(n);
for (int i = 0;i < n;i++) {
if (i == cen)
continue;
dis[i] = hoursRequired(cen, i);
}
vector<int> p;
for (int i = 0;i < n;i++) {
if (dis[i] == 1) {
p.push_back(i);
}
}
int m = p.size();
vector<int> ch[m];
for (int i = 0;i < n;i++) {
if (i == cen)
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... |